16.10.2012, 16:12
pawn Код:
if(strcmp(cmd, "/givebounty", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /givebounty [playerid/PartOfName] [points]");
return 1;
}
new playa;
new money;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
money = strval(tmp);
if (PlayerInfo[playerid][pClubLeader] == 1)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GiveBounty(playa, money);
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s a primit %d Bounty Points de la %s.", giveplayer,money,sendername);
SendClubMessage(1, COLOR_LIGHTBLUE, string);
}
}
}
else if (PlayerInfo[playerid][pClubLeader] == 2)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GiveBounty(playa, money);
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s a primit %d Bounty Points de la %s.", giveplayer,money,sendername);
SendClubMessage(2, COLOR_LIGHTBLUE, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Nu esti autorizat sa folosesti aceasta comanda!");
}
}
return 1;
}
I want to create a command that sets the bounty.