02.04.2016, 11:42
i use this
If That helped you +rep
PHP код:
forward CarSpawner(playerid,model);
CMD:inf(playerid,params[])
{
if (!IsPlayerInAnyVehicle(playerid))
{
CarSpawner(playerid,411);
return SendClientMessage(playerid,0x1400FFFF,"Car Successfully Created!");
}
else return SendClientMessage(playerid,COLOR_RED,"Error: You already have a vehicle");
}
CMD:nrg(playerid,params[])
{
if (!IsPlayerInAnyVehicle(playerid))
{
CarSpawner(playerid,522);
return SendClientMessage(playerid,0x1400FFFF,"Car Successfully Created!");
}
else return SendClientMessage(playerid,COLOR_RED,"Error: You already have a vehicle");
}
public CarSpawner(playerid,model)
{
if(IsPlayerInAnyVehicle(playerid))
SendClientMessage(playerid, COLOR_RED, "ERROR: You already have a car!");
else
{
new Float:x, Float:y, Float:z, Float:angle;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angle);
new vehicleid=CreateVehicle(model, x, y, z, angle, -1, -1, -1);
PutPlayerInVehicle(playerid, vehicleid, 0);
SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
ChangeVehicleColor(vehicleid,0,3);
}
return 1;
}