SA-MP Forums Archive
Tutorial only appears for ID 0 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Tutorial only appears for ID 0 (/showthread.php?tid=591033)



Tutorial only appears for ID 0 - garotin - 07.10.2015

I ask for help, I'm racking my brain to try to figure out why the tutorial only appears for id 0, and when another player enters the id 0 back to the beginning of the tutorial ...

Code that call the tutorial:
http://pastebin.com/mrZ9Fxdn


Re: Tutorial only appears for ID 0 - jlalt - 07.10.2015

can you show us where you're calling MySQL_Login?


Re: Tutorial only appears for ID 0 - garotin - 07.10.2015

Here it is:
http://pastebin.com/Zc5HHsk7


Re: Tutorial only appears for ID 0 - Ahmad45123 - 07.10.2015

Post the function IniciarTuto please.


Re: Tutorial only appears for ID 0 - garotin - 07.10.2015

PHP код:
forward IniciarTuto(playerid);
public 
IniciarTuto(playerid)
{
    
Tuto[playerid] = 1;
    
ProxTuto[playerid] = 1;
    
SetPlayerCameraPos(playerid, -2535.52811302.938278.0744);
    
SetPlayerCameraLookAt(playerid, -2536.05711303.784177.8044);
    for(new 
i=0;i<11;++iPlayerTextDrawShow(playeridTutorialTD[i]);
    
SetTimerEx_("PularTuto"20000200001"d"playerid);
    return 
1;




Re: Tutorial only appears for ID 0 - Ahmad45123 - 07.10.2015

Please post all functions in timers...
I need PularTuto

And if there is any timers.. I need them too..


Re: Tutorial only appears for ID 0 - garotin - 07.10.2015

PHP код:
forward PularTuto(playerid);
public 
PularTuto(playerid)
{
    if(
Tuto[playerid] == 1)
    {
        
PodePular[playerid] = 1;
    }
    else
    {
        
Tuto[playerid] = 0;
        
ProxTuto[playerid] = 0;
        
TogglePlayerSpectating(playerid0);
        for(new 
i=0;i<11;++iPlayerTextDrawHide(playeridTutorialTD[i]);
    }
    return 
1;

PHP код:
if(oldkeys KEY_SECONDARY_ATTACK)
{
    if(
Tuto[playerid] == 1)
    {
        if(
PodePular[playerid] == 1)
        {
            for(new 
i=1;i<11;++iPlayerTextDrawHide(playeridTutorialTD[i]);
            if(
ProxTuto[playerid] < 15)
            {
                
ProxTutor(playerid);
            }
            else
            {
                
PlayerTextDrawHide(playeridTutorialTD[0]);
                
Tuto[playerid] = 0;
                
ProxTuto[playerid] = 0;
                
PodePular[playerid] = 0;
                
TogglePlayerSpectating(playerid0);
            }
            return 
1;
        }
    }
    return 
1;

ProxTutor(playerid)
http://pastebin.com/kiqbQaDt


Re: Tutorial only appears for ID 0 - Ahmad45123 - 07.10.2015

AFAK you should not need a playerid in the array but according to your code and the symptoms..
You will have to use an index for the playerid.

Код:
new PlayerText:TutorialTD[11][MAX_PLAYERS]



Re: Tutorial only appears for ID 0 - garotin - 07.10.2015

You think replacing it:
PHP код:
new PlayerText:TutorialTD[11
By this:
PHP код:
new PlayerText:TutorialTD[11][MAX_PLAYERS
It will work?


Re: Tutorial only appears for ID 0 - garotin - 07.10.2015

@Resolved

I checked all gamemode then able to find the error in SetTimerEx_