/bike command
#1

im looking for a /bike command so that when the command is typed that it spawns a bike near the player for them


Thx for your time
Reply
#2

pawn Код:
if(strcmp(cmdtext, "/bike", true) == 0)
{
  new Float:x, Float:y, Float:z, Float:a;
  GetPlayerPos(playerid, x, y, z);
  GetPlayerFacingAngle(playerid, a);
  CreateVehicle(481, x, y, z+5, a, 1, 1, 10000);
  SendClientMessage(playerid, color, "BMX spawned!");
  return 1;
}
Reply
#3

pawn Код:
if(strcmp(cmdtext, "/nrg", true)==0)
{
if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_RED, "[ERROR]: You already have a Vehicle.");
}
else
{
new Float:X,Float:Y,Float:Z,Float:Angle,VehicleID; GetPlayerPos(playerid,X,Y,Z); GetPlayerFacingAngle(playerid,Angle);
VehicleID = CreateVehicle(522,X,Y,Z,Angle,1,-1,-1);
PutPlayerInVehicle(playerid,VehicleID,0);
SetVehicleVirtualWorld(VehicleID, GetPlayerVirtualWorld(playerid));
LinkVehicleToInterior(VehicleID, GetPlayerInterior(playerid));
}
return 1;
}

Damn, you posted first again. ^_^
But this time our posts looks a bit different.

EDIT: If you want a NRG-500, this should be your command.
Reply
#4

coob that 0 in..... PutPlayerInVehicle(playerid,VehicleID,0); is the id of the cars right


or is it VehicleID = CreateVehicle(522,X,Y,Z,Angle,1,-1,-1); 522 in this
Reply
#5

Well, I win. jks.

pawn Код:
if(strcmp("/bike a", cmdtext, true) == 0)
{
     new Float:x, Float:y, Float:z;
     GetPlayerPos(playerid, x, y, z);
     CreateVehicle(481, x, y, z, 0.0, -1, -1, 90000);
     SetPlayerPos(playerid, x, y, z+3);
     return 1;
}

if(strcmp("/bike b", cmdtext, true) == 0)
{
     new Float:x, Float:y, Float:z;
     GetPlayerPos(playerid, x, y, z);
     CreateVehicle(510, x, y, z, 0.0, -1, -1, 90000);
     SetPlayerPos(playerid, x, y, z+3);
     return 1;
}

if(strcmp("/bike c", cmdtext, true) == 0)
{
     new Float:x, Float:y, Float:z;
     GetPlayerPos(playerid, x, y, z);
     CreateVehicle(509, x, y, z, 0.0, -1, -1, 90000);
     SetPlayerPos(playerid, x, y, z+3);
     return 1;
}
Reply
#6

No, seat ID 0 = driver.
Reply
#7

yes u do Abernethy yes u do
Reply
#8

Quote:
Originally Posted by sggassasin
yes u do Abernethy yes u do
Did you read the small text?

Quote:
Originally Posted by Abernethy
Well, I win. jks.
XD
Reply
#9

Quote:
Originally Posted by Abernethy
Well, I win. jks.

pawn Код:
if(strcmp("/bike a", cmdtext, true) == 0)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    CreateVehicle(481, x, y, z, 0.0, -1, -1, 90000);
    SetPlayerPos(playerid, x, y, z+3);
    return 1;
}

if(strcmp("/bike b", cmdtext, true) == 0)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    CreateVehicle(510, x, y, z, 0.0, -1, -1, 90000);
    SetPlayerPos(playerid, x, y, z+3);
    return 1;
}

if(strcmp("/bike c", cmdtext, true) == 0)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    CreateVehicle(509, x, y, z, 0.0, -1, -1, 90000);
    SetPlayerPos(playerid, x, y, z+3);
    return 1;
}
Actually that code would work because you have space in-between the 'bike' and the letter. Thus meaning you'd need strtok. But since you don't the command would return unknown

You lose
Reply
#10

Quote:
Originally Posted by Swift_
Quote:
Originally Posted by Abernethy
Well, I win. jks.

pawn Код:
if(strcmp("/bike a", cmdtext, true) == 0)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    CreateVehicle(481, x, y, z, 0.0, -1, -1, 90000);
    SetPlayerPos(playerid, x, y, z+3);
    return 1;
}

if(strcmp("/bike b", cmdtext, true) == 0)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    CreateVehicle(510, x, y, z, 0.0, -1, -1, 90000);
    SetPlayerPos(playerid, x, y, z+3);
    return 1;
}

if(strcmp("/bike c", cmdtext, true) == 0)
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    CreateVehicle(509, x, y, z, 0.0, -1, -1, 90000);
    SetPlayerPos(playerid, x, y, z+3);
    return 1;
}
Actually that code would work because you have space in-between the 'bike' and the letter. Thus meaning you'd need strtok. But since you don't the command would return unknown

You lose
Mwhahaha /fail. Yeah, I know my code sucked ass compared to ya'll
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)