[Pedido] CMD /desfichar
#1

Olб queria um CMD que tiras-ce os niveis de policia de certa pessoa /desfichar [ID] tipo assim so para admins
Reply
#2

Sу Era Procurar ai, tinha um tуpico quase agora
ZCMD
PHP Code:
CMD:retirarsu(playeridparams[])
{
    new 
giveplayeridstring[125], name[24], name2[24];
    if(
IsPlayerAdmin(playerid))
    {
        
        if(
sscanf(params"usd"giveplayerid)) return SendClientMessage(playerid,WHITE,"Digite /retirarsu [ID]");
        else if(
giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid,WHITE,"Jogador OFF-Line");
        else
        {
            
            
GetPlayerName(giveplayeridnamesizeof(name));
            
GetPlayerName(playeridname2sizeof(name2));
            
WantedPoints[playerid] = 0;
                        
SetPlayerWantedLevel(playerid0);
            
format(stringsizeof(string), "Admin [%s] Retirou Os Suspeitos do Jogador [%s]"name2name);
            
SendClientMessageToAll(SUACORstring);
        }
    }
    else return 
SendClientMessage(playerid, -1"Comando Invalido !");
    return 
1;

STRCMP
PHP Code:
if(strcmp(cmd"/retirarsu"true) == 0)
{
        if(
IsPlayerAdmin(playerid))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"Digite: /tirarsu [id]");
                return 
true;
            }
            
giveplayerid ReturnUser(tmp);
            if(
IsPlayerConnected(giveplayerid))
            {
                if(
giveplayerid != INVALID_PLAYER_ID)
                {
                    
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                    
GetPlayerName(playeridsendernamesizeof(sendername));
                    new 
length strlen(cmdtext);
                    while ((
idx length) && (cmdtext[idx] <= ' '))
                    {
                        
idx++;
                    }
                    new 
offset idx;
                    new 
result[64];
                    while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
                    {
                        
result[idx offset] = cmdtext[idx];
                        
idx++;
                    }
                    
result[idx offset] = EOS;
                    if(!
strlen(result))
                    {
                        
SendClientMessage(playeridCOLOR_GRAD2"Digite: /tirarsu [id]");
                        return 
true;
                    }
                    
WantedPoints[playerid] = 0;
                    
SetPlayerWantedLevel(playerid0);
                    return 
true;
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GRAD1"Jogador OFF - Line");
                return 
true;
            }
        }
    }
    return 
true;

Reply
#3

Quote:
Originally Posted by iSmir
View Post
Sу Era Procurar ai, tinha um tуpico quase agora
ZCMD
PHP Code:
CMD:retirarsu(playeridparams[])
{
    new 
giveplayeridstring[125], name[24], name2[24];
    if(
IsPlayerAdmin(playerid))
    {
        
        if(
sscanf(params"usd"giveplayerid)) return SendClientMessage(playerid,WHITE,"Digite /retirarsu [ID]");
        else if(
giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid,WHITE,"Jogador OFF-Line");
        else
        {
            
            
GetPlayerName(giveplayeridnamesizeof(name));
            
GetPlayerName(playeridname2sizeof(name2));
            
WantedPoints[playerid] = 0;
                        
SetPlayerWantedLevel(playerid0);
            
format(stringsizeof(string), "Admin [%s] Retirou Os Suspeitos do Jogador [%s]"name2name);
            
SendClientMessageToAll(SUACORstring);
        }
    }
    else return 
SendClientMessage(playerid, -1"Comando Invalido !");
    return 
1;

STRCMP
PHP Code:
if(strcmp(cmd"/retirarsu"true) == 0)
{
        if(
IsPlayerAdmin(playerid))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"Digite: /tirarsu [id]");
                return 
true;
            }
            
giveplayerid ReturnUser(tmp);
            if(
IsPlayerConnected(giveplayerid))
            {
                if(
giveplayerid != INVALID_PLAYER_ID)
                {
                    
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                    
GetPlayerName(playeridsendernamesizeof(sendername));
                    new 
length strlen(cmdtext);
                    while ((
idx length) && (cmdtext[idx] <= ' '))
                    {
                        
idx++;
                    }
                    new 
offset idx;
                    new 
result[64];
                    while ((
idx length) && ((idx offset) < (sizeof(result) - 1)))
                    {
                        
result[idx offset] = cmdtext[idx];
                        
idx++;
                    }
                    
result[idx offset] = EOS;
                    if(!
strlen(result))
                    {
                        
SendClientMessage(playeridCOLOR_GRAD2"Digite: /tirarsu [id]");
                        return 
true;
                    }
                    
WantedPoints[playerid] = 0;
                    
SetPlayerWantedLevel(playerid0);
                    return 
true;
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GRAD1"Jogador OFF - Line");
                return 
true;
            }
        }
    }
    return 
true;

o pawno parou de responde ¬¬' nem mostro erro so paro de funcionar
Reply
#4

Se Testou Qual?

Nem Testei,
Nenhum
Reply
#5

Quote:
Originally Posted by iSmir
View Post
Se Testou Qual?

Nem Testei,
Nenhum
Bem ussei esse pois й esse que meu gm ussa
>>>>[strcmp]<<<<<
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)