argument type mismatch (argument 2)
#9

Worse example:
Quote:
pawn Код:
forward SendTaxiMessage(color, stringz[])

public SendTaxiMessage(color, stringz[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i))
    {
        if(Taxijob[i] == 1) return SendClientMessage(i, color, stringz);
    }
}
This callback will stop working after the first player with Taxijob = 1 and returns an unneeded value.

Probably correct one:
pawn Код:
forward SendTaxiMessage(color, stringz[]);
public SendTaxiMessage(color, stringz[]) for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) if(Taxijob[i]) SendClientMessage(i, color, stringz);
Another version if you don't use any timers or CallRemoteFunction/CallLocalFunction to call this function:
pawn Код:
stock SendTaxiMessage(color, stringz[]) for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) if(Taxijob[i]) SendClientMessage(i, color, stringz);
Reply


Messages In This Thread
argument type mismatch (argument 2) - by vincee - 26.12.2011, 17:47
Re: argument type mismatch (argument 2) - by jamiesage123 - 26.12.2011, 17:53
Re: argument type mismatch (argument 2) - by [Diablo] - 26.12.2011, 17:53
Re: argument type mismatch (argument 2) - by vincee - 26.12.2011, 18:25
Re: argument type mismatch (argument 2) - by vincee - 26.12.2011, 18:28
Re: argument type mismatch (argument 2) - by =WoR=G4M3Ov3r - 26.12.2011, 18:39
Re: argument type mismatch (argument 2) - by Las Venturas CNR - 26.12.2011, 19:37
Re: argument type mismatch (argument 2) - by =WoR=G4M3Ov3r - 26.12.2011, 20:18
AW: argument type mismatch (argument 2) - by BigETI - 26.12.2011, 20:30

Forum Jump:


Users browsing this thread: 2 Guest(s)