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



Body remove - Frosty_LV - 20.07.2012

Hello! I was making a body system, like after a cmd there appears a body. It works, body appeared on screen but the /removebody doesn't compile, it asks me this: error 017: undefined symbol "x"

Here is the script:

PHP код:
CMD:placebody(playeridparams[])//This works perfectly
{
CreateObject(3092000000);
new 
Float:x,Float:y,Float:z;
GetPlayerPos(playeridxyz);
CreateObject(3092xyz90.00000.0000358.3903);
}
CMD:removebody(playeridparams[])//This doesn't compile
{
new 
deadbody CreateObject(3092xyz90.00000.0000358.3903);
new 
Float:x,Float:y,Float:z;
GetPlayerPos(playeridxyz);
DestroyObject(deadbody);




Re: Body remove - nepstep - 20.07.2012

pawn Код:
CMD:placebody(playerid, params[])//This works perfectly
{
CreateObject(3092, 0, 0, 0, 0, 0, 0);
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
CreateObject(3092, x, y, z, 90.0000, 0.0000, 358.3903);
}
CMD:removebody(playerid, params[])//This will now compile
{
new Float:x,Float:y,Float:z; //you should first do "new Float:x"
new deadbody = CreateObject(3092, x, y, z, 90.0000, 0.0000, 358.3903); //and then use it here
GetPlayerPos(playerid, x, y, z);
DestroyObject(deadbody);
}



Re: Body remove - Frosty_LV - 20.07.2012

Ok, I repped, all compiles but - IG it say ''unknown command'' :S


Re: Body remove - nepstep - 20.07.2012

pawn Код:
CMD:placebody(playerid, params[])//This works perfectly
{
CreateObject(3092, 0, 0, 0, 0, 0, 0);
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
CreateObject(3092, x, y, z, 90.0000, 0.0000, 358.3903);
return 1;
}
CMD:removebody(playerid, params[])//This will now compile
{
new Float:x,Float:y,Float:z; //you should first do "new Float:x"
new deadbody = CreateObject(3092, x, y, z, 90.0000, 0.0000, 358.3903); //and then use it here
GetPlayerPos(playerid, x, y, z);
DestroyObject(deadbody);
return 1;
}



This forum requires that you wait 120 seconds between posts. Please try again in 10 seconds.
...