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=532108)



argument type mismatch - monster010 - 16.08.2014

Код:
error 035: argument type mismatch (argument 2)
pawn Код:
public MSGPescarTime()
{
    new randpescar = random(sizeof(MSGPescar));
    SendClientMessage(COLOR_WHITE, MSGPescar[randpescar]);
    return 1;
}
Why give me these error? WTF !


Re: argument type mismatch - Affan - 16.08.2014

pawn Код:
SendClientMessage(COLOR_WHITE, MSGPescar[randpescar]); // It's SendClientMessage(playerid, COLOR_WHITE, MSGPescar[randpescar]);

// But in this case, there is no playerid, so why not use
SendClientMessageToAll(COLOR_WHITE, MSGPescar[randpescar]);



Re: argument type mismatch - monster010 - 16.08.2014

How to make it to "SendClientMessasge"?


Re: argument type mismatch - Tadas - 16.08.2014

Quote:
Originally Posted by monster010
Посмотреть сообщение
How to make it to "SendClientMessasge"?
pawn Код:
SendClientMessage(playerid, COLOR_WHITE, MSGPescar[randpescar]);
+Rep me if I helped you


Re: argument type mismatch - Affan - 16.08.2014

Quote:
Originally Posted by monster010
Посмотреть сообщение
How to make it to "SendClientMessasge"?
Either this way:

pawn Код:
forward MSGPescarTime(playerid);
public MSGPescarTime(playerid)
{
    new randpescar = random(sizeof(MSGPescar));
    SendClientMessage(playerid, COLOR_WHITE, MSGPescar[randpescar]);
    return 1;
}
or

pawn Код:
public MSGPescarTime()
{
    foreach(new i : Player)
    {
        new randpescar = random(sizeof(MSGPescar));
        SendClientMessage(i, COLOR_WHITE, MSGPescar[randpescar]);
    }
    // But it seriously doesn't make any sense, why not just use SendClientMessageToAll?
    return 1;
}



Re: argument type mismatch - monster010 - 16.08.2014

Beceasue these messages doesn't not see all players.