Pickup question...
#1

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

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

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"
Reply
#4

on top

Код:
#pragma unused x
Reply
#5

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

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

edit.

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

Код:
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
Reply
#8

Код:
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.
Reply
#9

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

thnx !!! thank you all!

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


Forum Jump:


Users browsing this thread: 1 Guest(s)