How can i spawn a nrg with cmd - 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: How can i spawn a nrg with cmd (
/showthread.php?tid=77266)
How can i spawn a nrg with cmd -
Battlaman - 09.05.2009
Hello,
I want a command (/nrg) that i can spawn a nrg (car)
Re: How can i spawn a nrg with cmd -
Weirdosport - 09.05.2009
As basic as it gets:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/nrg", cmdtext, true, 4) == 0)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
CreateVehicle(522, X + 2, Y, Z, 0.0, 0, 0, 10);
return 1;
}
return 0;
}
Re: How can i spawn a nrg with cmd -
MenaceX^ - 09.05.2009
pawn Код:
if(!strcmp(cmdtext,"/nrg",true))
{
new
Float:x,
Float:y,
Float:z,
GetPlayerPos(playerid,x,y,z);
CreateVehicle(522,x,y,z,0.0,0,0,-1);
return 1;
}
Re: How can i spawn a nrg with cmd -
Battlaman - 09.05.2009
I dont understand what i must do
Re: How can i spawn a nrg with cmd -
Klutty - 09.05.2009
Put that lines under public OnPlayerCommandText.
Re: How can i spawn a nrg with cmd -
Battlaman - 10.05.2009
Quote:
Originally Posted by Klutty
Put that lines under public OnPlayerCommandText.
|
Yes but what must i fill in by
GetPlayerPos(playerid,x,y,z);
CreateVehicle(522,x,y,z,0.0,0,0,-1);
Re: How can i spawn a nrg with cmd -
MenaceX^ - 10.05.2009
Quote:
Originally Posted by MenaceX^
pawn Код:
if(!strcmp(cmdtext,"/nrg",true)) { new Float:x, Float:y, Float:z, GetPlayerPos(playerid,x,y,z); CreateVehicle(522,x,y,z,0.0,0,0,-1); return 1; }
|
Put this under the first bracket in
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
Re: How can i spawn a nrg with cmd -
Klutty - 10.05.2009
Quote:
Originally Posted by Battleman
Quote:
Originally Posted by Klutty
Put that lines under public OnPlayerCommandText.
|
Yes but what must i fill in by
GetPlayerPos(playerid,x,y,z);
CreateVehicle(522,x,y,z,0.0,0,0,-1);
|
Don't change anything just copy n' paste it