SA-MP Forums Archive
Mismatch error +rep if helped - 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: Mismatch error +rep if helped (/showthread.php?tid=567940)



Mismatch error +rep if helped - MrCallum - 17.03.2015

Код:
new PlayerText:Speedo[MAX_PLAYERS];
Quote:

C:\Users\Callum.Acer\Desktop\Servers\XenRP\gamemod es\LARP1.pwn(3380) : error 035: argument type mismatch (argument 2)
C:\Users\Callum.Acer\Desktop\Servers\XenRP\gamemod es\LARP1.pwn(3386) : error 035: argument type mismatch (argument 2)

For:

Код:
ShowSpeed(playerid)
{
    PlayerTextDrawShow(playerid, Speedo);
    PlayerTextDrawSetString(playerid,SpeedoText0,"Vehicle: %s~n~Speed: %i KPH");LINE 3380
}

stock HideSpeed(playerid)
{
	PlayerTextDrawHide(playerid, Speedo);LINE 3386
}



Re: Mismatch error +rep if helped - AlonzoTorres - 17.03.2015

Quote:
Originally Posted by MrCallum
Посмотреть сообщение
Код:
new PlayerText:Speedo[MAX_PLAYERS];

For:

Код:
ShowSpeed(playerid)
{
    PlayerTextDrawShow(playerid, Speedo);
    PlayerTextDrawSetString(playerid,SpeedoText0,"Vehicle: %s~n~Speed: %i KPH");LINE 3380
}

stock HideSpeed(playerid)
{
	PlayerTextDrawHide(playerid, Speedo);LINE 3386
}
Try:

Код:
ShowSpeed(playerid)
{
    PlayerTextDrawShow(playerid, Speedo[playerid]);
    PlayerTextDrawSetString(playerid, Speedo[playerid],"Vehicle: %s~n~Speed: %i KPH");
}

stock HideSpeed(playerid)
{
	PlayerTextDrawHide(playerid, Speedo[playerid]);
}



Respuesta: Mismatch error +rep if helped - JuanStone - 17.03.2015

PHP код:
PlayerTextDrawSetString(playeridSpeedoText0,"Vehicle: %s~n~Speed: %i KPH"); 
This will display an incorrect text, you must make format above, the text you entered there must already be formatted.

PHP код:
ShowSpeed(playerid)
{
    new 
string[45];
    
PlayerTextDrawShow(playeridSpeedo[playerid]);
    
format(stringsizeof(string), "Vehicle: %s~n~Speed: %i KPH", {Float,_}..);
    
PlayerTextDrawSetString(playeridspeedoText0[playerid], string);

And add "[playerid]" and check that the variables have the correct tag.

PHP код:
new Text:var[MAX_PLAYERS];