02.01.2015, 14:04
Hello Guys
Guys i want know somthings When im Spawn Vehicle /v
i Want the old Vehicle Destroy
Guys i want know somthings When im Spawn Vehicle /v
i Want the old Vehicle Destroy
Hello Guys
Guys i want know somthings When im Spawn Vehicle /v i Want the old Vehicle Destroy |
new myVeh[MAX_PLAYERS];
//inside that cmd:
if(myVeh[playerid]) DestroyVehicle(myVeh[playerid]);
myVeh[playerid] = CreateVehicle(//and so on...
//...
new vehicle[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext)
{
if(!IsPlayerAdmin....// Some checks
Destroyveh(vehicle[playerid]);
vehicle[playerid]=CreateVehicle(//...........
return 1;
}
CMD:v(playerid, params[])
{
if(PlayerInfo[playerid][pRank] >= 2 && PlayerInfo[playerid][pRank] <= 8)
{
new Vehicle[50];
if(!sscanf(params, "s[50]", Vehicle))
{
if(Myveh[playerid]) DestroyVehicle(Myveh[playerid]);
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, COLOR_RED, "This is not a valid vehicle name! Please try again ");
if(IsPlayerInAnyVehicle(playerid)) { DestroyVehicle(GetPlayerVehicleID(playerid)); }
GetXYInFrontOfPlayer(playerid, Pos[0], Pos[1], 5);
new PVeh = CreateVehicle(veh, Pos[0], Pos[1], Pos[2], Pos[3]+90, -1, -1, -1);
LinkVehicleToInterior(PVeh, GetPlayerInterior(playerid)); SetVehicleVirtualWorld(PVeh, GetPlayerVirtualWorld(playerid));
format(string, sizeof string, "You spawned a %s. ID: %i. ", aVehicleNames[veh - 400], veh);
SendClientMessage(playerid, COLOR_GREEN, string);
}
} else return SendClientMessage(playerid, COLOR_LIGHTGREEN, "Usage: /v [vehiclename] ");
return 1;
}
i Can Spawn 50000 Vehicle not fixed
this my full code spawn vehicle PHP код:
|
new PVeh = CreateVehicle(veh, Pos[0], Pos[1], Pos[2], Pos[3]+90, -1, -1, -1);
pawn Код:
|