02.01.2015, 14:23
i Can Spawn 50000 Vehicle not fixed
this my full code spawn vehicle
this my full code spawn vehicle
PHP код:
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;
}