Hi all, here is my cmd. apparently the server fails to function, or nose if I'm the bad scripter.
get to the point, I want the server to deliver $ 100 to 2 players from different teams randomly.
example: pedro (Team X): get $ 100 from the server.
example: guy (and team) receives $ 100 from the server.
That's what I want to do the server
[pawn]else if ( strcmp( cmd, "cashazar", true ) == 0 )
{
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Por favor,conectate en tu cuenta!" );
else if ( !IsAuthorized( playerid, cmd ) ) SendClientMessage( playerid, COLOR_RED, "Tu no tienes acceso a este comando!" );
else
{
format( szMsg, 256, "Admin [%s] starting Cash Azar", gPlayers[ playerid ]);
SendClientMessageToAll( GREEN, szMsg );
new m = GetMaxPlayers() + 1;
for(new i = 0; i < m; i++) {
if (IsPlayerConnected(i)) {
if(GetPlayerTeam(random(m)) == 15) {
format(szMsg,256,"[%s] the leader of your team receives $100.",gPlayers[ random(m) ]);
SendClientMessageToAll(BLUE, szMsg);
IncPlayerHandCash(random(m),100);
}
else if(GetPlayerTeam(random(m)) == 11) {
format(szMsg,256,"[%s] the leader of your team receives $100.",gPlayers[ random(m) ]);
SendClientMessageToAll(COLOR_YELLOW, szMsg);
IncPlayerHandCash(random(m),100);
}
}
}
}
return 1;
}[/pawn]