09.06.2015, 08:20
PHP код:
CMD:windows(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
{
SendClientMessage(playerid, COLOR_GREY, " This vehicle doesn't have the window to roll");
return 1;
}
if(VehicleWindows[GetPlayerVehicleID(playerid)] == 0)
{
VehicleWindows[GetPlayerVehicleID(playerid)] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s rolls down the window.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
else if(VehicleWindows[GetPlayerVehicleID(playerid)] == 1)
{
VehicleWindows[GetPlayerVehicleID(playerid)] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s rolls up the window.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You need to be in the vehicle to use this function !");
return 1;
}
}
return 1;
}
CMD:w(playerid, params[]) { return cmd_windows(playerid, params); }