[Ajuda] Script causando erros
#1

Bom eu estou codando uma GM FreeRoam entгo estava fazendo um contador simples de drift, e entгo eis que deu um erro(Nгo no copilador), o erro e o seguinte o player entra in-game mas nгo passa deste ponto:
Код:
{FFFFFF}SA-MP {B9C9BF}0.3z-R2 {FFFFFF}Started

Connecting to 127.0.0.1:7777...

Connected. Joining the game...

Server closed the connection.
Entгo no console aparece o seguinte:
Код:
Kicking 127.0.0.1 because they didn't logon to the game.
Ae eu pesquisei e cheguei neste tуpico: https://sampforum.blast.hk/showthread.php?tid=413146
Porйm quando retiro o script que fiz volta a funcionar normalmente sem lag nenhum. Aqui esta o script para aqueles que queiram me ajudar a concertalo:
PHP код:
// Callbacks:
Minigame_OnGameModeInit()
{
    
DriftSet_DamageCheck();
    
DriftSet_UpdateDelay(8);
    
DriftSet_Divider(3000);
    
DriftSet_StartEndDelay(30);
    
DriftSet_MinimalAngle(15.5);
     
DriftSet_MinimalSpeed(30.5);
    
TextDrift TextDrawCreate(504.400177263.073181"Drift");
    
TextDrawLetterSize(TextDrift0.4781252.055001);
    
TextDrawAlignment(TextDrift1);
    
TextDrawColor(TextDrift16711935);
    
TextDrawSetOutline(TextDrift1);
    
TextDrawBackgroundColor(TextDrift255);
    
TextDrawFont(TextDrift2);
}
Minigame_OnPlayerConnect(playerid)
{
    
PlayerTextDrift[playerid] = CreatePlayerTextDraw(playerid,521.900146281.156616"~g~~h~+_0");
    
PlayerTextDrawLetterSize(playerid,PlayerTextDrift[playerid], 0.4618751.903335);
    
PlayerTextDrawAlignment(playerid,PlayerTextDrift[playerid], 1);
    
PlayerTextDrawColor(playerid,PlayerTextDrift[playerid], -1);
    
PlayerTextDrawSetOutline(playerid,PlayerTextDrift[playerid], 1);
    
PlayerTextDrawBackgroundColor(playerid,PlayerTextDrift[playerid], 255);
    
PlayerTextDrawFont(playerid,PlayerTextDrift[playerid], 2);
    return 
true;
}
public 
OnPlayerDriftStart(playerid)
{
    if(!(
getBit4(Minigame,playerid)))
    {
        
TextDrawShowForPlayer(playeridTextDrift);
        
PlayerTextDrawSetString(playeridPlayerTextDrift[playerid], "~g~~h~+_0");
        
PlayerTextDrawShow(playeridPlayerTextDrift[playerid]);
    }
    return 
true;
}
public 
OnPlayerDriftUpdate(playerid,value,combo,flagid,Float:distance,Float:speed)
{
    if(!(
getBit4(Minigame,playerid)))
    {
        
Formatar(str,70,"~g~~h~+_%d",value);
        
PlayerTextDrawSetString(playeridPlayerTextDrift[playerid], str);
    }
    return 
true;
}
public 
OnPlayerDriftEnd(playerid,value,combo,reason)
{
    if(!(
getBit4(Minigame,playerid)))
    {
        switch(
reason)
        {
            case 
0:
            {
                
Formatar(str,70,"~g~~h~+_%d",value);
                
PlayerTextDrawSetString(playeridPlayerTextDrift[playerid], str);
                
SetTimerEx("DriftEnd"1500false"dd",playerid,value);
            }
            default:
            {
                
Formatar(str,70,"~r~~h~%d",value);
                
PlayerTextDrawSetString(playeridPlayerTextDrift[playerid], str);
            }
        }
    }
    return 
true;
}
// Timer:
TimerDriftEnd(playerid,value)
{
    
TextDrawHideForPlayer(playeridTextDrift);
    
PlayerTextDrawHide(playeridPlayerTextDrift[playerid]);
    new 
exp floatround(value 10);
    
Formatar(str,70,"+_%d",exp);
    
PlayerTextDrawSetString(playeridPlayerTextExp[playerid], str);
    
TextDrawShowForPlayer(playeridTextExp);
    
PlayerTextDrawShow(playeridPlayerTextExp[playerid]);
    return 
true;

Ele esta "adaptado" ao meu gamemode e todas as funзхes, ou variaveis usadas neles funcionam perfeitamente
Obrigado :-
Reply
#2

coloca so:

PHP код:
Minigame_OnPlayerConnect(playerid

    
PlayerTextDrift[playerid] = CreatePlayerTextDraw(playerid,521.900146281.156616"~g~~h~+_0"); 
    
PlayerTextDrawLetterSize(playerid,PlayerTextDrift[playerid], 0.4618751.903335); 
    
PlayerTextDrawAlignment(playerid,PlayerTextDrift[playerid], 1); 
    
PlayerTextDrawColor(playerid,PlayerTextDrift[playerid], -1); 
    
PlayerTextDrawSetOutline(playerid,PlayerTextDrift[playerid], 1); 
    
PlayerTextDrawBackgroundColor(playerid,PlayerTextDrift[playerid], 255); 
    
PlayerTextDrawFont(playerid,PlayerTextDrift[playerid], 2);  

Reply
#3

Quote:
Originally Posted by PT
Посмотреть сообщение
coloca so:

PHP код:
Minigame_OnPlayerConnect(playerid

    
PlayerTextDrift[playerid] = CreatePlayerTextDraw(playerid,521.900146281.156616"~g~~h~+_0"); 
    
PlayerTextDrawLetterSize(playerid,PlayerTextDrift[playerid], 0.4618751.903335); 
    
PlayerTextDrawAlignment(playerid,PlayerTextDrift[playerid], 1); 
    
PlayerTextDrawColor(playerid,PlayerTextDrift[playerid], -1); 
    
PlayerTextDrawSetOutline(playerid,PlayerTextDrift[playerid], 1); 
    
PlayerTextDrawBackgroundColor(playerid,PlayerTextDrift[playerid], 255); 
    
PlayerTextDrawFont(playerid,PlayerTextDrift[playerid], 2);  

n n foi isto .-.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)