Pitbul97 Posted February 24, 2016 Posted February 24, 2016 Cum pot pune restrictie la comanda /ban ca un admin sa nu poata bana alt admin.
Alberto. Posted February 24, 2016 Posted February 24, 2016 Compari gradul. Daca adminul x are gradul mai mic ca y atunci ii revine mesajul "nu poti bana un admin mai mare in nivel cu tine." Acum trebuie sa o traduci in limbajul pawno si sa o adaugi la inceputul comenzi, dupa new-uri.
Pitbul97 Posted February 24, 2016 Author Posted February 24, 2016 Vreau ca un Admin de level mai mic sa nu poata bana pe cel de level mai mare. Quote } CMD:ban(playerid, params[]) { if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first."); if(IsPlayerConnected(playerid)) { if (PlayerInfo[playerid][pAdmin] >= 5) { new id,reason[128],string[200],giveplayer[30],sendername[30],type,str[128]; if(sscanf(params, "uds[128]", id,type,reason)) return SCM(playerid,COLOR_WHITE,"{B8DBFF}Syntax: /ban <Name/Playerid> <type(1-account 2-permanent)> <reason>"); if(IsPlayerConnected(id)) { if(id != INVALID_PLAYER_ID) { GetPlayerName(id, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); if(type == 1) { format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", giveplayer, sendername, reason); SendClientMessageToAll(COLOR_LIGHTRED, string); PlayerInfo[id][pBanned] = 1; SendClientMessage(id,COLOR_LIGHTRED,"[BAN INFO]: Poti face o cerere de unban pe forumul nostru."); SendClientMessage(id,COLOR_LIGHTRED,"[HINT]: Te sfatuim sa faci o poza la aceste informatii,si sa o postezi cand faci cerere unban.Apasa F8 pentru a face poza."); format(str,sizeof(str),"UPDATE users SET `Banned`='1' WHERE `name`='%s'",giveplayer); mysql_query(SQL,str); new ip[25]; GetPlayerIp(id, ip, sizeof(ip)); Banlog(ip,PlayerInfo[id][pSQLID],PlayerInfo[playerid][pSQLID],reason,0); KickEx(id); } else if(type == 2) { format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", giveplayer, sendername, reason); SendClientMessageToAll(COLOR_LIGHTRED, string); PlayerInfo[id][pBanned] = 1; SendClientMessage(id,COLOR_LIGHTRED,"[BAN INFO]: Poti face o cerere de unban pe forumul nostru."); SendClientMessage(id,COLOR_LIGHTRED,"[HINT]: Te sfatuim sa faci o poza la aceste informatii,si sa o postezi cand faci cerere unban.Apasa F8 pentru a face poza."); format(str,sizeof(str),"UPDATE users SET `Banned`='1' WHERE `name`='%s'",giveplayer); mysql_query(SQL,str); new ip[25]; GetPlayerIp(id, ip, sizeof(ip)); Banlog(ip,PlayerInfo[id][pSQLID],PlayerInfo[playerid][pSQLID],reason,0); Ban(id); } return 1; } } else return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Atentie: Acest player nu e conectat."); } else return SendClientMessage(playerid, COLOR_WHITE, AdminOnly); } return 1; }
Mister Posted February 24, 2016 Posted February 24, 2016 Inainte sa primeasca ban pui aceasta verificare if (PlayerInfo[playerid][pAdmin] <PlayerInfo [id][pAdmin]) return SendClientMessage (playerid,-1,"nu poti bana level mai mare ca al tau"); __ ____ __ / |/ (_)____/ /____ _____ / /|_/ / / ___/ __/ _ \/ ___/ / / / / (__ ) /_/ __/ / /_/ /_/_/____/\__/\___/_/ SERVICII SCRIPTING DE CALITATE Pagina Scripting pawn
Pitbul97 Posted February 24, 2016 Author Posted February 24, 2016 21 minutes ago, Mister said: Inainte sa primeasca ban pui aceasta verificare if (PlayerInfo[playerid][pAdmin] <PlayerInfo [id][pAdmin]) return SendClientMessage (playerid,-1,"nu poti bana level mai mare ca al tau"); C:\Users\User\Desktop\samp03\gamemodes\Carbon.pwn(23978) : error 017: undefined symbol "id" C:\Users\User\Desktop\samp03\gamemodes\Carbon.pwn(24071) : error 029: invalid expression, assumed zero C:\Users\User\Desktop\samp03\gamemodes\Carbon.pwn(24071) : warning 215: expression has no effect C:\Users\User\Desktop\samp03\gamemodes\Carbon.pwn(24071) : error 001: expected token: ";", but found "return" C:\Users\User\Desktop\samp03\gamemodes\Carbon.pwn(24072) : warning 225: unreachable code C:\Users\User\Desktop\samp03\gamemodes\Carbon.pwn(24172) : error 017: undefined symbol "id"
Mister Posted February 24, 2016 Posted February 24, 2016 (edited) Ti-am spus clar sa pui inainte de acordarea banului Arata cum mi-ai dat copy paste la ce am zis, in gm fara sa gandesti unde pui copy pasteul Edited February 24, 2016 by Mister __ ____ __ / |/ (_)____/ /____ _____ / /|_/ / / ___/ __/ _ \/ ___/ / / / / (__ ) /_/ __/ / /_/ /_/_/____/\__/\___/_/ SERVICII SCRIPTING DE CALITATE Pagina Scripting pawn
Pitbul97 Posted February 24, 2016 Author Posted February 24, 2016 Statusul meu spune clar ca sunt incepator si nu stiu totul ca in palma. e bn asa ? Quote if (PlayerInfo[playerid][pAdmin] <PlayerInfo [id][pAdmin]) return SendClientMessage (playerid,-1,"nu poti bana level mai mare ca al tau"); format(string,128,"AdmCmd: %s was banned by %s for %d day, reason: %s",giveplayer,name,days,reason); SendClientMessageToAll(COLOR_LIGHTRED,string);
.№_Fpk.Marius_™. Posted February 24, 2016 Posted February 24, 2016 CMD:ban(playerid, params[]) { if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first."); if(IsPlayerConnected(playerid)) { if (PlayerInfo[playerid][pAdmin] >= 5) { new id,reason[128],string[200],giveplayer[30],sendername[30],type,str[128]; if(sscanf(params, "uds[128]", id,type,reason)) return SCM(playerid,COLOR_WHITE,"{B8DBFF}Syntax: /ban <Name/Playerid> <type(1-account 2-permanent)> <reason>"); if(IsPlayerConnected(id)) { if(id != INVALID_PLAYER_ID) { // Pui asta fix aici sub asta // if (PlayerInfo[playerid][pAdmin] <PlayerInfo [id][pAdmin]) return SendClientMessage (playerid,-1,"nu poti bana level mai mare ca al tau"); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // GetPlayerName(id, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); if(type == 1) { format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", giveplayer, sendername, reason); SendClientMessageToAll(COLOR_LIGHTRED, string); PlayerInfo[id][pBanned] = 1; SendClientMessage(id,COLOR_LIGHTRED,"[BAN INFO]: Poti face o cerere de unban pe forumul nostru."); SendClientMessage(id,COLOR_LIGHTRED,"[HINT]: Te sfatuim sa faci o poza la aceste informatii,si sa o postezi cand faci cerere unban.Apasa F8 pentru a face poza."); format(str,sizeof(str),"UPDATE users SET `Banned`='1' WHERE `name`='%s'",giveplayer); mysql_query(SQL,str); new ip[25]; GetPlayerIp(id, ip, sizeof(ip)); Banlog(ip,PlayerInfo[id][pSQLID],PlayerInfo[playerid][pSQLID],reason,0); KickEx(id); } else if(type == 2) { format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", giveplayer, sendername, reason); SendClientMessageToAll(COLOR_LIGHTRED, string); PlayerInfo[id][pBanned] = 1; SendClientMessage(id,COLOR_LIGHTRED,"[BAN INFO]: Poti face o cerere de unban pe forumul nostru."); SendClientMessage(id,COLOR_LIGHTRED,"[HINT]: Te sfatuim sa faci o poza la aceste informatii,si sa o postezi cand faci cerere unban.Apasa F8 pentru a face poza."); format(str,sizeof(str),"UPDATE users SET `Banned`='1' WHERE `name`='%s'",giveplayer); mysql_query(SQL,str); new ip[25]; GetPlayerIp(id, ip, sizeof(ip)); Banlog(ip,PlayerInfo[id][pSQLID],PlayerInfo[playerid][pSQLID],reason,0); Ban(id); } return 1; } } else return SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Atentie: Acest player nu e conectat."); } else return SendClientMessage(playerid, COLOR_WHITE, AdminOnly); } return 1; }
Pitbul97 Posted February 24, 2016 Author Posted February 24, 2016 Bun a mers dar la asta unde adaug ? ca am si banday. Quote http://pastebin.com/3AXmKL6W
.№_Fpk.Marius_™. Posted February 24, 2016 Posted February 24, 2016 Il pui sub: if(IsPlayerConnected(giveplayerid)) {
Pitbul97 Posted February 25, 2016 Author Posted February 25, 2016 14 hours ago, .№_Fpk.Marius_™. said: Il pui sub: if(IsPlayerConnected(giveplayerid)) { Quote C:\Users\User\Desktop\samp03\gamemodes\Carbon.pwn(23982) : error 017: undefined symbol "id" C:\Users\User\Desktop\samp03\gamemodes\Carbon.pwn(24069) : error 029: invalid expression, assumed zero C:\Users\User\Desktop\samp03\gamemodes\Carbon.pwn(24069) : warning 215: expression has no effect C:\Users\User\Desktop\samp03\gamemodes\Carbon.pwn(24069) : error 001: expected token: ";", but found "return" C:\Users\User\Desktop\samp03\gamemodes\Carbon.pwn(24072) : warning 225: unreachable code
Pitbul97 Posted February 26, 2016 Author Posted February 26, 2016 23982. Quote if (PlayerInfo[playerid][pAdmin] <PlayerInfo [id][pAdmin]) return SendClientMessage (playerid,-1,"nu poti bana level mai mare ca al tau"); 24069: Quote } 24072: Quote else return SendClientMessage(playerid,COLOR_WHITE,AdminOnly);
Mister Posted February 26, 2016 Posted February 26, 2016 (edited) Inlocuieste id cu giveplayerid compileaza si vezi ce iti da Edited February 26, 2016 by Mister __ ____ __ / |/ (_)____/ /____ _____ / /|_/ / / ___/ __/ _ \/ ___/ / / / / (__ ) /_/ __/ / /_/ /_/_/____/\__/\___/_/ SERVICII SCRIPTING DE CALITATE Pagina Scripting pawn
Pitbul97 Posted February 27, 2016 Author Posted February 27, 2016 Quote C:\Users\User\Desktop\samp03\gamemodes\Carbon.pwn(24069) : error 029: invalid expression, assumed zero C:\Users\User\Desktop\samp03\gamemodes\Carbon.pwn(24069) : warning 215: expression has no effect C:\Users\User\Desktop\samp03\gamemodes\Carbon.pwn(24069) : error 001: expected token: ";", but found "return" C:\Users\User\Desktop\samp03\gamemodes\Carbon.pwn(24072) : warning 225: unreachable code
.№_Fpk.Marius_™. Posted February 27, 2016 Posted February 27, 2016 pune toata comanda. C uneori eroarea nu ii numa di randu respectiv.
kwnx Posted February 27, 2016 Posted February 27, 2016 Daca vrei ca un admin sa nu poata da ban altui admin cu grad mai mare sau egal cu al sau pui: if(PlayerInfo[id][pAdmin] >= PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, -1, "Nu poti da ban unui admin cu nivel mai mare sau egal cu al tau!"); Daca vrei ca nici un admin sa nu poata fi banat, pui: if(PlayerInfo[id][pAdmin] > 0) return SendClientMessage(playerid, -1, "Nu poti da ban unui admin!");
Daedric-Fox Posted March 1, 2016 Posted March 1, 2016 Ai rezolovat? pot da T/C? ********************************** Servicii Scripting de calitate: ********************************* Future Project: ExpertGame *********************************
Pitbul97 Posted March 4, 2016 Author Posted March 4, 2016 http://pastebin.com/xqhCb0Jz orice as incerca da erori ori nu pun eu unde trb ori nu stiu ce sa cred
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now