SA-MP Forums Archive
[HELP]For Intro - 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: [HELP]For Intro (/showthread.php?tid=299490)



[HELP]For Intro - luis_mendoza - 26.11.2011

Hi all,i have a problem with intro making.I use intro from this gamemode http://forum.sa-mp.com/showthread.ph...t=brasil+intro and i add this intro,and when i connect on my server i get this (register system and intro same time) how can i fix that

here are screens




Re: [HELP]For Intro - fiki574 - 26.11.2011

Quote:
Originally Posted by luis_mendoza
Посмотреть сообщение
Hi all,i have a problem with intro making.I use intro from this gamemode http://forum.sa-mp.com/showthread.ph...t=brasil+intro and i add this intro,and when i connect on my server i get this (register system and intro same time) how can i fix that

here are screens

Makni dialog sa OnPlayerConnect i prebaci ga na OnPlayerSpawn!


Re: [HELP]For Intro - Rob_Maate - 26.11.2011

Create a variable like PlayerLogged[MAX_PLAYERS] and only show the intro when it is set to 1 (change this upon a successful login).
Then have a HasPlayerViewedIntro[MAX_PLAYERS] which you can set to 1 following the intro.
Before showing the introduction, check for HasPlayerViewedIntro, if it = 1, skip it.

Make sure you save HasPlayerViewedIntro to file, so the next time your player logs in he doesn't have to go through the same thing.


Re: [HELP]For Intro - luis_mendoza - 26.11.2011

i have fixed without this all posts...but ty all


Re: [HELP]For Intro - luis_mendoza - 26.11.2011

I have now an another problem...I have fixed that the intro and register system can't get at the same time.And i have added this

TogglePlayerSpectating(playerid, true);
ForceClassSelection(playerid);

above this

SetPVarInt(playerid, "Intro", 0);
SetTimerEx("ShowIntro", 1000, 0, "d", playerid); and it works now like this



But when I'm dead it shows me this now




Re: [HELP]For Intro - Rob_Maate - 26.11.2011

Yeah, as I said, you need to declare in a variable that a player has finished the intro.
After that, you need to check if the player has completed the intro BEFORE allowing it to run


Re: [HELP]For Intro - luis_mendoza - 26.11.2011

hmm I dont know how to do that,this is first time that i am doing a intro.And as i said i use from this gamemode
http://forum.sa-mp.com/showthread.ph...t=brasil+intro. PLS help


Re: [HELP]For Intro - Rob_Maate - 26.11.2011

kk up top of your script with all the other "new xxxx[MAX_XXX_XXX]" 's

Place the following:

pawn Код:
new CompletedIntro[MAX_PLAYERS];
You have now declared your variable. YAY.


Next step, head to the END of your Intro.
Right after you finish, literally the last thing you want to write inside the intro code is:

pawn Код:
CompletedIntro[playerid] = 1;

kk so we can now detect if a player has finished the introduction.
How to prevent this player from seeing it again?

Go to the START of your introduction code
Insert the following:

pawn Код:
if(CompletedIntro[playerid] == 1) return 1;
Congratulations! We now can prevent a player from having to relive the intro everytime they die.

Next step, saving that variable to a file. I'm sure there's methods inside your gamemode to do that but I really can't be bothered downloading it right now lmao, i'll do it in the morning if noone goes through it before then


Re: [HELP]For Intro - luis_mendoza - 26.11.2011

I have fixed it before this,but ty


Re: [HELP]For Intro - Rob_Maate - 26.11.2011

ah k