Originally Posted by will_92
on valhallla i don't know how they do it , but when you come in i don't know if they put it under onplayerconnect but when you come in and spawn it shows you a tutorial on how to play the game forcefully by making a toggle , and so i don't know if anyone has a script that can show me how to do the tutorial thingy. please help me with this
|
#include <a_samp>
#define RULE_LINE_0 "bla bla bla"
#define RULE_LINE_1 "Some more blabla"
#define RULE_LINE_2 "now some info"
#define RULE_LINE_3 "~y~TYPE ~>~~r~I UNDERSTAND~<~ ~y~to be aible to spawn"
new PlayerMustReadRule[MAX_PLAYERS];
new Text:TxtRules;
public OnFilterScriptInit()
{
print("===> read the rules");
new TmpString[200];// make sure you have enought room to store all the character of every RULE_LINE
format(TmpString,sizeof(TmpString),"%s~n~%s~n~%s~n~%s~n~",
RULE_LINE_0, RULE_LINE_1, RULE_LINE_2, RULE_LINE_3);
//we format our rules text
TxtRules = TextDrawCreate(225.0, 35.0,TmpString); //we create our rules text
TextDrawFont(TxtRules,1);
TextDrawLetterSize(TxtRules,0.26,1.08);
TextDrawColor(TxtRules,0xD7D7D799); //
TextDrawSetShadow(TxtRules,0);
TextDrawSetOutline(TxtRules,1);
TextDrawBackgroundColor(TxtRules,0x00000099);
TextDrawUseBox(TxtRules,0);
return 1;
}
public OnFilterScriptExit()
{
TextDrawDestroy(TxtRules); // when the script unload we destroy the text
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
if(PlayerMustReadRule[playerid]) //if the player must read ...
{
TextDrawShowForPlayer(playerid,TxtRules);//we show him the text
}
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
if(PlayerMustReadRule[playerid]) return 0; //the player must read the rule and cant spawn
return 1;
}
public OnPlayerConnect(playerid)
{
PlayerMustReadRule[playerid] = 1; //the player is freshly connected he need to read the rules
return 1;
}
public OnPlayerText(playerid, text[])
{
if (strcmp("I UNDERSTAND", text, true, 12) == 0)
{
TextDrawHideForPlayer(playerid, TxtRules);// we hide our text
PlayerMustReadRule[playerid] = 0; //set the player so he can spawn
return 0;
}
return 1;
}