if(!strcmp(cmdtext, \"/adminszolgálat\", true) || !strcmp(cmdtext, \"/adminszoli\", true)){if(IsPlayerConnected(playerid)){ if(gPlayerLogged[playerid] == 0) { SendClientMessage(playerid, COLOR_GREY, \"Nem vagy bejelentkezve!\"); return 1; } if(Admin(playerid, 1)) { if(AdminDuty[playerid] == 0) { if(PlayerInfo[playerid][rejtozes] == 0) { if(PlayerInfo[playerid][Adminsz] == 1) { Nevekbe(playerid); } if(PlayerInfo[playerid][Adminsz] == 0) { Nevekbe(playerid); } AdminDuty[playerid] = 1; PlayerInfo[playerid][Engedi] = 1; new kuldo[MAX_PLAYER_NAME]; GetPlayerName(playerid, kuldo, sizeof(kuldo)); new Float:AX,Float:AY,Float:AZ; GetPlayerPos(playerid, AX,AY,AZ); SendClientMessage(playerid,COLOR_WHITE,\"Adminszolgálatba álltál!\"); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), \"<< Admin %s adminszolgálatba lépett! >>\", sendername); SendFAdminMessage(COLOR_ADMIN,string); /*DutyLabel[playerid] = Create3DTextLabel(\"Admin Szolgálatban\",0xFB0000FF,0,0,0,50,-1,1); Attach3DTextLabelToPlayer(DutyLabel[playerid], playerid, 0,0,0);*/ TogglePlayerControllable(playerid, 1); new nev[32]; GetPlayerName(playerid, nev, sizeof(nev)); GetPlayerPos(playerid, AX,AY,AZ); SetPlayerPos(playerid, AX,AY,AZ+1); format(stringx,sizeof(stringx), \"%s\",nev); DutyLabelNev[playerid] = Create3DTextLabel(stringx,0xFB0000FF,0,0,0,50,-1,1); Attach3DTextLabelToPlayer(DutyLabelNev[playerid], playerid, 0,0,0.2); new h,mi,s,y,m,d; getdate(y,m,d); gettime(h,mi,s); format(stringx,sizeof(stringx), \"[%d/%d/%d][%d:%d:%d] %s adminszolgálatba állt.\",y,m,d,h,mi,s,nev); LoOoG(stringx); if(Admin(playerid, 1)) { for(new i = 0; i < sizeof(CarInfo); i++) { SetVehicleParamsForPlayer(i,playerid,0,0); } } if(Admin(playerid, 1)) { if(PlayerInfo[playerid][pSex] == 1) { SetPlayerSkin(playerid, 217); } if(PlayerInfo[playerid][pSex] == 2) { SetPlayerSkin(playerid, 211); } UpdatePlayerPosition(playerid); SetPlayerHealth(playerid, 99999); TogglePlayerControllable(playerid, 1); } if(Admin(playerid, 1)) { for(new slot = 0; slot != 12; slot++) { new wep, ammo; GetPlayerWeaponData(playerid, slot, wep, ammo); if(wep != 0 && ammo != 0) { if(wep == 1) { PlayerInfo[playerid][fegyver1] = 1; PlayerInfo[playerid][tolteny1] += ammo; } else if(wep == 5) { PlayerInfo[playerid][fegyver2] = 1; PlayerInfo[playerid][tolteny2] += ammo; } else if(wep == 4) { PlayerInfo[playerid][fegyver3] = 1; PlayerInfo[playerid][tolteny3] += ammo; } else if(wep == 22) { PlayerInfo[playerid][fegyver4] = 1; PlayerInfo[playerid][tolteny4] += ammo; } else if(wep == 24) { PlayerInfo[playerid][fegyver5] = 1; PlayerInfo[playerid][tolteny5] += ammo; } else if(wep == 29) { PlayerInfo[playerid][fegyver6] = 1; PlayerInfo[playerid][tolteny6] += ammo; } else if(wep == 30) { PlayerInfo[playerid][fegyver7] = 1; PlayerInfo[playerid][tolteny7] += ammo; } else if(wep == 31) { PlayerInfo[playerid][fegyver8] = 1; PlayerInfo[playerid][tolteny8] += ammo; } else if(wep == 25) { PlayerInfo[playerid][fegyver9] = 1; PlayerInfo[playerid][tolteny9] += ammo; } else if(wep == 41) { PlayerInfo[playerid][fegyver10] = 1; PlayerInfo[playerid][tolteny10] += ammo; } else if(wep == 17) { PlayerInfo[playerid][fegyver11] = 1; PlayerInfo[playerid][tolteny11] += ammo; } else if(wep == 3) { PlayerInfo[playerid][fegyver12] = 1; PlayerInfo[playerid][tolteny12] += ammo; } } } Fegyverelol[playerid] = 0; SafeResetPlayerWeapons(playerid); TogglePlayerControllable(playerid, 1); } } if(PlayerInfo[playerid][rejtozes] == 1) { if(PlayerInfo[playerid][Adminsz] == 1) { Nevekbe(playerid); } if(PlayerInfo[playerid][Adminsz] == 0) { Nevekbe(playerid); } AdminDuty[playerid] = 1; SendClientMessage(playerid,COLOR_WHITE,\"Rejtõzõ adminszolgálatba álltál!\"); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), \"<< Admin %s rejtõzõ adminszolgálatba lépett! >>\", sendername); SendTAdminMessage(COLOR_ADMIN,string); TogglePlayerControllable(playerid, 1); new nev[32]; GetPlayerName(playerid, nev, sizeof(nev)); new h,mi,s,y,m,d; getdate(y,m,d); gettime(h,mi,s); format(stringx,sizeof(stringx), \"[%d/%d/%d][%d:%d:%d] %s rejtõzõ adminszolgálatba állt.\",y,m,d,h,mi,s,nev); LoOoG(stringx); } return 1; } else if(AdminDuty[playerid] == 1) { if(Admin(playerid, 1)) { if(Spectate[playerid] == 255) { //SafeResetPlayerWeapons(playerid); //SetPlayerWeapons(playerid); TogglePlayerControllable(playerid, 1); } SetPlayerHealth(playerid, 100); TogglePlayerControllable(playerid, 1); } if(PlayerInfo[playerid][Adminsz] == 1) { Nevekbe(playerid); } if(PlayerInfo[playerid][Adminsz] == 0) { Nevekki(playerid); } PlayerInfo[playerid][Engedi] = 0; //Delete3DTextLabel(DutyLabel[playerid]); Delete3DTextLabel(DutyLabelNev[playerid]); TogglePlayerControllable(playerid, 1); AdminDuty[playerid] = 0; new kuldo[MAX_PLAYER_NAME]; GetPlayerName(playerid, kuldo, sizeof(kuldo)); new originalskin = PlayerInfo[playerid][Munkaruha1]; SetPlayerSkin(playerid, originalskin); new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z); SetPlayerPos(playerid, X,Y,Z+1); SetPlayerToTeamColor(playerid); SetPlayerHealth(playerid, 100); SendClientMessage(playerid,COLOR_WHITE,\"Kiléptél Adminszolgálatból!\"); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), \"<< Admin %s kilépett az adminszolgálatból! >>\", sendername); SendFAdminMessage(COLOR_ADMIN,string); new nev[32]; GetPlayerName(playerid, nev, sizeof(nev)); new h,mi,s,y,m,d; getdate(y,m,d); gettime(h,mi,s); format(stringx,sizeof(stringx), \"[%d/%d/%d][%d:%d:%d] %s kilépett adminszolgálatból.\",y,m,d,h,mi,s,nev); LoOoG(stringx); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, \"Nem vagy admin!\"); return 1; }} return 1; }
if(!strcmp(cmdtext, \"/adminszolgálat\", true)){if(AdminDuty[playerid] == 1){ // Ide kerül a parancs fõmagva}else{ //Ide ha a játékos nincs adminszoliban, mi történjen.}}
if(strcmp(cmd, \"/freeze\", true) == 0){ if(IsPlayerConnected(playerid)) { if(AdminDuty[playerid] == 0) { SendClientMessage(playerid, COLOR_LIGHTRED, \"Ne használd már ki az Adminodat! (Csak szolgálatban)\"); } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, \"Használat: /freeze [iD/Név]\"); return 1; } new targetplayer; targetplayer = ReturnUser(tmp); if(Admin(playerid, 1)) { if(IsPlayerConnected(targetplayer)) { if(targetplayer != INVALID_PLAYER_ID) { TogglePlayerControllable(targetplayer, 0); } } }}return 1;}
Itt egy példa: if(strcmp(cmd, \"/freeze\", true) == 0){ if(IsPlayerConnected(playerid)) { if(AdminDuty[playerid] == 0) { SendClientMessage(playerid, COLOR_LIGHTRED, \"Ne használd már ki az Adminodat! (Csak szolgálatban)\"); } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, \"Használat: /freeze [iD/Név]\"); return 1; } new targetplayer; targetplayer = ReturnUser(tmp); if(Admin(playerid, 1)) { if(IsPlayerConnected(targetplayer)) { if(targetplayer != INVALID_PLAYER_ID) { TogglePlayerControllable(targetplayer, 0); } } }}return 1;}