09.09.2016, 21:00
use mine command with zcmd and sscanf
edit this where is something not on english to you want
Код:
CMD:makeleader(playerid,params[]) { new string[128], igrac, giveplayerid, giveplayer[MAX_PLAYER_NAME], level, sendername[MAX_PLAYER_NAME]; GetPlayerName(playerid, sendername, sizeof(sendername)); if(IsPlayerAdmin(playerid)) { if(!sscanf(params, "ui", giveplayerid, level)) { PlayerInfo[igrac][pRank] = 6; PlayerInfo[igrac][pMember] = 0; GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1,"Pogresan igracev id"); PlayerInfo[giveplayerid][pLeader] = level; format(string, sizeof(string), "Dao si igracu %s lidera organizacije %i", giveplayer, level); SendClientMessage(playerid, -1, string); format(string, sizeof(string), "Admin %s ti je dao lidera organizacije %i", sendername, level); SendClientMessage(giveplayerid, -1, string); if(level == 0) { PlayerInfo[giveplayerid][pSkin] = 0; PlayerInfo[giveplayerid][pRank] = 0; return 1; } else if(level == 1) { PlayerInfo[giveplayerid][pSkin] = 288; } //Policija SetPlayerSkin(giveplayerid,PlayerInfo[giveplayerid][pSkin]); } else SendClientMessage(playerid, -1,"Koristenje /makeleader [IDigraca/Dio imena] [broj(1-2)]"); } else SendClientMessage(playerid, -1,"Niste ovlasteni da koristite ovu komandu"); return 1; }