Restart
Код:
if(strcmp(cmd, "/gmx", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
for(new i = 0; i < MAX_PLAYERS; i++)
ClearChatbox(i, 100);
SendClientMessageToAll(COLOR_NICERED,"Server se resatrtuje, Molimo sacekajte!");
SendClientMessageToAll(COLOR_NICERED,"Server restart se koristi za popravljanje bugove i update skripte");
SendClientMessageToAll(COLOR_NICERED,"Sacekajte par sekundi dok se ucita mod ili idite relog.");
SendClientMessageToAll(COLOR_NICERED,"Molimo budite strpljivi.");
format(string, sizeof(string), "[AdmCmd]: %s je restartovao server.", sendername);
ABroadCast(COLOR_YELLOW,string,1);
for(new i; i<MAX_PLAYERS; i++)
{
OnPlayerUpdate(i);
}
//GameModeExit();
GameModeInitExitFunc();
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
}
}
return 1;
}
Park
Код:
if(strcmp(cmd, "/parkvehicle", true) == 0 || strcmp(cmd, "/pv", true) == 0) // Parking the car.
{
new vehicleid = GetPlayerVehicleID(playerid);
if(IsPlayerConnected(playerid))
{
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == 2)
{
GetPlayerVehicleMods(playerid);
if(PlayerVehicleID1[playerid] == vehicleid)
{
GetVehiclePos(vehicleid, PlayerInfo[playerid][PlayerVehiclePosX1], PlayerInfo[playerid][PlayerVehiclePosY1], PlayerInfo[playerid][PlayerVehiclePosZ1]);
GetVehicleZAngle(vehicleid, PlayerInfo[playerid][PlayerVehicleFacing1]);
DestroyVehicle(PlayerVehicleID1[playerid]);
PlayerInfo[playerid][PlayerVehicle1VirWorld] = GetPlayerVirtualWorld(playerid);
PlayerInfo[playerid][PlayerVehicle1Interior] = GetPlayerInterior(playerid);
CreatePlayerVehicle(playerid,1);
PutPlayerInVehicle(playerid,PlayerVehicleID1[playerid],0);
}
else if(PlayerVehicleID2[playerid] == vehicleid)
{
GetVehiclePos(vehicleid, PlayerInfo[playerid][PlayerVehiclePosX2], PlayerInfo[playerid][PlayerVehiclePosY2], PlayerInfo[playerid][PlayerVehiclePosZ2]);
GetVehicleZAngle(vehicleid, PlayerInfo[playerid][PlayerVehicleFacing2]);
DestroyVehicle(PlayerVehicleID2[playerid]);
PlayerInfo[playerid][PlayerVehicle2VirWorld] = GetPlayerVirtualWorld(playerid);
PlayerInfo[playerid][PlayerVehicle2Interior] = GetPlayerInterior(playerid);
CreatePlayerVehicle(playerid,2);
PutPlayerInVehicle(playerid,PlayerVehicleID2[playerid],0);
}
else if(PlayerVehicleID3[playerid] == vehicleid)
{
GetVehiclePos(vehicleid, PlayerInfo[playerid][PlayerVehiclePosX3], PlayerInfo[playerid][PlayerVehiclePosY3], PlayerInfo[playerid][PlayerVehiclePosZ3]);
GetVehicleZAngle(vehicleid, PlayerInfo[playerid][PlayerVehicleFacing3]);
DestroyVehicle(PlayerVehicleID3[playerid]);
PlayerInfo[playerid][PlayerVehicle3VirWorld] = GetPlayerVirtualWorld(playerid);
PlayerInfo[playerid][PlayerVehicle3Interior] = GetPlayerInterior(playerid);
CreatePlayerVehicle(playerid,3);
PutPlayerInVehicle(playerid,PlayerVehicleID3[playerid],0);
}
else if(PlayerVehicleID4[playerid] == vehicleid)
{
GetVehiclePos(vehicleid, PlayerInfo[playerid][PlayerVehiclePosX4], PlayerInfo[playerid][PlayerVehiclePosY4], PlayerInfo[playerid][PlayerVehiclePosZ4]);
GetVehicleZAngle(vehicleid, PlayerInfo[playerid][PlayerVehicleFacing4]);
DestroyVehicle(PlayerVehicleID4[playerid]);
PlayerInfo[playerid][PlayerVehicle4VirWorld] = GetPlayerVirtualWorld(playerid);
PlayerInfo[playerid][PlayerVehicle4Interior] = GetPlayerInterior(playerid);
CreatePlayerVehicle(playerid,4);
PutPlayerInVehicle(playerid,PlayerVehicleID4[playerid],0);
}
else if(PlayerVehicleID5[playerid] == vehicleid)
{
GetVehiclePos(vehicleid, PlayerInfo[playerid][PlayerVehiclePosX5], PlayerInfo[playerid][PlayerVehiclePosY5], PlayerInfo[playerid][PlayerVehiclePosZ5]);
GetVehicleZAngle(vehicleid, PlayerInfo[playerid][PlayerVehicleFacing5]);
DestroyVehicle(PlayerVehicleID5[playerid]);
PlayerInfo[playerid][PlayerVehicle5VirWorld] = GetPlayerVirtualWorld(playerid);
PlayerInfo[playerid][PlayerVehicle5Interior] = GetPlayerInterior(playerid);
CreatePlayerVehicle(playerid,5);
PutPlayerInVehicle(playerid,PlayerVehicleID5[playerid],0);
}
else
{
SendClientMessage(playerid,COLOR_GREY," You are not in a vehicle that you own.");
}
}
else
{
SendClientMessage(playerid,COLOR_GREY," You are not driving a vehicle.");
}
}