[Ajuda] /su
#1

Quero fazer com que o oficial sу der /su se o player estiver prуximo a ele .

PHP код:
if(strcmp(cmd"/suspeito"true) == || strcmp(cmd"/su"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
             if(!
IsACop(playerid))
            {
                
SendClientMessage(playeridCOLOR_GREY"   Vocк nгo й um policial!");
                return 
true;
            }
            if(
IsPlayerInSkate(playerid))
            {
                
SendClientMessage(playerid,COLOR_YELLOW,"Vocк nгo pode dar /su em Territуrios !");
                return 
1;
            }
            if(
IsPlayerInPark(playerid))
            {
                
SendClientMessage(playerid,COLOR_YELLOW,"Vocк nгo pode dar /su em Territуrios !");
                return 
1;
            }
            if(
IsPlayerInMata(playerid))
            {
                
SendClientMessage(playerid,COLOR_YELLOW,"Vocк nгo pode dar /su em Territуrios !");
                return 
1;
            }
            if(
IsPlayerInEstacao(playerid))
            {
                
SendClientMessage(playerid,COLOR_YELLOW,"Vocк nгo pode dar /su em Territуrios !");
                return 
1;
            }
            if(
IsPlayerInCasarao(playerid))
            {
                
SendClientMessage(playerid,COLOR_YELLOW,"Vocк nгo pode dar /su em Territуrios !");
                return 
1;
            }
            if(
IsPlayerInFavela(playerid))
            {
                
SendClientMessage(playerid,COLOR_YELLOW,"Vocк nгo pode dar /su em Territуrios !");
                return 
1;
            }
            if(
IsPlayerInPosto(playerid))
            {
                
SendClientMessage(playerid,COLOR_YELLOW,"Vocк nгo pode dar /su em Territуrios !");
                return 
1;
            }
            if(
IsPlayerInHotel(playerid))
            {
                
SendClientMessage(playerid,COLOR_YELLOW,"Vocк nгo pode dar /su em Territуrios !");
                return 
1;
            }
            if(
OnDuty[playerid] != 1)
            {
                
SendClientMessage(playeridCOLOR_GREY"   Vocк nгo Bateu o cartгo!");
                return 
true;
            }
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USE: (/su)speito [id] [Descriзгo do Crime]");
                return 
true;
            }
            
giveplayerid ReturnUser(tmp);
            if (
IsACop(playerid))
            {
                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"USE: (/su)speito [id] [Descriзгo do Crime]");
                                return 
true;
                            }
                            if(
giveplayerid == playerid)
                            {
                                
SendClientMessage(playeridCOLOR_GREY"Vocк nгo pode colocar su em vocк mesmo !");
                                return 
1;
                            }
                            if(
strcmp(result,"DOP",true) == 0)
                            {
                                
result "Desobediкncia a Ordem Policial";
                            }
                            if(
strcmp(result,"TH",true) == 0)
                            {
                                
result "Tentativa de Homicнdio";
                            }
                            if(
strcmp(result,"PIA",true) == 0)
                            {
                                
result "Porte Ilegal de Armas";
                            }
                            if(
strcmp(result,"SEQ",true) == 0)
                            {
                                
result "Sequestro";
                            }
                            if(
strcmp(result,"DESACATO",true) == 0)
                            {
                                
result "Desacato a Autoridade";
                            }
                            if(
strcmp(result,"INVASГO",true) == 0)
                            {
                                
result "Invasгo de Local Restrito";
                            }
                            if(
strcmp(result,"RP",true) == 0)
                            {
                                
result "Resistкncia a Prisгo";
                            }
                            
SetPlayerCriminal(giveplayerid,playeridresult);
                            return 
true;
                    }
                }
                else
                {
                        
SendClientMessage(playeridCOLOR_GRAD1"  Esse jogador nгo estб conectado.");
                        return 
true;
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GRAD2"   Vocк nгo й um Policial !");
            }
        }
        return 
true;
 } 
Reply
#2

Quote:
Originally Posted by Wendell
Посмотреть сообщение
Quero fazer com que o oficial sу der /su se o player estiver prуximo a ele .

PHP код:
if(strcmp(cmd"/suspeito"true) == || strcmp(cmd"/su"true) == 0)
         new 
id strval(tmp);
    {
        if(
IsPlayerConnected(playerid))
        {
             if(!
IsACop(playerid))
            {
                
SendClientMessage(playeridCOLOR_GREY"   Vocк nгo й um policial!");
                return 
true;
            }
            if(
IsPlayerInSkate(playerid))
            {
                
SendClientMessage(playerid,COLOR_YELLOW,"Vocк nгo pode dar /su em Territуrios !");
                return 
1;
            }
            if(
IsPlayerInPark(playerid))
            {
                
SendClientMessage(playerid,COLOR_YELLOW,"Vocк nгo pode dar /su em Territуrios !");
                return 
1;
               }
                      if(
GetDistanceBetweenPlayers(playeridid) > 15)
                   {
                   
SendClientMessage(playeridVermelho" | ERRO | Vocк estб muito longe, chegue mais perto!");
                   return 
1;
                   }
            if(
IsPlayerInMata(playerid))
            {
                
SendClientMessage(playerid,COLOR_YELLOW,"Vocк nгo pode dar /su em Territуrios !");
                return 
1;
            }
            if(
IsPlayerInEstacao(playerid))
            {
                
SendClientMessage(playerid,COLOR_YELLOW,"Vocк nгo pode dar /su em Territуrios !");
                return 
1;
            }
            if(
IsPlayerInCasarao(playerid))
            {
                
SendClientMessage(playerid,COLOR_YELLOW,"Vocк nгo pode dar /su em Territуrios !");
                return 
1;
            }
            if(
IsPlayerInFavela(playerid))
            {
                
SendClientMessage(playerid,COLOR_YELLOW,"Vocк nгo pode dar /su em Territуrios !");
                return 
1;
            }
            if(
IsPlayerInPosto(playerid))
            {
                
SendClientMessage(playerid,COLOR_YELLOW,"Vocк nгo pode dar /su em Territуrios !");
                return 
1;
            }
            if(
IsPlayerInHotel(playerid))
            {
                
SendClientMessage(playerid,COLOR_YELLOW,"Vocк nгo pode dar /su em Territуrios !");
                return 
1;
            }
            if(
OnDuty[playerid] != 1)
            {
                
SendClientMessage(playeridCOLOR_GREY"   Vocк nгo Bateu o cartгo!");
                return 
true;
            }
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USE: (/su)speito [id] [Descriзгo do Crime]");
                return 
true;
            }
            
giveplayerid ReturnUser(tmp);
            if (
IsACop(playerid))
            {
                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"USE: (/su)speito [id] [Descriзгo do Crime]");
                                return 
true;
                            }
                            if(
giveplayerid == playerid)
                            {
                                
SendClientMessage(playeridCOLOR_GREY"Vocк nгo pode colocar su em vocк mesmo !");
                                return 
1;
                            }
                            if(
strcmp(result,"DOP",true) == 0)
                            {
                                
result "Desobediкncia a Ordem Policial";
                            }
                            if(
strcmp(result,"TH",true) == 0)
                            {
                                
result "Tentativa de Homicнdio";
                            }
                            if(
strcmp(result,"PIA",true) == 0)
                            {
                                
result "Porte Ilegal de Armas";
                            }
                            if(
strcmp(result,"SEQ",true) == 0)
                            {
                                
result "Sequestro";
                            }
                            if(
strcmp(result,"DESACATO",true) == 0)
                            {
                                
result "Desacato a Autoridade";
                            }
                            if(
strcmp(result,"INVASГO",true) == 0)
                            {
                                
result "Invasгo de Local Restrito";
                            }
                            if(
strcmp(result,"RP",true) == 0)
                            {
                                
result "Resistкncia a Prisгo";
                            }
                            
SetPlayerCriminal(giveplayerid,playeridresult);
                            return 
true;
                    }
                }
                else
                {
                        
SendClientMessage(playeridCOLOR_GRAD1"  Esse jogador nгo estб conectado.");
                        return 
true;
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GRAD2"   Vocк nгo й um Policial !");
            }
        }
        return 
true;
 } 
Tenta ai
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)