Jump to content

Restrictie


Pitbul97

Recommended Posts

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

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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"

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

 

 

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

Inlocuieste id cu 

giveplayerid

 compileaza si vezi ce iti da

Edited by Mister

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 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.