Need vehicles spawn command
#9

Quote:
Originally Posted by [mad
MLK (sampx-hosting.co.cc) ]
if(strcmp(cmd, "/v", true) == 0) // can type /v carname/model
{
if (PlayerInfo[playerid][pAdmin] >= 4)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, ORANGE, "Error: Use /v model name/ ID");
return 1;
}
new car;
if (car >= 611 || car <= 400)
{
car = strval(tmp);
if(car < 400 || car > 611) return SendClientMessage(playerid, RED, "ERROR: vehicle id must between 400 -611");
}

tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, ORANGE, "ERROR: /veh [id] [color1] [color2]");
return 1;
}
new color1 = strval(tmp);

tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, ORANGE, "ERROR: /veh [id] [color1] [color2]");
return 1;
}
new color2 = strval(tmp);

new Float:X,Float:Y,Float:Z,Float:A;
GetPlayerPos(playerid, X,Y,Z);
GetPlayerFacingAngle(playerid, A);
new carid = CreateVehicle(car, X,Y,Z, A, color1, color2, 600000000);
PutPlayerInVehicle(playerid, carid, 0);

}
}
If you did it like that, everyone would be able to spawn a vehicle. Because you didn't return anything at the end where it should be returned if the player isn't an admin with a higher level than 4.
Reply


Messages In This Thread
Need vehicles spawn command - by JPonsen - 22.08.2009, 04:23
Re: Need vehicles spawn command - by [mad]MLK - 22.08.2009, 04:32
Re: Need vehicles spawn command - by Joe Staff - 22.08.2009, 04:39
Re: Need vehicles spawn command - by JPonsen - 22.08.2009, 04:43
Re: Need vehicles spawn command - by NeRoSiS - 22.08.2009, 05:34
Re: Need vehicles spawn command - by JPonsen - 22.08.2009, 05:39
Re: Need vehicles spawn command - by refshal - 22.08.2009, 05:45
Re: Need vehicles spawn command - by [mad]MLK - 22.08.2009, 05:46
Re: Need vehicles spawn command - by refshal - 22.08.2009, 05:49
Re: Need vehicles spawn command - by JPonsen - 22.08.2009, 05:58

Forum Jump:


Users browsing this thread: 1 Guest(s)