[AJUDA]Comando sscanf . . .
#1

PHP код:
    if(strcmp(cmd"/desarmar"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
               if(
PlayerInfo[playerid][pAdmin] >= 3000)
               {
                if(
PlayerInfo[playerid][pATrabalhar] < 1)
                {
                    
SendClientMessage(playeridCOLOR_WARNING"Vocк nгo estб trabalhando! (/adm)");
                    return 
1;
                }
                   new 
id;
                if(
unformat(cmdtext"s[30]u",Comando,id))
                {
                       
SendClientMessage(playeridCOLOR_GRAD1"USE: /desarmar [id/playerid]");
                    return 
1;
                }
                if(
IsPlayerConnected(id))
                {
                    if(
id != INVALID_PLAYER_ID)
                    {
                        
ResetPlayerWeapons(id);
                        
format(stringsizeof(string), "*** Vocк retirou as armas de %s"pNome(id));
                        
SendClientMessage(playeridCOLOR_WARNINGstring);
                        
format(stringsizeof(string), "*** Suas armas foram retiradas pelo Admin %s"pNome(playerid));
                        
SendClientMessage(idCOLOR_WARNINGstring);
                    }
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_GREY"O Jogador Estб Offline !");
                    return 
1;
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_WARNING"*** Voce nao tem permissao para usar esse comando.");
            }
        }
        return 
1;
    } 
o comando nao ta funcionando e uma duvida em sscanf precisa usar \/
PHP код:
if(IsPlayerConnected(id))
if(
id != INVALID_PLAYER_ID
Reply
#2

Se o jogador estб conectado й lуgico que a ID dele nгo й invбlida.

Nгo estб funcionando por que o sscanf ainda nгo foi atualizado para as versхes da 03.d. Aguarde.

E se usa apenas "u" para players.
Reply
#3

a ok valeu


Resolvido ! ! !
Reply
#4

Quote:
Originally Posted by lucas_mdr1235
Посмотреть сообщение
PHP код:
new id;
if(
unformat(cmdtext"s[30]u",Comando,id))
{
SendClientMessage(playeridCOLOR_GRAD1"USE: /desarmar [id/playerid]");
return 
1;

Aproveitando o tуpico..

unformat = sscanf?
Deste jeito funciona no strcmp ?
Reply
#5

unformat й o mesmo que sscanf, os 2 funcionam em strcmp, sу muda o nome da funзгo.
Reply
#6

Quote:
Originally Posted by Pharrel
Посмотреть сообщение
unformat й o mesmo que sscanf, os 2 funcionam em strcmp, sу muda o nome da funзгo.
funcionar atй funcionam, mas pega o comando tbm, por exemplo em um comando /anuncio, caso eu usar strcmp
pawn Код:
if(strcmp(cmdtext, "/an", true) == 0)
e usar sscanf
pawn Код:
new msg[50];
if(sscanf(cmdtext, "s[50]", msg) return SendClientMessage(playerid, -1, "use: /an [texto]");
SendClientMessageToAll(-1, msg);
ele enviarб o comando junto, por exemplo eu digito /an lol ele enviarб para todos os players a mensagem "/an lol"
Reply
#7

https://sampforum.blast.hk/showthread.php?tid=144744&page=115

isso resolve seu problema
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)