Jump to content

Cum fac comanda /makeadmin cu zmcd si sscanf ?


Alex136Rx

Recommended Posts

CMD:makeadmin (playerid params bla bla

{

new playa,adminlevel;

if(sscanf (params,"ud",playa,adminlevel)) return SendClientMessage ( mesaj nu ai scris bine bla bIA

if (!IsPlayerConnected (playa) return 1;

Pinfo [playa][pAdmin] = adminlevel;

Mesajul ca ai primit admin

return 1;

}

 

Intelegi si tu ce trebuie completat ca nu e greu

 

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

On 04.04.2016 at 12:24, Mister said:

CMD:makeadmin (playerid params bla bla

{

new playa,adminlevel;

if(sscanf (params,"ud",playa,adminlevel)) return SendClientMessage ( mesaj nu ai scris bine bla bIA

if (!IsPlayerConnected (playa) return 1;

Pinfo [playa][pAdmin] = adminlevel;

Mesajul ca ai primit admin

return 1;

}

 

Intelegi si tu ce trebuie completat ca nu e greu

n-am inteles ,spune-mi unde pun asta ,si da un ex cum pun ca admin lv 1 sa foloseasca cmd /.heal

 

Link to comment
Share on other sites

Cmd:mameadmin(playerid, params[])

{

New tinta, alvl;

if(sscanf(params "ui", tinta, alvl)) return SendClientMessage(playerid, COLOR, "Foloseste: /makeadmin [id][lvl]"):

If(!IstPlayerConnected(tinta) return SendClientMessage(playerid, color, "Acest jucator nu este conectat");

P_Data[tinta][pAdmin] = alvl;

return 1;

}

CMd:heal(playerid, params[])

{

New tinta, Flooat:viata;

If(sscanf(params "uf", tinta, viata) return SendClientMessage();

If(P_Data[playerid][pAdmin] >=1)

{

SetPlayerHealtth(tinta, viata);

SendClientMessage(playerid, color, "ai  dat viata lui id %i", tinta);

SendClientMessage(tinta, color, "ai primit viata ");

}

return 1:

}

 

Sunai eu incepator sper ca am facut bine 

Edited by DreiVian
Link to comment
Share on other sites

new admin[MAX_PLAYERS];

 

CMD:makeadmin(playerid, params[]) {

new i, level;

if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Nu esti Admin"); 

if(sscanf(params, "ud", i, level)) return SendClientMessage(playerid, -1, "/MakeAdmin[Playerid/Level]");

admin = level;

return 1; }

Cam asta e, acum tu trebuie s-o configurezi dupa variabilele tale.

Edited by xpLode
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.

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