Jump to content

Recommended Posts

Posted

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.

Posted

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;
}

 

Posted

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
Posted
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"

Posted (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 by Mister

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Posted

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);

 

Posted

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;
}

Posted
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

 

 

 

Posted

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);

 

Posted
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

 

Posted

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!");

 

242086.png

Posted

Ai rezolovat? pot da T/C?

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.