SA-MP Forums Archive
[AJUDA]ResetPlayerWeapons, Favela! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [AJUDA]ResetPlayerWeapons, Favela! (/showthread.php?tid=303151)



[AJUDA]ResetPlayerWeapons, Favela! - RedBulL_x - 11.12.2011

Alguns dias atrбs fiz um post com o mesmo conteъdo, titulo, dъvida mais ninguйm conseguiu-me ajudar eu queria criar um code que quando eu entrasse na favela eu recebesse algumas armas, e assim que eu sair resetar as armas jб vi que isso nгo й nada simples, quem me ajudar eu agradeзo de s2 e ganha Reput, Grato desde jб.

Cordenadas da Favela:

X№= 2117.333
YІ= -1069.962
XІ= 2261.841
YІ= -959.4252

ou seja 2117.333, -1069.962, 2261.841, -959.4252




Re: [AJUDA]ResetPlayerWeapons, Favela! - ViniBorn - 11.12.2011

http://forum.sa-mp.com/showpost.php?...4&postcount=17

Avisar se funcionou ou nгo ajuda bastante...


Re: [AJUDA]ResetPlayerWeapons, Favela! - Macintosh - 11.12.2011

pawn Код:
forward ChecarFavela( );
public ChecarFavela( )
{
    new
        Float: P[3]
    ;
   
    for( new i = 0; i < MAX_PLAYERS; i++ )
    {
        GetPlayerPos( i, P[0], P[1], P[2] );
        if ( P[0] <= 2117.333 && P[0] >= 2261.841 && P[1] <= -1069.962 && P[1] >= -959.4252 )
        {
            ResetPlayerWeapons( i );
        }
    }
    return true ;
}
pawn Код:
public OnGameModeInit( )
{
    SetTimer( "ChecarFavela", 5000, true );
    return true ;
}



Re: [AJUDA]ResetPlayerWeapons, Favela! - RedBulL_x - 12.12.2011

Mano atй modifiquei teu CODE, Fico assim.

Stock
PHP код:
stock IsPlayerInFavela(playerid)
{
    new 
Float:x,Float:y,Float:z;
    
GetPlayerPos(playeridxyz);
    if(
>= 2117.333 && >= -1069.962 && <= 2261.841 && <= -959.4252) return 1;
    else return 
0;

PHP код:
public CheckFavela(playerid)
{
    for(new 
i,GetMaxPlayers(); i!=ji++)
    {
        if(
IsPlayerConnected(i))
        {
            
//======================= Favela ==========================
            
if(IsPlayerInFavela(playerid))
            {
                    
GangZoneFlashForAll(favela,0xFFFFFFAA);
                    
GameTextForPlayer(i,"DM Liberado",1000,1);
                    
GivePlayerWeapon(i24999);
                    
GivePlayerWeapon(i91);
                    
GivePlayerWeapon(i25999);
                    
GivePlayerWeapon(i26999);
                    
GivePlayerWeapon(i30999);
                    
GivePlayerWeapon(i32999);
            }
            else
            {
                    
DMLiberado2[i] = 0;
                    
GangZoneStopFlashForAll(favela);
                    
ResetPlayerWeapons(playerid);
            }
        }
    }
    return 
1;

E Nгo deu certo ¬.¬'


Re: [AJUDA]ResetPlayerWeapons, Favela! - ViniBorn - 12.12.2011

As coordenadas daquele meu post estгo diferentes dessa que vocк acabou de postar.


Re: [AJUDA]ResetPlayerWeapons, Favela! - RedBulL_x - 12.12.2011

Sim cara, mais as duas cordenadas dгo na mesma, as duas sгo da favela.