[Ajuda] Verificar
#10

O cуdigo abaixo verifica a cada segundo se o jogador estб apй e parado, caso sim aumenta +10 de colete.
PHP код:
public OnGameModeInit()
{
    
SetTimer("DarColete"1000true);
    return 
1;
}
forward DarColete();
public 
DarColete()
{
    new 
Float:colete;
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i) && GetPlayerState(i) == PLAYER_STATE_ONFOOT && GetPlayerSpeed(itrue) == 0)
        {
            
GetPlayerArmour(icolete);
            if(
colete 100)
            {
                
colete += 10;
                if(
colete 100colete 100;
                
SetPlayerArmour(icolete);
            }
        }
    }
    return 
1;
}
stock GetPlayerSpeed(playerid,bool:kmh)
{
    new 
Float:Vx,Float:Vy,Float:Vz,Float:rtn;
    if(
IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid),Vx,Vy,Vz); else GetPlayerVelocity(playerid,Vx,Vy,Vz);
    
rtn floatsqroot(Vx*Vx Vy*Vy Vz*Vz);
    return 
kmh?floatround(rtn 100 1.63):floatround(rtn 100);

Reply


Messages In This Thread
Verificar - by Jorgeeee - 17.07.2017, 00:38
Re: Verificar - by DarkBr - 17.07.2017, 00:54
Re: Verificar - by Jorgeeee - 17.07.2017, 01:04
Re: Verificar - by GuilhermeNunes - 17.07.2017, 01:15
Re: Verificar - by Jorgeeee - 17.07.2017, 01:28
Re: Verificar - by GuilhermeNunes - 17.07.2017, 01:43
Respuesta: Verificar - by OtimoJogo - 17.07.2017, 04:09
Re: Verificar - by DarkBr - 17.07.2017, 14:16
Re: Verificar - by IlanZ - 17.07.2017, 18:53
Re: Verificar - by RodrigoMSR - 17.07.2017, 19:25

Forum Jump:


Users browsing this thread: 4 Guest(s)