One warning - 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: One warning (
/showthread.php?tid=335654)
One warning -
Dripac - 19.04.2012
pawn Код:
warning 202: number of arguments does not match definition
pawn Код:
stock PushPlayer(playerid, Float:X1, Float:Y2)
{
new
Float:pX1,
Float:pY2;
GetPlayerPos(playerid, X1, Y2);
new Float:ang = (-acos((X1 - pX1) / floatsqroot((X1 - pX1)*(X1 - pX1) + (Y2 - pY2)*(Y2 - pY2))) - 90.0);
pX1 = (-3 * floatsin(-ang, degrees));
pY2= (-3 * floatcos(-ang, degrees));
if(GetPlayerState(playerid) == 2)
{
SetVehicleVelocity(GetPlayerVehicleID(playerid), pX1+5, pY2+5, 100.0);
SetVehicleHealth(GetPlayerVehicleID(playerid), 15.0);
}
else if(GetPlayerState(playerid) == 1)
{
SetPlayerVelocity(playerid, pX1+5, pY2+5,100.0);
}
SetPlayerHealth(playerid, 15.0);
return 0;
}
Thats the line of the warning
pawn Код:
GetPlayerPos(playerid, X1, Y2);
Re: One warning -
sleepysnowflake - 19.04.2012
You also need the Z. Doesn't matter if you don't use it ...
pawn Код:
stock PushPlayer(playerid, Float:X1, Float:Y2)
{
new
Float:pX1,
Float:pY2,
Float:pZ3;
GetPlayerPos(playerid, X1, Y2, pZ3);
new Float:ang = (-acos((X1 - pX1) / floatsqroot((X1 - pX1)*(X1 - pX1) + (Y2 - pY2)*(Y2 - pY2))) - 90.0);
pX1 = (-3 * floatsin(-ang, degrees));
pY2= (-3 * floatcos(-ang, degrees));
if(GetPlayerState(playerid) == 2)
{
SetVehicleVelocity(GetPlayerVehicleID(playerid), pX1+5, pY2+5, 100.0);
SetVehicleHealth(GetPlayerVehicleID(playerid), 15.0);
}
else if(GetPlayerState(playerid) == 1)
{
SetPlayerVelocity(playerid, pX1+5, pY2+5,100.0);
}
SetPlayerHealth(playerid, 15.0);
return 0;
}
Re: One warning -
Dripac - 19.04.2012
Thank you

+rep