How can i spawn a nrg with cmd
#1

Hello,

I want a command (/nrg) that i can spawn a nrg (car)

Reply
#2

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

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

I dont understand what i must do
Reply
#5

Put that lines under public OnPlayerCommandText.
Reply
#6

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

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[])
Reply
#8

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)