Jump to content
  • 0

Problema comenzi


DoDy

Question

Salut , stie cineva de ce la aceasta comanda o pot folosii playerii normali , fara sa aiba admin isi pot da fondator singuri , nu imi dau seama de ce  : CMD:makeadmin(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    if(IsPlayerConnected(playerid))
    {
        if (PlayerInfo[playerid][pAdmin] >= 0)
        {
            new id,adminlevel,sendername[30],giveplayer[30],string[200];
            if(sscanf(params, "ui",id,adminlevel)) return SendClientMessage(playerid, 0xFFFFFFFF, "{B8DBFF}Syntax: /makeadmin <Name/Playerid> <Admin Level>");
            if(IsPlayerConnected(id))
            {
                if(id != INVALID_PLAYER_ID)
                {
                    GetPlayerName(id, giveplayer, sizeof(giveplayer));
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    PlayerInfo[id][pAdmin] = adminlevel;
                    PlayerInfo[id][pChar] = 217;
                    SetPlayerSkin(id, 217);
                    printf("AdmCmd: %s has promoted %s to a level %d admin.", sendername, giveplayer, adminlevel);
                    format(string, sizeof(string), "You have been promoted to a level %d admin by %s.", adminlevel, sendername);
                    SendClientMessage(id, COLOR_LIGHTBLUE, string);
                    format(string, sizeof(string), "You have promoted %s to a level %d admin.", giveplayer,adminlevel);
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    format(string, sizeof(string), "{f03337}Warning: Admin %s has set %s to a level %d admin.", sendername,giveplayer,adminlevel);
                    ABroadCast(COLOR_WHITE,string,4);
                     new wakaname[25];
                    GetPlayerName(id,wakaname,25);
                    new str[256];
                    format(str,256,"UPDATE users SET `Admin`='%d',`CChar`='%d' WHERE `name`='%s'",PlayerInfo[id][pAdmin],PlayerInfo[id][pChar],wakaname);
                    mysql_query(SQL,str);
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_WHITE, "{FFFFCC}Error: Player not connected.");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, AdminOnly);
        }
    }
    return 1;
}

 

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

La inceputul cpmenzii este asta 

If (playerinfo [playerid][padmin] >= 0)

Sterge acel = si pune 4inloc de 0 si va merge doar la admini

 

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

  • 0

Va multumesc .

As mai avea o problema cu odometers la masini , imi inregistreaza km iar dupa restart o ia de la 0 , de ce ?

TextDrawShowForPlayer(i, Odom);
                    format(str3,sizeof(str3),"Odometers: %.2f Km",CarInfo[OwnedVeh(vehicle)][cKM]);
                    TextDrawSetString(Odom, str3);
                }
            }
        }
    }
    return 1;
}

 

Link to comment
Share on other sites

  • 0

Trebuie sa creezi o noua variabila de salvare in baza de date. Uitate la celelalte chestii ale masinii cum se salveaza si fa acelasi lucru pentru km

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
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
Answer this question...

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

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