13.02.2010, 14:37
Hello im trying to make a /swatrank its basicly the same like /giverank, but how can i make it like if he types it says :
You have promoted ''playername'' to ''swatrank''
and also how can i make it like if he does /swatrank 1 it sets swatrank = 1;
/swatrank sets swatrank = 2; and so on..
This is how my cmds looks alike so far..
You have promoted ''playername'' to ''swatrank''
and also how can i make it like if he does /swatrank 1 it sets swatrank = 1;
/swatrank sets swatrank = 2; and so on..
This is how my cmds looks alike so far..
Код:
//----------------------------------[SWATRANK]------------------------------------------------ if(strcmp(cmd, "/swatrank", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /Swatrank [playerid/PartOfName] [swat rank]"); return 1; } new para1; new level; para1 = ReturnUser(tmp); tmp = strtok(cmdtext, idx); level = strval(tmp); if(level > 4 || level < 1) { SendClientMessage(playerid, COLOR_GREY, "Wrong SWAT Rank."); return 1; } if (PlayerInfo[playerid][pRankSWAT] >= 4 || PlayerInfo[playerid][pAdmin] >=6) { if(IsPlayerConnected(para1)) { if(para1 != INVALID_PLAYER_ID) { GetPlayerName(para1, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "You have been promoted to SWAT by %s", sendername); SendClientMessage(para1, COLOR_WHITE, string); format(string, sizeof(string), "You have Promoted %s SWAT rank %d.", giveplayer,level); SendClientMessage(playerid, COLOR_WHITE, string); } }//not connected } else { SendClientMessage(playerid, COLOR_GRAD1, "* you are not authorized to use that command!"); } } return 1; }