[Ajuda] /r
#3

Vocк precisa fazer um loop, verificando jogadores online e se tem a permissгo.

Recomendo o uso da funзгo GetPlayerPoolSize para pegar o id mais alto.

Exemplo:
PHP Code:
new playerson 0;
for(new 
iGetPlayerPoolSize(); <= ji++){
    
//Caso nгo esteja online passa para o prуximo id
    
if(!IsPlayerConnected(i))
        continue;
    
playerson++;
}
printf("%d jogadores online."playerson); 
Outra observaзгo nesse comando, й que nгo й necessбrio o uso do sscanf.

Basta usar isnull:
PHP Code:
#if !defined isnull
    #define isnull(%1) \
                
((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
#endif 
Uso:
PHP Code:
CMD:teste(playeridparams[]){
    if(
isnull(params)){
        
SendClientMessage(playerid, -1"Use /teste [texto]");
        return 
1;
    }
    
SendClientMessage(playerid, -1params);
    return 
1;

Jб respondendo a dъvida sobre o outro tуpico, basta fazer o loop verificar se esta online, e usar a funзгo IsPlayerInRangeOfPoint para verificar se o jogador estб perto de uma coordenada junto com as funзхes GetPlayerInterior e GetPlayerVirtualWorld.

Lembrando que precisa usar a funзгo GetPlayerPos para pegar as coordenadas do jogador que usou o comando.

PHP Code:
new FloatxFloatyFloatz;
new 
vwinterior;
GetPlayerPos(playeridx,yz);
interior GetPlayerInterior(playerid);
vw GetPlayerVirtualWorld(playerid);
for(new 
iGetPlayerPoolSize(); <= ji++){
    if(!
IsPlayerConnected(i))
        continue;
    
//Caso o jogador nгo esteja perto, esteja em outro virtual world ou esteja em um interior diferente passa para o prуximo id
    
if(!IsPlayerInRangeOfPoint(i10.0xyz) || vw != GetPlayerVirtualWorld(i) || interior != GetPlayerInterior(i))
        continue;
    
//Caso esteja perto manda a mensagem
    
SendClientMessage(i, -1"Teste");

Reply


Messages In This Thread
/r - by hurubuh - 13.04.2019, 18:24
Re: /r - by DarthVeider - 13.04.2019, 20:00
Re: /r - by MultiKill - 13.04.2019, 20:09
Re: /r - by Don_Speed - 13.04.2019, 22:46
Re: /r - by FerrariL - 13.04.2019, 23:49
Re: /r - by DarthVeider - 14.04.2019, 01:35
Re: /r - by hurubuh - 14.04.2019, 15:18
Re: /r - by FerrariL - 14.04.2019, 15:50
Re: /r - by hurubuh - 14.04.2019, 15:58
Re: /r - by FerrariL - 14.04.2019, 16:13
Re: /r - by Psicotico - 14.04.2019, 17:21
Re: /r - by hurubuh - 15.04.2019, 21:15
Re: /r - by ipsLuan - 15.04.2019, 21:31
Re: /r - by DarthVeider - 15.04.2019, 23:10
Re: /r - by Don_Speed - 15.04.2019, 23:11
Re: /r - by DarthVeider - 15.04.2019, 23:18
Re: /r - by hurubuh - 16.04.2019, 16:01

Forum Jump:


Users browsing this thread: 1 Guest(s)