CMD:acar(playerid, params[])
{
new string[128], park[30];
if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_REDD, "[ERROR] You do not have the right's to use this command!");
if(sscanf(params, "s[128]", string)) return SendClientMessage(playerid, COLOR_LGREEN, "[USAGE]{ffffff} /acar [park/etc/etc]");
format(park, sizeof(park), "park");
if(strcmp(park, string, true, strlen(park)))
{
new vehicle, Float:x, Float:y, Float:z, Float:angle;
vehicle = GetPlayerVehicleID(playerid);
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angle);
VehicleInfo[vehicle][vX] = x;
VehicleInfo[vehicle][vY] = y;
VehicleInfo[vehicle][vZ] = z;
VehicleInfo[vehicle][vA] = angle;
SaveVehicle(vehicle);
{
LoadVehicle(vehicle);
}
SetPlayerPos(playerid, x, y, z+3);
SendClientMessage(playerid, COLOR_LGREEN, "[Acar]{ffffff} Vehicle parked!");
}
return 1;
}
CMD:acar(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_REDD, "[ERROR] You do not have the right's to use this command!");
if (isnull(params)) return SendClientMessage(playerid, COLOR_LGREEN, "[USAGE]{ffffff} /acar [park/etc/etc]");
if (strcmp(params, "help", true))
{
// code for "/acar help"
}
else if (strcmp(params, "park", true))
{
// code for "/acar park"
}
else SendClientMessage(playerid, COLOR_LGREEN, "Use: help/park etc..");
return 1;
}
SaveVehicle(vehicle);
{
LoadVehicle(vehicle);
}
SaveVehicle(vehicle);
LoadVehicle(vehicle);
pawn Код:
pawn Код:
pawn Код:
|
if (!strcmp(params, "help", true))
{
// code for "/acar help"
}
else if (!strcmp(params, "park", true))
pawn Код:
|
CMD:acar(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_REDD, "[ERROR] You do not have the right's to use this command!");
if (isnull(params)) return SendClientMessage(playerid, COLOR_LGREEN, "[USAGE]{ffffff} /acar [park/help/etc]");
if (!strcmp(params, "help", true))
{
SendClientMessage(playerid, COLOR_LGREEN, "/acar help {ffffff}- List of /acar commands");
SendClientMessage(playerid, COLOR_LGREEN, "/acar park {ffffff}- Park the vehicle you are in!");
}
else if (!strcmp(params, "park", true))
{
new vehicle, Float:x, Float:y, Float:z, Float:angle;
vehicle = GetPlayerVehicleID(playerid);
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angle);
VehicleInfo[vehicle][vX] = x;
VehicleInfo[vehicle][vY] = y;
VehicleInfo[vehicle][vZ] = z;
VehicleInfo[vehicle][vA] = angle;
SaveVehicle(vehicle);
SetTimerEx("loadcar", 1000, false, "i", vehicle);
SetPlayerPos(playerid, x, y, z+3);
SendClientMessage(playerid, COLOR_LGREEN, "[Acar]{ffffff} Vehicle parked!");
}
else SendClientMessage(playerid, COLOR_LGREEN, "Use:{ffffff} /acar help for more info!");
return 1;
}
forward loadcar(i);
public loadcar(i)
{
SetVehicleToRespawn(i);
}
forward loadcar(i);
public loadcar(i)
{
SetVehiclePos(i, VehicleInfo[i][vX], VehicleInfo[i][vY], VehicleInfo[i][vZ]);
}
CMD:acar(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_REDD, "[ERROR] You do not have the right's to use this command!");
if (isnull(params)) return SendClientMessage(playerid, COLOR_LGREEN, "[USAGE]{ffffff} /acar [park/help/etc]");
if (!strcmp(params, "help", true))
{
SendClientMessage(playerid, COLOR_LGREEN, "/acar help {ffffff}- List of /acar commands");
SendClientMessage(playerid, COLOR_LGREEN, "/acar park {ffffff}- Park the vehicle you are in!");
}
else if (!strcmp(params, "park", true))
{
if (GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_REDD, "You need to be driver");
new vehicle, Float:x, Float:y, Float:z, Float:angle;
vehicle = GetPlayerVehicleID(playerid);
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angle);
VehicleInfo[vehicle][vX] = x;
VehicleInfo[vehicle][vY] = y;
VehicleInfo[vehicle][vZ] = z;
VehicleInfo[vehicle][vA] = angle;
printf("park -> vehicle: %i | X: %f | Y: %f | Z: %f | A: %f", vehicle, x, y, z, angle);
SaveVehicle(vehicle);
SetTimerEx("loadcar", 1000, false, "i", vehicle);
SetPlayerPos(playerid, x, y, z+3);
SendClientMessage(playerid, COLOR_LGREEN, "[Acar]{ffffff} Vehicle parked!");
}
else SendClientMessage(playerid, COLOR_LGREEN, "Use:{ffffff} /acar help for more info!");
return 1;
}
forward loadcar(i);
public loadcar(i)
{
printf("loadcar -> vehicle: %i | X: %f | Y: %f | Z: %f", i, VehicleInfo[i][vX], VehicleInfo[i][vY], VehicleInfo[i][vZ]);
SetVehiclePos(i, VehicleInfo[i][vX], VehicleInfo[i][vY], VehicleInfo[i][vZ]);
}
Model = 560
vX = 1706.440307
vY = 1434.831298
vZ = 10.336604
Color1 = 1
Color2 = 1
Respawn = -1
Owner = Marco_Baccalieri
FactionCar = 0
NoobCar = 0
[data]
Model = 560
vX = 1695.949584
vY = 1442.413696
vZ = 10.762247
vA = 242.479843
Color1 = 1
Color2 = 1
Respawn = -1
Owner = Marco_Baccalieri
FactionCar = 0
NoobCar = 0
forward RespawnTimer();
public RespawnTimer()
{
new bool:VehicleUsed[MAX_VEHICLES] = false;
foreach(Character, i)//for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerInAnyVehicle(i)) VehicleUsed[GetPlayerVehicleID(i)] = true;
}
for(new i = 1; i < MAX_VEHICLES; i++)
{
if(VehicleUsed[i] == false)
SetVehiclePos(i, VehicleInfo[i][vX], VehicleInfo[i][vY], VehicleInfo[i][vZ]);
SetVehicleZAngle(i, VehicleInfo[i][vA]);
}
new string[128];
format(string, sizeof(string), "[ADMIN]{FCF507} All unused vehicle's have been respawned.");
SendClientMessageToAll(COLOR_AMESSAGE, string);
}