12.04.2012, 16:06
Hello,
I'm making a command, i want to make this: when i type: /giveperm [playerid] [Nick/pass]
But the problem is, it doesnt work, maybe you can help?
- JeroenX
I'm making a command, i want to make this: when i type: /giveperm [playerid] [Nick/pass]
But the problem is, it doesnt work, maybe you can help?
Код:
if(strcmp(cmd, "/gperm", true) == 0) { tmp = strtok(cmdtext, idx); new aperm[4]; strmid(aperm, tmp, false, strlen(cmdtext), 4); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GREY, "USAGE: /gperm [nick/pass]"); return 1; } giveplayerid = strval(tmp); if(strcmp(aperm, "nick", true, strlen(aperm)) == 0) { if ((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >= 1) { ShowPlayerDialog(giveplayerid, 57, DIALOG_STYLE_LIST, "Change nick", "Change Nickname\nChange Password", "Select", "Cancel"); ChangenickAllowed[giveplayerid] = 1; format(string, sizeof(string), "Server: %s Has been given permission to change he's nickname or password by admin %s",PlayerName[giveplayerid] ,PlayerName[playerid]); SendClientMessageToAll(COLOR_RED, string); } return 1; } if(strcmp(aperm, "pass", true, strlen(aperm)) == 0) { if ((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >= 1) { ShowPlayerDialog(giveplayerid, 57, DIALOG_STYLE_LIST, "Change pass", "Change Nickname\nChange Password", "Select", "Cancel"); ChangenickAllowed[giveplayerid] = 1; format(string, sizeof(string), "Server: %s Has been given permission to change he's nickname or password by admin %s",PlayerName[giveplayerid] ,PlayerName[playerid]); SendClientMessageToAll(COLOR_RED, string); } return 1; } else { SendClientMessage(playerid, COLOR_GREY, "USAGE: /care [yes/no]"); } return 1; }