05.06.2012, 17:32
I'm working on a script from scratch...
My poblem is that every commands that need ID of the player doesn't work.
This commands are self-made.
EDIT: It doesn't happen anything ! I type the cmd and it wouldn't work..
Here is one example:
Thank you.
My poblem is that every commands that need ID of the player doesn't work.
This commands are self-made.
EDIT: It doesn't happen anything ! I type the cmd and it wouldn't work..
Here is one example:
Код:
if(!strcmp(cmd, "/makeadmin", true)) { if(!IsPlayerConnected(playerid)) { new giveplayer[128]; new sendername[128]; new string[128]; new tmp[256]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "Usage: /makeadmin [Player's ID/Part of pl's name] [level(3-10)]"); return 1; } new para1; new level; para1 = ReturnUser(tmp); tmp = strtok(cmdtext, idx); level = strval(tmp); if(PlayerInfo[playerid][pAdmin] >= 10) { if(IsPlayerConnected(para1)) { if(para1 != INVALID_PLAYER_ID) { if(level < 3 || level > 10) return SendClientMessage(playerid, COLOR_GREY,"* Only 3-10!!"); GetPlayerName(para1, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); PlayerInfo[para1][pAdmin] = level; printf("AdmCmd: Admin %s gived %s admin level %d.", sendername, giveplayer, level); format(string, sizeof(string), "* You are now admin level %d | Head Admin: {FFFFFF}%s", level, sendername); SendClientMessage(para1, COLOR_LIGHTBLUE, string); format(string, sizeof(string), " %s is now Admin level {FFFFFF}%d.", giveplayer,level); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); } } } else { SendClientMessage(playerid, WHITE, " You are not allowed to do this!!!"); } } return 1; }