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



Pickup question... - x-unit - 19.07.2010

Hi, i want to make a command like /explode that will place a pickup in front of me, but i cant figure how i will put it, i mean not like that : CreatePickup(1242, 2, 1503.3359, 1432.3585, 10.1191, -1); but it would be something like this : CreatePickup(1242, 2, x+2, y+2, z, -1); this is my cmd

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/explode", cmdtext, true, == 0)
{
CreatePickup(1242, 2, 1503.3359, 1432.3585, 10.1191, -1);
}
return 1;
}


Re: Pickup question... - Kar - 19.07.2010

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new Float:x,y,z;
if (strcmp("/explode", cmdtext, true,  == 0)
{
GetPlayerPos(playerid,x,y,z);
CreatePickup(1242, 2, x+2,y,z, -1);
}
return 1;
}
?


Re: Pickup question... - x-unit - 19.07.2010

public OnPlayerCommandText(playerid, cmdtext[])
{
new Float,y,z;
if (strcmp("/explode", cmdtext, true, == 0)
{
GetPlayerPos(playerid,x,y,z); //158
CreatePickup(1242, 2, x+2,y,z, -1); //159
}
return 1;
}


addon2.pwn(15 : error 017: undefined symbol "x"
addon2.pwn(159) : error 017: undefined symbol "x"


Re: Pickup question... - tanush - 19.07.2010

on top

Код:
#pragma unused x



Re: Pickup question... - x-unit - 19.07.2010

Quote:
Originally Posted by tanush
Посмотреть сообщение
on top

Код:
#pragma unused x
nah..dont work now i have 3 errors


Re: Pickup question... - Kar - 19.07.2010

edit.

dude that angry sign is a fucking X change it to x .. that was common sense


Re: Pickup question... - TouR - 19.07.2010

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new Float:x,Float:y,Float:z;
if (strcmp("/explode", cmdtext, true, == 0)
{
GetPlayerPos(playerid,x,y,z); //158
CreatePickup(1242, 2, x+2,y,z, -1); //159
}
return 1;
}
this will work


Re: Pickup question... - ReVo_ - 19.07.2010

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new Float:x,Float:y,Float:z;
if (strcmp("/explode", cmdtext, true, == 0)
{
GetPlayerPos(playerid, x, y, z);
GetPlayerPos(playerid,x,y,z); //158
CreatePickup(1242, 2, x+2,y,z, -1); //159
}
return 1;
}
you explode player? if not and var's x,y,z capute valor in differend command put new Float,Float:y,Float:z; in top of you script and remove GetPlayerPos and new Float,Float:y,Float:z; in the OnPlayerCommandText.
If explode player my code correct.


Re: Pickup question... - Kar - 19.07.2010

kid just use mine. you

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new Float: x,y,z;
if (strcmp("/explode", cmdtext, true,  == 0)
{
GetPlayerPos(playerid,x,y,z);
CreatePickup(1242, 2, x+2,y,z, -1);
}
return 1;
}
trust me this will work

you dont have to put float,float:y then z thats a big waste of place in your gm<.<


Re: Pickup question... - x-unit - 19.07.2010

thnx !!! thank you all!

yes indeed Kar there is no need to put the "float"