09.12.2010, 04:47
Hello. This is my 3rd thread regarding this error. Well, I have made a basic admin script for my current work [San Fierro Harbor]. So all the admin commands are 'built' but I need help here because if I do the command with no id / partofname like just /makegolden it returns the right value but if i type /makegolden it returns SERVER: Unknown command with no effect.
P.S: This isn't the only failing commands. other commands with extra parameters faill too.
P.S: The tmp string is 256 cells, I KNOW, DONT SAY IT.
P.S: I get no errors or warnings at all.
So this is the code.
Thanks for helps !
P.S: This isn't the only failing commands. other commands with extra parameters faill too.
P.S: The tmp string is 256 cells, I KNOW, DONT SAY IT.
P.S: I get no errors or warnings at all.
So this is the code.
pawn Код:
if(strcmp(cmdtext, "/makegolden", true)==0)
{
new tmp[256];
tmp = strtok( cmdtext, idx );
if (!strlen(tmp))
{
return SendClientMessage(playerid,COLOR_GRAY,"[SERVER]: /makegolden");
}
if(PlayerInfo[playerid][pAdminLevel] == 2)
{
new string[50], string2[50], adminname[MAX_PLAYER_NAME], givename[MAX_PLAYER_NAME];
GetPlayerName(playerid, adminname, sizeof(adminname));
GetPlayerName(playerid, givename, sizeof(givename));
format(string, sizeof(string), " Administrator %s has made you a Golden User. Thanks for donating!", adminname);
format(string2, sizeof(string2), " You have made %s a Golden User.", givename);
SendClientMessage(playerid,COLOR_YELLOW,string2);
SendClientMessage(strval(tmp),COLOR_YELLOW,string);
PlayerInfo[strval(tmp)][pIsGolden] = 1;
return 1;
}
else SendClientMessage(playerid,COLOR_GRAY,"[SERVER]: You are not an admin !");
if(strval(tmp) == playerid) SendClientMessage(playerid,COLOR_RED,"[ERROR] You cannot do this on yourself!");
if(strval(tmp) == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"[ERROR]: Invalid ID.");
return 1;
}



