11.10.2015, 17:14
Hello world i want to convert to zcmd anybody can help me please?
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { new string[256]; new sendername[MAX_PLAYER_NAME]; new giveplayer[MAX_PLAYER_NAME]; new cmd[256]; new tmp[256]; new idx; cmd = strtok(cmdtext, idx); if(strcmp(cmd, "/referee", true) == 0) { if(IsPlayerConnected(playerid)) { if(!IsPlayerAdmin(playerid)) { SendClientMessage(playerid, COLOR_WHITE, "You are not logged into RCON"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /referee [playerid/PartOfName]"); return 1; } new para1; para1 = ReturnUser(tmp); tmp = strtok(cmdtext, idx); if(IsPlayerConnected(para1)) { if(para1 != INVALID_PLAYER_ID) { GetPlayerName(para1, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); arbitro[para1] = 1; printf("%s chooses %s as referee.", sendername, giveplayer); format(string, sizeof(string), " %s chooses you as referee", sendername); SendClientMessage(para1, COLOR_WHITE, string); format(string, sizeof(string), " You choose %s as referee.", giveplayer); SendClientMessage(playerid, COLOR_WHITE, string); format(string, sizeof(string), " %s is the referee for the next match! Go to the stadium!", giveplayer); SendClientMessageToAll(COLOR_GROVE, string); skin[para1] = GetPlayerSkin(para1); SetPlayerSkin(para1, 72); } } } return 1; } if(strcmp(cmd, "/rcmds", true) == 0) { if(IsPlayerConnected(playerid)) { if(arbitro[playerid] == 1) { format(string, sizeof(string), "%s\n%s\nAnnounce\nStuart\nStart Match\nBall at centre\nBall here\nFire\nGoal\nStop Game\nEnd Match\nCoin", squadra1, squadra2); ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Referee Commands", string, "Select", "Exit"); } }return 1; } return 0; }