SA-MP Forums Archive
Errors - 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: Errors (/showthread.php?tid=425027)



Errors - Louris - 24.03.2013

Код:
SetVehicleSpeed(vehicleid, + 10);
When remove + all good.

C:\Users\Lauris1\Desktop\failai\Servas\gamemodes\b om.pwn(839) : error 029: invalid expression, assumed zero
C:\Users\Lauris1\Desktop\failai\Servas\gamemodes\b om.pwn(839) : warning 215: expression has no effect
C:\Users\Lauris1\Desktop\failai\Servas\gamemodes\b om.pwn(839) : error 001: expected token: ";", but found ")"
C:\Users\Lauris1\Desktop\failai\Servas\gamemodes\b om.pwn(839) : error 029: invalid expression, assumed zero
C:\Users\Lauris1\Desktop\failai\Servas\gamemodes\b om.pwn(839) : fatal error 107: too many error messages on one line

stock:

Код:
stock SetVehicleSpeed(vehicleid, Float:speed)
{
    new Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2, Float:a;
    GetVehicleVelocity(vehicleid, x1, y1, z1);
    GetVehiclePos(vehicleid, x2, y2, z2);
    GetVehicleZAngle(vehicleid, a); a = 360 - a;
    x1 = (floatsin(a, degrees) * (speed/100) + floatcos(a, degrees) * 0 + x2) - x2;
    y1 = (floatcos(a, degrees) * (speed/100) + floatsin(a, degrees) * 0 + y2) - y2;
    SetVehicleVelocity(vehicleid, x1, y1, z1);
}



Respuesta: Errors - Parka - 24.03.2013

for that you need the '+' ?

Edit: use
pawn Код:
SetVehicleSpeed( vehicleid , 10.0 );



Re: Errors - dusk - 24.03.2013

You need to add TO something. You can't just somethig +1


EDIT Actually listen to ******


Re: Errors - Sweez - 24.03.2013

pawn Код:
stock SetVehicleSpeed(vehicleid, Float:speed);
{
    new Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2, Float:a;
    GetVehicleVelocity(vehicleid, x1, y1, z1);
    GetVehiclePos(vehicleid, x2, y2, z2);
    GetVehicleZAngle(vehicleid, a); a = 360 - a;
    x1 = (floatsin(a, degrees) * (speed/100) + floatcos(a, degrees) * 0 + x2) - x2;
    y1 = (floatcos(a, degrees) * (speed/100) + floatsin(a, degrees) * 0 + y2) - y2;
    SetVehicleVelocity(vehicleid, x1, y1, z1);
}