SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 20/03/2020, 08:00 PM   #1
moura98
Huge Clucker
 
moura98's Avatar
 
Join Date: Jul 2015
Location: Brasil
Posts: 478
Reputation: 20
Default BUG DE SPAWN

Galera toda vez que meu personagem morre ele chama aquela classe de selecao << >> Spawn
como faz para tirar aquilo? nao era para ta aparecendo essa tela.

o problema de fato e que Onplayerrequestclass esta sendo chamada quando o personagem morre.

deixei minhas callbacks assim :

Code:
public OnPlayerRequestSpawn(playerid)
{
	return 0;
}
public OnPlayerRequestClass(playerid, classid)
{
	return 0;
}
Aqui esta OnplayerSpawn e OnplayerDeath

PHP Code:
public OnPlayerSpawn(playerid)
{
    if( 
Morreu[playerid] == true )
    {
           if( 
JogandoFreefire[playerid] == )
        {
            
SetTimerEx("SpawnarFF"100false"i"playerid);
        }
        else if( 
JogandoFreefire[playerid] == )
        {
            
SetTimerEx("IrComa"1000false"i"playerid);
        }    
    }
    if(
gettime() >= Player[playerid][dvip])
    {
       
Player[playerid][vip] = 0;
       
Player[playerid][dvip] = 0;
    }
    
SetPlayerInterior(playerid,0);
    
ClearAnimations(playerid);
    
SetTimerEx("AtualizarFomeSede"1000true"i"playerid);
    
SetTimerEx("VerificarPreso"1000false"i"playerid);
    
SetTimerEx("VerificarPresoPAdm"1000false"i"playerid);
    return 
1;
}

public 
OnPlayerDeath(playeridkilleridreason)
{
    
Morreu[playerid] = true;
    
antifakekill[playerid] ++;
    
SendDeathMessage(killeridplayeridreason);
    
SetTimerEx("antifakekill2"1000,false,"i",playerid);
    if( 
JogandoFreefire[playerid] == && killerid != INVALID_PLAYER_ID)
    {
        new 
string[150];
        
format(stringsizeof(string), ""VerdeClaro"[Free Fire] "Branco"%s matou %s"PegarNome(killerid), PegarNome(playerid));
        
ProxDetector(1000.0playeridstringBRANCO,BRANCO,BRANCO,BRANCO,BRANCO);
    }
    else if(
playerid != INVALID_PLAYER_ID && killerid != INVALID_PLAYER_ID && !JogandoFreefire[playerid] && !JogandoFreefire[killerid] )
    {
        new 
str[100];
        
Player[killerid][Procurado] += 1;
        
format(strsizeof(str), "[CRIME] %s feriu %s e ganhou 1 nivel de procurado.",PegarNome(killerid), PegarNome(playerid));
        
ProxDetector(50.0playeridstrAZUL_CLARO,AZUL_CLARO ,AZUL_CLARO,AZUL_CLARO,AZUL_CLARO);
        
SCM(killerid, -1str);
    }
    if(
Player[playerid][pEmprego] == Caminhoneiro)
    {
        if( 
Carregado[playerid] == 1)
        {
            
Carregado[playerid] = 0;
            
rota[playerid] = 0;
            
DisablePlayerCheckpoint(playerid);
        }
    }
    if(
Player[playerid][pEmprego] == Gari)
    {
        if( 
GariTrabalhando[playerid] > 0)
        {
            
GariTrabalhando[playerid] = 0
            
DisablePlayerCheckpoint(playerid);
        }
    }
    if(
Player[playerid][pEmprego] == TecnicoNet)
    {
        if( 
CheckReparo[playerid] > 0)
        {
            
CheckReparo[playerid] = 0
            
DisablePlayerCheckpoint(playerid);
        }
    }
    if(
Player[playerid][pEmprego] == Carregador)
    {
        if( 
Carrego[playerid] > 0)
        {
            
Carrego[playerid] = 0
            
DisablePlayerCheckpoint(playerid);
        }
    }
    if(
Player[playerid][pEmprego] == TCimento )
    {
        if( 
CimentoCarregado[playerid] > 0)
        {
            
CimentoCarregado[playerid] = 0
            
DisablePlayerCheckpoint(playerid);
        }
    }
    
UberEntregando[playerid] = 0;
    return 
1;

__________________
moura98 is offline   Reply With Quote
Old 20/03/2020, 08:07 PM   #2
G4M30V3R
Big Clucker
 
G4M30V3R's Avatar
 
Join Date: Jun 2016
Posts: 154
Reputation: 23
Default Re: BUG DE SPAWN

Search, please!!!!
https://forum.sa-mp.com/showthread.php?t=637594
G4M30V3R is offline   Reply With Quote
Old 20/03/2020, 08:15 PM   #3
moura98
Huge Clucker
 
moura98's Avatar
 
Join Date: Jul 2015
Location: Brasil
Posts: 478
Reputation: 20
Default Re: BUG DE SPAWN

eu gostaria que nao fosse chamado quando o personagem morrer.

o problema de fato e que Onplayerrequestclass esta sendo chamada quando o personagem morre.
__________________
moura98 is offline   Reply With Quote
Old 20/03/2020, 08:28 PM   #4
RodrigoMSR
High-roller
 
RodrigoMSR's Avatar
 
Join Date: Mar 2015
Location: Brazil
Posts: 1,068
Reputation: 140
Default Re: BUG DE SPAWN

Procure pela função ForceClassSelection em seus scripts.
__________________
sttserver.net

RodrigoMSR is offline   Reply With Quote
Old 20/03/2020, 08:45 PM   #5
moura98
Huge Clucker
 
moura98's Avatar
 
Join Date: Jul 2015
Location: Brasil
Posts: 478
Reputation: 20
Default Re: BUG DE SPAWN

Quote:
Originally Posted by RodrigoMSR View Post
Procure pela função ForceClassSelection em seus scripts.
pior de tudo e que nao tem
__________________
moura98 is offline   Reply With Quote
Old 20/03/2020, 09:01 PM   #6
Felipealves
Huge Clucker
 
Felipealves's Avatar
 
Join Date: Mar 2016
Location: Paraná
Posts: 452
Reputation: 25
Default Re: BUG DE SPAWN

Eu tinha esse problema e para contornar eu uso assim.
PHP Code:
public OnPlayerRequestClass(playeridclassid)
{
    if(!
Player_Logado[playerid])
    {
        
// conect
    
}
    else
    {
        
SetSpawnInfo(playerid0pInfo[playerid][p_Skin], xyzrot000000);
        
SpawnPlayer(playerid);
    }
    return 
1;
}

public 
OnPlayerRequestSpawn(playerid)
{
    return 
1;

__________________

CRIMINAL LIFE RPG - Imagens
Felipealves is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
'Corrupt Spawn' - Players crash sometimes when they spawn. Dokins Scripting Help 9 04/10/2016 09:37 PM
Spawn issue - I spawn at Blueberry after registering AndySedeyn Scripting Help 15 25/05/2014 09:44 PM
Spawn Selection textdraw and spawn music DownDuckling Scripting Help 4 14/10/2012 01:42 AM
[AJUDA] Colocar TextDraw Antes do Spawn e Após Spawn davidjnio Português/Portuguese 9 30/08/2011 06:53 PM
[Help] Object/item ectra spawn on player spawn? No-Half-Measures Help Archive 3 21/01/2010 09:38 AM


All times are GMT. The time now is 05:25 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.