Body remove
#1

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);

Reply
#2

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);
}
Reply
#3

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

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.
...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)