/veh command problem - 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)
+--- Thread: /veh command problem (
/showthread.php?tid=587080)
/veh command problem -
benjaminjones - 27.08.2015
The command:
pawn Код:
CMD:veh(playerid, params[])
{
if(PlayerInfo[playerid][AdminLevel] >= 4)
{
new Vehicle[50];
if(!sscanf(params, "s[50]", Vehicle))
{
new string[128], Float:Pos[4];
GetPlayerPos(playerid, Pos[0],Pos[1],Pos[2]);
GetPlayerFacingAngle(playerid, Pos[3]);
new veh = GetVehicleModelID(Vehicle);
if(veh < 400 || veh > 611) return SendClientMessage(playerid, GREY, "That wasn't a valid vehicle name.");
if(!IsPlayerInAnyVehicle(playerid))
{
new vehicleid = CreateVehicle(veh, Pos[0], Pos[1], Pos[2], Pos[3], -1, -1, -1);
PutPlayerInVehicle(playerid, vehicleid, 0);
format(string, sizeof(string), "AdmCmd: %s has just spawned a %s (VID: %d)", RemoveUnderScore(playerid), GetVehicleName(GetPlayerVehicleID(playerid)), GetPlayerVehicleID(playerid));
SendAdminMessage(RED, string);
}
else return SendClientMessage(playerid, GREY, "You mustn't be in a vehicle to use this command.");
}
else return SendClientMessage(playerid, GREY, "Usage: /veh [vehiclename]");
}
else return SendClientMessage(playerid, GREY, AdminOnly);
return 1;
}
I dont get it, it says the vehicle has been spawned but the vehicle is not spawned.
Re: /veh command problem -
Gazzy - 27.08.2015
Are you in the wrong VW maybe? Was this command made by yourself?
Re: /veh command problem -
benjaminjones - 27.08.2015
Mine.
Re: /veh command problem -
Gazzy - 27.08.2015
Try spawning it with the vehicle ID instead of name
Re: /veh command problem -
benjaminjones - 27.08.2015
Nah, not working.
Re: /veh command problem -
benjaminjones - 27.08.2015
Please, lock this. I will create a new topic with better explanation as this is not the problem.