27/04/2024 11:35
Código PHP:
new g_arrVehiclesRandom[] = {
411, 400, 402, 404, 415, 418, 422, 424, 434, 444, 451, 457, 482, 495, 508, 514, 535, 541, 560, 573, 601, 571, 562
};
new pickupChangeVehicle;
new gPlayerVehicle[MAX_PLAYERS];
public OnGameModeInit()
{
pickupChangeVehicle = CreatePickup(12957, 1, -1461.8420, -523.9481, 14.1776, 0);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
if (IsValidVehicle(gPlayerVehicle[playerid])) {
DestroyVehicle(gPlayerVehicle[playerid]);
gPlayerVehicle[playerid] = INVALID_VEHICLE_ID;
}
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if (pickupid == pickupChangeVehicle && GetPlayerVehicleID(playerid) == gPlayerVehicle[playerid])
{
if (IsValidVehicle(gPlayerVehicle[playerid]))
DestroyVehicle(gPlayerVehicle[playerid]);
new
gRandom = random(sizeof(g_arrVehiclesRandom));
gPlayerVehicle[playerid] = AddStaticVehicle(g_arrVehiclesRandom[gRandom], -1449.7061,-526.0865,14.1719, 1, 1, 0);
PutPlayerInVehicle(playerid, gPlayerVehicle[playerid], 0);
}
return 1;
}