17.07.2011, 18:25
If you just learnt pawno, I'm not gonna make it hard on you and just try to make it simple. If you wanna spawn vehicle name from command then it's gonna take you to add all the vehicle name first, which is lengthy and hard for a newbie, for now you can just use /car [ID]. You just have to put the ID of the car where you had to put the name. Here is a list of vehicle names and IDs: https://sampwiki.blast.hk/wiki/Vehicles:All. Bullet's ID is 541. Here's the function:
pawn Код:
if(strcmp(string, "/car", true) == 0)
{
string = strtok(cmdtext,idx);
if(!strlen(string))
{
SendClientMessage(playerid, COLOR_GREY, "USAGE: /car [carid]");
return 1;
}
object = strval(string);
new Float:playerx, Float:playery, Float:playerz;
GetPlayerPos(playerid, playerx, playery, playerz);
CreateVehicle(object, playerx, playery, playerz, 0, 0, 0, 60000);
}