Jump to content
  • 0

setadminoff


AndreiBoss.adevaratu

Question

ajutati-ma ca la comanda asta YCMD:setadminoff(playerid, params[], help) { if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, -1, AdminOnly); new id[64], adminlevel, userid, string[200]; if(sscanf(params, "s[64]i", id, adminlevel)) return SendClientMessage(playerid, COLOR_WHITE, "{33CCFF}Sintaxa: {FFFFFF}/setadminoff <Name> <Admin Level>"); new cont = MySQLCheckAccount(id); userid = GetPlayerID(id); if(cont == 0) return SCM(playerid, -1, "Eroare: Acest nume nu a fost gasit in baza de date!"); if(adminlevel < 0 || adminlevel > 6) return SCM(playerid, COLOR_GREY, "Invalid admin level! (0-6)"); format(string, sizeof(string), "I-ai setat lui %s admin %d.", id, adminlevel); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "AdmCmd: %s i-a setat lui (Offline)%s admin %d.", GetName(playerid), id, adminlevel); if(GetPVarInt(playerid, "Cover") == 0) SendAdminMessage(COLOR_LOGS, string, 6);
PlayerInfo[userid][pAdmin] = adminlevel; return 1; }



o dau pe contul meu test cu admin  5 si cand intra inapoi tot are adminu va rog corectati-o voi ca sa ramana adminul 0 sau cat i-am setat eu nu i ramane adminul asta e  problema

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

YCMD:setadminoff(playerid, params[], help) { 
    if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, -1, AdminOnly); 
    new id[24], adminlevel, userid, string[200]; 
    if(sscanf(params, "s[24]i", id, adminlevel)) return SendClientMessage(playerid, COLOR_WHITE, "{33CCFF}Sintaxa: {FFFFFF}/setadminoff <Name> <Admin Level>"); 

    new cont = MySQLCheckAccount(id); 
    if(cont == 0) return SCM(playerid, -1, "Eroare: Acest nume nu a fost gasit in baza de date!"); 
    if(adminlevel < 0 || adminlevel > 6) return SCM(playerid, COLOR_GREY, "Invalid admin level! (0-6)"); 

    format(string, sizeof(string), "I-ai setat lui %s admin %d.", id, adminlevel);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string); 

    format(string, sizeof(string), "AdmCmd: %s i-a setat lui (Offline)%s admin %d.", GetName(playerid), id, adminlevel); 
    if(GetPVarInt(playerid, "Cover") == 0) SendAdminMessage(COLOR_LOGS, string, 6); 

    new szQuery[128];
    mysql_format(SQL, szQuery, sizeof(szQuery), "UPDATE `users` SET `Admin`='%d' WHERE `Name`='%s'", adminlevel, id);
    mysql_query(SQL, szQuery);

    return 1; 
}

+1 te rog !

  • Upvote 1
Link to comment
Share on other sites

  • 0
Acum 19 ore, [El.Capo] a spus:

YCMD:setadminoff(playerid, params[], help) { 
    if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, -1, AdminOnly); 
    new id[24], adminlevel, userid, string[200]; 
    if(sscanf(params, "s[24]i", id, adminlevel)) return SendClientMessage(playerid, COLOR_WHITE, "{33CCFF}Sintaxa: {FFFFFF}/setadminoff <Name> <Admin Level>"); 

    new cont = MySQLCheckAccount(id); 
    if(cont == 0) return SCM(playerid, -1, "Eroare: Acest nume nu a fost gasit in baza de date!"); 
    if(adminlevel < 0 || adminlevel > 6) return SCM(playerid, COLOR_GREY, "Invalid admin level! (0-6)"); 

    format(string, sizeof(string), "I-ai setat lui %s admin %d.", id, adminlevel);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string); 

    format(string, sizeof(string), "AdmCmd: %s i-a setat lui (Offline)%s admin %d.", GetName(playerid), id, adminlevel); 
    if(GetPVarInt(playerid, "Cover") == 0) SendAdminMessage(COLOR_LOGS, string, 6); 

    new szQuery[128];
    mysql_format(SQL, szQuery, sizeof(szQuery), "UPDATE `users` SET `Admin`='%d' WHERE `Name`='%s'", adminlevel, id);
    mysql_query(SQL, szQuery);

    return 1; 
}

+1 te rog !

gata

Link to comment
Share on other sites

  • 0
On 7/20/2019 at 10:44 AM, AndreiBoss.adevaratu said:

ajutati-ma ca la comanda asta YCMD:setadminoff(playerid, params[], help) { if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, -1, AdminOnly); new id[64], adminlevel, userid, string[200]; if(sscanf(params, "s[64]i", id, adminlevel)) return SendClientMessage(playerid, COLOR_WHITE, "{33CCFF}Sintaxa: {FFFFFF}/setadminoff <Name> <Admin Level>"); new cont = MySQLCheckAccount(id); userid = GetPlayerID(id); if(cont == 0) return SCM(playerid, -1, "Eroare: Acest nume nu a fost gasit in baza de date!"); if(adminlevel < 0 || adminlevel > 6) return SCM(playerid, COLOR_GREY, "Invalid admin level! (0-6)"); format(string, sizeof(string), "I-ai setat lui %s admin %d.", id, adminlevel); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "AdmCmd: %s i-a setat lui (Offline)%s admin %d.", GetName(playerid), id, adminlevel); if(GetPVarInt(playerid, "Cover") == 0) SendAdminMessage(COLOR_LOGS, string, 6);
PlayerInfo[userid][pAdmin] = adminlevel; return 1; }



o dau pe contul meu test cu admin  5 si cand intra inapoi tot are adminu va rog corectati-o voi ca sa ramana adminul 0 sau cat i-am setat eu nu i ramane adminul asta e  problema

Smr tu ca mi-ai loat comanda... =]

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.

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