28.01.2018, 08:06
If i kill an player me and my clan members should get money. But None get. When the Other guy kills he gets the reward.
Here is the code:
Here is the code:
PHP код:
if(ccashreward == 1)
{
foreach(new i : Player)
{
if(GetPlayerClanId(i) == GetPlayerClanId(killerid))
{
new string1[150],string[150];
new name1[150];
GetPlayerName(i, name1, sizeof(name1));
format(string1,sizeof(string1),"No Reward For Killing Own Clan Member");
SendClientMessage(playerid,COLOR_RED,string1);
format(string,sizeof(string),"%s has killed %s",name1,Playername);
SendMessageToClanMembers(playerid,COLOR_RED,string);
}
else
{
new string[150];
new moneyreward = 1000+random(2001);
format(string, sizeof(string), "[Clan]: You've been rewarded %i$ from %s's kill!", moneyreward, Playername);
SendClientMessage(i, 0x00FF7FAA, string);
GivePlayerMoney(i, moneyreward);
}
}
return 1;
}