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;
}
|
GiveBounty(playa, money); |
forward GiveBounty(playerid, value);
public GiveBounty(playerid, value)
{
if(PlayerInfo[playerid][pClubLeader] == 1 || PlayerInfo[playerid][pClubMember] == 1)
{
PlayerInfo[playerid][pBounty] = PlayerInfo[playerid][pBounty] + value;
new string[128];
format(string, sizeof(string), "[NFS Club] Ai castigat %d Bounty Points", value);
SendClientMessage(playerid, COLOR_GREEN, string);
}
else if(PlayerInfo[playerid][pClubLeader] == 2 || PlayerInfo[playerid][pClubMember] == 2)
{
PlayerInfo[playerid][pBounty] = PlayerInfo[playerid][pBounty] + value;
new string[128];
format(string, sizeof(string), "[NRG Club] Ai castigat %d Bounty Points", value);
SendClientMessage(playerid, COLOR_GREEN, string);
}
}
if( strcmp( key , "Bounty" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pBounty] = strval( val ); }
PlayerInfo[playerid][pBounty] = 0;
new bounty = PlayerInfo[targetid][pBounty];
format(var, 128, "Bounty=%d\n",PlayerInfo[playerid][pBounty]);fwrite(hFile, var);
format(var, 32, "Bounty=%d\n",PlayerInfo[playerid][pBounty]);fwrite(hFile, var);
PlayerInfo[playerid][pBounty] = PlayerInfo[playerid][pBounty] + value;
PlayerInfo[playerid][pBounty] = value;
stock SetPlayerBounty(playerid,bounty)
{
return PlayerInfo[playerid][pBounty] = bounty;
}
CMD:setbounty(playerid,params[])
{
if(PlayerInfo[playerid][pClubLeader] >= 1 || PlayerInfo[playerid][pClubMember] >= 1)
{
new bid;
new bountyvalue;
if(sscanf(params,"ui",bid,bountyvalue)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /setbounty [playerid] [bounty]");
SetPlayerBounty(bid,bountyvalue);
//Other message functions here.
}
else
{
SendClientMessage(playerid, 0xFF0000FF, "Your error message here");
}
return 1;
}