[AJUDA]Alguem me ajuda Criar Um Comando /setlevel?
#1

o que eu presiso para criar um comando /setlevel ajuda aew pf
Reply
#2

Sem o cуdigo...
Reply
#3

quer que eu mande meu sistema de level?
Reply
#4

Quote:
Originally Posted by marcio147
quer que eu mande meu sistema de level?
mande o sistema e eu te ajudo ^^
Reply
#5

pawn Код:
if(strcmp(cmd,"/setlevel", true)==0)
{
if(IsPlayerAdmin(playerid)){
new aname[MAX_PLAYER_NAME];
new tmp[256];
new plid, skin;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){
SendClientMessage(playerid, Vermelho, "Digite: /setlevel [id] [level]");
return 1;
}
plid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "Digite: /setlevel [id] [level]");
return 1;
}
skin = strval(tmp);
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
if(IsPlayerConnected(plid)){
format(string, sizeof(string), "* O Administrador %s (%d) te setou %d Level.", aname, playerid, skin);
SendClientMessage(plid, tcadm, string);
format(string, sizeof(string), "Vocк deu a %s(ID: %d) %d Level.", pname, plid, skin);
SendClientMessage(playerid, Blue, string);
} else {
SendClientMessage(playerid, Vermelho,"{FFFF00}[{FF0000} ERRO{FFFF00} ]{FFFFFF}: Jogador nгo conectado.");
}
} else {
SendClientMessage(playerid, Vermelho,"{FFFF00}[{FF0000} ERRO{FFFF00} ]{FFFFFF}: Vocк nгo pode usar este comando.");
}
return 1;
}
Reply
#6

pawn Код:
if(strcmp(cmd,"/setlevel", true)==0)
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"voce nao e adm.rsrss");
    tmp = strtok(cmdtext, idx); if(!strlen(tmp)) return SendClientMessage(playerid, -1, "ERROR: /setlevel ID lvl.");
    new id = ReturnUser(tmp); if(!IsPlayerConnected(id)) SendClientMessage(playerid, -1,"ele nao ta on aff");
    tmp = strtok(cmdtext, idx); if(!strlen(tmp)) return SendClientMessage(playerid, -1, "ERROR: /setlevel ID lvl.");
    new score = strval(tmp);
    SetPlayerScore(id, score);
    new string[0x3C*2];
    format(string, sizeof(string), "aff o adm seto seu level pra %i blz? [adm id %i]", score, playerid);
    SendClientMessage(id, -1, string);
    return 0x01;
}
Reply
#7

aki esta o meu /setlevel

PHP код:
dcmd_setlevel(playeridparams[])
{
    if(
IsPlayerAdmin(playerid))
    {
        new 
IDlevel;
        if(
sscanf(params"ii"IDlevel)) SendClientMessage(playeridCOLOR_WHITE"USAGE: /setlevel [id] [level]");
        else if(
ID == INVALID_PLAYER_IDSendClientMessage(playeridCOLOR_RED"Player is not connected!");
        else
        {
            
AccountInfo[ID][aLevel] = level;
            
SendClientMessage(IDCOLOR_GREEN"The RCON Admin promoted you to an admin!");
        }
    }
    return 
1;

Reply
#8

Quote:
Originally Posted by Ricop522
Посмотреть сообщение
pawn Код:
if(strcmp(cmd,"/setlevel", true)==0)
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"voce nao e adm.rsrss");
    tmp = strtok(cmdtext, idx); if(!strlen(tmp)) return SendClientMessage(playerid, -1, "ERROR: /setlevel ID lvl.");
    new id = ReturnUser(tmp); if(!IsPlayerConnected(id)) SendClientMessage(playerid, -1,"ele nao ta on aff");
    tmp = strtok(cmdtext, idx); if(!strlen(tmp)) return SendClientMessage(playerid, -1, "ERROR: /setlevel ID lvl.");
    new score = strval(tmp);
    SetPlayerScore(id, score);
    new string[0x3C*2];
    format(string, sizeof(string), "aff o adm seto seu level pra %i blz? [adm id %i]", score, playerid);
    SendClientMessage(id, -1, string);
    return 0x01;
}
Eu comecei a usar return 0x01; agora nгo consigo parar D:
Reply
#9

zcmd + sscanf:
PHP код:
CMD:daradmin(playeridparams[])
{
   static
        
Jogador2MAX_PLAYER_NAME ],
        
JogadorMAX_PLAYER_NAME ],
        
sStr128 ],
        
Reacao,
        
id;
   if( !
IsPlayerAdminplayerid ) ) 
      return 
SendClientMessageplayerid0xFFF000AA"[Admin] Vocк nгo tem permissгo para usar este comando!" );       
   if( 
sscanfparams"ud"idReacao ) )
      return 
SendClientMessageplayerid0xFFF000AA"Uso correto: /setlevel [ID] [Level]" );
 
   if( !
IsPlayerConnectedid ) )
      return 
SendClientMessageplayerid0xFFF000AA"Jogador nгo conectado!" );      
   
GetPlayerNameplayeridJogadorsizeofJogador ) );
   
GetPlayerNameidJogador2sizeofJogador2 ) );
   
formatsStrsizeofsStr ), "[Admin] Administrador %s promoveu-te a nнvel %d"JogadorReacao );
   
SendClientMessageid0xFFF000AAsStr );
   
formatsStrsizeofsStr ), "[Admin] Vocк colocou %s com nнvel %d"Jogador2Reacao );
   
SendClientMessageplayerid0xFFF000AAsStr );
   
SetPlayerScoreidReacao );
   return 
true;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)