Wysłany: 2013-09-01, 10:53
PITBULL6758
Wiek: 30 Na forum: 5972 dni Posty: 58
Nick w MP: BEZREGULY
Piwa : 5
Elo
Jak zrobic EYE ON/OFF dla admina? co sa wyswietlane all komendy wpisane przez graczy
[ Dodano : 2013-09-01, 12:15 ]
Mam b??d:
error 030: compound statement not closed at the end of file (started at line 31)
Kod: #include <a_samp>
#include <strtok>
#define COLOR_ADMIN 0xFF0000AA
#define COLOR_YELLOW 0x33AA33AA
#define COLOR_RED 0xAA3333AA
public OnFilterScriptInit() {
}
PlayerName(playerid){
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
return Name;
}
SendClientMessageToAdmins(color, const zmienna[]) {
for(new a=0; a<MAX_PLAYERS; a++) {
if(IsPlayerConnected(a)) {
if(IsPlayerAdmin(a)) {
SendClientMessage(a, color, zmienna);
}
}
}
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new pname2[MAX_PLAYER_NAME];
new cmdname[256];
new temp[256];
new eye2 = 0;
GetPlayerName(playerid, pname2, sizeof(pname2));
strmid(cmdname, cmdtext, 0, strlen(cmdtext));
if(eye2) {
format(temp, sizeof(temp), "Gracz o nicku %s wpisa? komend? %s", pname2, cmdname);
for(new e=0; e<MAX_PLAYERS; e++)
if(IsPlayerConnected(e) && IsPlayerAdmin(e)){
if(e == playerid){
} else {
SendClientMessage(e, 0xFF0000FF, temp);
}
}
}
new cmd[256];
new idx;
new string[256];
new tmp[256];
new tmp2[256];
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/eye ", true) == 0 && IsPlayerAdmin(playerid)) {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_RED, " /eye [on-off] : w?acz - wy?acz.");
return 1;
}
if(strcmp(tmp, "on", true)==0){
eye2=1;
SendClientMessage(playerid, COLOR_YELLOW,"W?aczy?es podglad komend wpisywanych przez graczy");
format(string, sizeof(string), "",PlayerName(playerid));
SendClientMessageToAdmins(COLOR_YELLOW,string);
format(string, sizeof(string), "%s W?aczy? podglad komend wpisywanych przez graczy",PlayerName(playerid), playerid);
printf(string);
return 1;
}
if(strcmp(tmp, "off", true)==0){
eye2=0;
SendClientMessage(playerid, COLOR_ADMIN,Wy?aczy?es podglad komend wpisywanych przez graczy");
format(string, sizeof(string), "",PlayerName(playerid));
SendClientMessageToAdmins(COLOR_ADMIN,string);
format(string, sizeof(string), "",PlayerName(playerid), playerid);
printf(string);
return 1;
}
}
Wysłany: 2013-09-01, 12:41
IgrexolonO
Wiek: 34 Na forum: 6809 dni Posty: 1386
Piwa : 1062
Kod: new bool:eye ;
stock SendClientMessageToAdmins(color, text[]) for(new i;i<MAX_PLAYERS;i++) if(IsPlayerConnected(i) && IsPlayerAdmin(i)) SendClientMessage(i, color, text);
stock PlayerName(playerid)
{
new n[24];
GetPlayerName(playerid, n, 24);
return n;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(eye )
{
new _string[80];
format(_string, sizeof(_string), "%s wpisa? komend? \"%s\"", PlayerName(playerid), cmdtext);
SendClientMessageToAdmins(0x33AA33AA, _string);
}
if(IsPlayerAdmin(playerid) && (cmdtext[1] == 'e' && cmdtext[2] == 'y' && cmdtext[3] == 'e'))
{
new _string[80];
if(cmdtext[6] == 'n')
{
eye = true;
SendClientMessage(playerid, 0x33AA33AA, "W?aczy?e? podgl?d komend wpisywanych przez graczy!");
format(_string, sizeof(_string), "%s w??czy? podgl?d komend wpisywanych przez graczy.", PlayerName(playerid));
SendClientMessageToAdmins(0x33AA33AA, _string);
return true;
}
if(cmdtext[6] == 'f')
{
eye = false;
SendClientMessage(playerid, 0x33AA33AA, "Wy?aczy?e? podgl?d komend wpisywanych przez graczy!");
format(_string, sizeof(_string), "%s wy??czy? podgl?d komend wpisywanych przez graczy.", PlayerName(playerid));
SendClientMessageToAdmins(0x33AA33AA, _string);
return true;
}
return true;
}
return false;
}
Ostatnio zmieniony przez IgrexolonO 2013-09-08, 13:09, w całości zmieniany 2 razy
Wysłany: 2013-09-01, 12:58
PITBULL6758
Wiek: 30 Na forum: 5972 dni Posty: 58
Nick w MP: BEZREGULY
Piwa : 5
yy nie wy?wietla si? na czacie komendy gdy wpisuje gracz a jest eye on i nie mo?na u?ywa? innych komend nawet nie ma Unkown Command
Wysłany: 2013-09-01, 13:23
IgrexolonO
Wiek: 34 Na forum: 6809 dni Posty: 1386
Piwa : 1062
Tagi: eye
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: