//Adminduty
command(Adminduty, playerid, params[])
{
#pragma unused params
new string[128];
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X, Y, Z);
//Adminränge
if(GetPVarInt(playerid, "Adminduty") == 0)
{
if(sStats[playerid][sAdminlevel] < 1)
{
SendClientMessage(playerid,Rot,"Du bist kein Administrator oder dein Administratorenlevel ist zu niedrig!");
return 1;
}
if(sStats[playerid][sAdminlevel] > 5)
{
SendClientMessage(playerid,Rot,"Du bist kein Administrator oder dein Administratorenlevel ist zu niedrig!");
return 1;
}
if(GetPVarInt(playerid, "Helm") > 0)
{
SendClientMessage(playerid,Rot,"Du kannst dein Dutystatus gerade nicht verändern!");
return 1;
}
if(GetPVarInt(playerid, "InAschein") == 1)
{
SendClientMessage(playerid,Rot,"Du kannst dein Dutystatus gerade nicht verändern!");
return 1;
}
if(sStats[playerid][sAdminlevel] == 5)
{
format(string,84,"{FFFFFF}[{FF0000}Projektleiter{FFFFFF}]");
DutyLabel[playerid] = CreatePlayer3DTextLabel(playerid,string, 0xAAAAFFFF,X,Y,Z+0.3,10.0,playerid, INVALID_VEHICLE_ID, 0);
RemovePlayerAttachedObject(playerid,5);
RemovePlayerAttachedObject(playerid,6);
sStats[playerid][sAnglerschein] = 0;
SetPlayerAttachedObject(playerid, 5, 19079, 17, 0.054798, -0.068864, 0.143832, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
SetPlayerAttachedObject(playerid, 6, 1276, 1, 0.026707, 0.049716, 0.044027, 0.000000, 166.186828, 295.838226, -0.335559, 1.000000, 0.018289);
}
else if(sStats[playerid][sAdminlevel] == 4)
{
format(string,84,"{FFFFFF}[{FF0000}Hauptsupporter{FFFFFF}]");
DutyLabel[playerid] = CreatePlayer3DTextLabel(playerid,string, 0xAAAAFFFF,X,Y,Z+0.3,10.0,playerid, INVALID_VEHICLE_ID, 0);
}
else if(sStats[playerid][sAdminlevel] == 3)
{
format(string,84,"{FFFFFF}[{FF0000}Administrator{FFFFFF}]");
DutyLabel[playerid] = CreatePlayer3DTextLabel(playerid,string, 0xAAAAFFFF,X,Y,Z+0.3,10.0,playerid, INVALID_VEHICLE_ID, 0);
}
else if(sStats[playerid][sAdminlevel] == 2)
{
format(string,84,"{FFFFFF}[{FF0000}Supporter{FFFFFF}]");
DutyLabel[playerid] = CreatePlayer3DTextLabel(playerid,string, 0xAAAAFFFF,X,Y,Z+0.3,10.0,playerid, INVALID_VEHICLE_ID, 0);
}
else if(sStats[playerid][sAdminlevel] == 1)
{
format(string,84,"{FFFFFF}[{FF0000}Moderator/Scout{FFFFFF}]");
DutyLabel[playerid] = CreatePlayer3DTextLabel(playerid,string, 0xAAAAFFFF,X,Y,Z+0.3,10.0,playerid, INVALID_VEHICLE_ID, 0);
}
SetPVarInt(playerid, "Adminduty", 1);
format(string, sizeof(string), "{FFFF00}Admin: {FF4C4C}%s[%d] {FFFF00}ist nun als %s im Einsatz.", GetName(playerid),playerid, GetPlayerAdminRank(playerid));
TextDrawShowForPlayer(playerid, OTickets);
SetPlayerColor(playerid, Rot);
}
else if(GetPVarInt(playerid, "Adminduty") == 1)
{
SetPVarInt(playerid, "Adminduty", 0);
SetPVarInt(playerid, "Funmodus", 0);
format(string, sizeof(string), "{FFFF00}Admin: {FF4C4C}%s[%d] {FFFF00}ist nicht mehr als %s im Einsatz.", GetName(playerid),playerid, GetPlayerAdminRank(playerid));
DeletePlayer3DTextLabel(DutyLabel[playerid]);
RemovePlayerAttachedObject(playerid,5);
RemovePlayerAttachedObject(playerid,6);
TextDrawHideForPlayer(playerid, OTickets);
SetSpielerFarbe(playerid);
}
SendClientMessageToAll(Gelb, string);
return 1;
}
command(aduty, playerid, params[])
{
#pragma unused params
return cmd_Adminduty(playerid, params);
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new year, month, day;
new hour,minute,second;
getdate(year,month,day);
gettime(hour,minute,second);
new string[270];
new engine,lightss,alarm,doors,bonnet,boot,objective;
new bot = GetNearestBot(playerid, 2.3);
new bot2 = GetNearestBot(playerid, 2.1);
new vid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vid,engine,lightss,alarm,doors,bonnet,boot,objective);
new Hour, Minute, Second;
gettime(Hour, Minute, Second);
//Anti Grab Bug
if(newkeys & KEY_SPRINT && GetPVarInt(playerid, "Grabbed") == 1)
{
return 1;
}
//Ein & Ausgänge
//Rathaus
if(newkeys == 16 && IsPlayerInRangeOfPoint(playerid,1.4, -2240.7166,2319.8894,5.2307))
{
if(sStats[playerid][sLevel] < 3)
{
SetPlayerPosEx(playerid, 387.2075,173.9353,1008.3828);
SetPlayerFacingAngle(playerid,91.6092);
SetPlayerInterior(playerid,3);
}
if(Hour >= 10 && Hour <= 24)
{
SetPlayerPosEx(playerid, 387.2075,173.9353,1008.3828);
SetPlayerFacingAngle(playerid,91.6092);
SetPlayerInterior(playerid,3);
}
else
{
SendClientMessage(playerid,Rot,"Das Rathaus hat geschlossen.(Öffnungszeiten: sind von 10-24 Uhr!)");
return 1;
}
}
if(newkeys == 16 && IsPlayerInRangeOfPoint(playerid,1.4, 390.7697,173.8253,1008.3828))
{
SetPlayerPosEx(playerid, -2244.6472,2320.1443,4.9688);
SetPlayerFacingAngle(playerid,90.3521);
SetPlayerInterior(playerid,0);
}
//Feuerwehr LV & SF Eingang
if(newkeys == 16 && IsPlayerInRangeOfPoint(playerid,1.4, -2026.2426,67.1633,28.6916)) //SF
{
SetPlayerPosEx(playerid, 246.6460,64.8453,1003.6406);
SetPlayerFacingAngle(playerid,358.1066);
SetPlayerInterior(playerid,6);
SetPVarInt(playerid,"Feuerwehr",2);
}
if(newkeys == 16 && IsPlayerInRangeOfPoint(playerid,1.4, 1769.5823,2105.1353,10.8219))
{
SetPlayerPosEx(playerid, 246.6460,64.8453,1003.6406);
SetPlayerFacingAngle(playerid,358.1066);
SetPlayerInterior(playerid,6);
SetPVarInt(playerid,"Feuerwehr",3);
}
//Feuerwehr BS und Ausgang
if(newkeys == 16 && IsPlayerInRangeOfPoint(playerid,1.4, -2452.0239,2359.3518,5.2733))
{//Feuerwehr Eingang
SetPlayerPosEx(playerid, 246.6460,64.8453,1003.6406);
SetPlayerFacingAngle(playerid,358.1066);
SetPlayerInterior(playerid,6);
SetPVarInt(playerid,"Feuerwehr",1);
}
if(newkeys == 16 && IsPlayerInRangeOfPoint(playerid,1.4, 246.8301,62.3260,1003.6406))
{//Feuerwehr Ausgang
if(!IsAFW(playerid))
{
SetPlayerPosEx(playerid, -2451.5752,2357.6025,4.9868);
SetPlayerFacingAngle(playerid,189.5785);
SetPlayerInterior(playerid,0);
}
else
{
if(GetPVarInt(playerid, "Feuerwehr") == 1)
{
SetPlayerPosEx(playerid, -2451.5752,2357.6025,4.9868);
SetPlayerFacingAngle(playerid,189.5785);
SetPlayerInterior(playerid,0);
SetPVarInt(playerid,"Feuerwehr",0);
}
if(GetPVarInt(playerid, "Feuerwehr") == 2)
{
SetPlayerPosEx(playerid, -2023.6296,67.2101,28.4559);
SetPlayerFacingAngle(playerid,275.7226);
SetPlayerInterior(playerid,0);
SetPVarInt(playerid,"Feuerwehr",0);
}
if(GetPVarInt(playerid, "Feuerwehr") == 3)
{
SetPlayerPosEx(playerid, 1769.6951,2108.5576,10.8386);
SetPlayerFacingAngle(playerid,359.2573);
SetPlayerInterior(playerid,0);
SetPVarInt(playerid,"Feuerwehr",0);
}
}
}
//edit PWN Tag