SA-MP Forums Archive
Argument Type Mismatch - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Argument Type Mismatch (/showthread.php?tid=457974)



Argument Type Mismatch - lewismichaelbbc - 14.08.2013

Код:
C:\Users\Lewis\Desktop\SARP R112\gamemodes\sarp.pwn(18091) : error 035: argument type mismatch (argument 2)
C:\Users\Lewis\Desktop\SARP R112\gamemodes\sarp.pwn(18092) : error 033: array must be indexed (variable "-unknown-")
pawn Код:
new sendername;
    for(new i=0; i < MAX_PLAYERS; i++)
    {
        GetPlayerName(i, sizeof(sendername), sendername); // Line 18091
        if(sendername == "ALLSAINTS_Taxi_Service")         // Line 18092
        {
            Kick(i);
        }
    }
Please could you take a look and let me know of what the problem could be?

Thanks - Lewis


Re: Argument Type Mismatch - Dragonsaurus - 14.08.2013

pawn Код:
new sendername[MAX_PLAYER_NAME];
for(new i = 0; i < MAX_PLAYERS; i++)
{
     GetPlayerName(i, sendername, sizeof(sendername));
     if(strcmp(sendername, "ALLSAINTS_Taxi_Service", true) == 0)
     {
          Kick(i);
     }
}



Re: Argument Type Mismatch - lewismichaelbbc - 14.08.2013

Works. Thanks