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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Argument type mismatch (
/showthread.php?tid=231362)
Argument type mismatch -
Libra_PL - 25.02.2011
Hey, I've got a little problem in script. I have two errors, they appear in format lines. The error is "argument type mismatch (argument 2)". I don't know should I do (never tried GetObjectPos and Rotation before in that). Could anyone fix this?
Код:
if(RampID[playerid] == 1655)
{
if(CreatedRamp[playerid] == true) DestroyPlayerObject(playerid, Ramp), CreatedRamp[playerid] = false;
new Float:pX,Float:pY,Float:pZ,Float:vA, Arabam = GetPlayerVehicleID(playerid);
GetVehiclePos(Arabam, pX, pY, pZ);
GetVehicleZAngle(Arabam, vA);
Ramp = CreatePlayerObject(playerid, RampID[playerid], pX + (40.0 * floatsin(-vA, degrees)), pY + (40.0 * floatcos(-vA, degrees)), pZ, 0, 0, vA);
CreatedRamp[playerid] = true;
SetTimerEx("destroy", 15000,0,"d",playerid);
new Float:X, Float:Y, Float:Z, Float:RotX, Float:RotY, Float:RotZ, string[128];
GetObjectPos(Ramp,X,Y,Z);
GetObjectRot(Ramp,RotX,RotY,RotZ);
format(string,sizeof(string),"Current Ramp position is X=%s Y=%s Z=%s!", X, Y, Z);
SendClientMessage(red,string);
format(string,sizeof(string),"Current Ramp rotation is X=%s Y=%s Z=%s!", RotX, RotY, RotZ);
SendClientMessage(red,string);
}
Re: Argument type mismatch -
Jeffry - 25.02.2011
Try:
pawn Код:
if(RampID[playerid] == 1655)
{
if(CreatedRamp[playerid] == true) DestroyPlayerObject(playerid, Ramp), CreatedRamp[playerid] = false;
new Float:pX,Float:pY,Float:pZ,Float:vA, Arabam = GetPlayerVehicleID(playerid);
GetVehiclePos(Arabam, pX, pY, pZ);
GetVehicleZAngle(Arabam, vA);
Ramp = CreatePlayerObject(playerid, RampID[playerid], pX + (40.0 * floatsin(-vA, degrees)), pY + (40.0 * floatcos(-vA, degrees)), pZ, 0, 0, vA);
CreatedRamp[playerid] = true;
SetTimerEx("destroy", 15000,0,"d",playerid);
new Float:X, Float:Y, Float:Z, Float:RotX, Float:RotY, Float:RotZ, string[128];
GetObjectPos(Ramp,X,Y,Z);
GetObjectRot(Ramp,RotX,RotY,RotZ);
new string[128];
format(string,sizeof(string),"Current Ramp position is X=%0.2f Y=%0.2f Z=%0.2f!", X, Y, Z);
SendClientMessage(red,string);
format(string,sizeof(string),"Current Ramp rotation is X=%0.2f Y=%0.2f Z=%0.2f!", RotX, RotY, RotZ);
SendClientMessage(red,string);
}
Using my Ramping FS, eh?