23.06.2011, 18:41
in my server i have this command
to make someone donator i need to put him the id of the player and donate level how i can make to pu t only id and automatically to give him 3 level donator
PHP код:
if(strcmp(cmd, "/makedonator", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /makedonator [Playerid/PartOfName] [donate rank]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
PlayerInfo[para1][pDonateRank] = level;
format(string, sizeof(string), "* made you %d level VIP", level, PlayerName(playerid));
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* you make %s level %d VIP.", giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not Admin!");
}
}
return 1;
}