21.09.2010, 13:29
Code can be made easyer i think!
pawn Код:
dcmd_giveteamcash(playerid, params[])
{
new giveammount, teamid;
new string[128];
if(sscanf(params, "udi", targetid, teamid, giveammount)) return SendClientMessage(playerid, red, "error: /giveteamcash teamid ammount");
if(teamid == 1)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(gTeam[i] == TEAMNAME) return GivePlayerMoney(i, giveammount);
}
if(teamid == 2)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(gTeam[i] == TEAMNAME) return GivePlayerMoney(i, giveammount);
}
return 1;
}