SA-MP Forums Archive
Tutorial system - 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 system (/showthread.php?tid=354596)



Tutorial system - kepa333 - 27.06.2012

hello i made simple tutorial system for my RP server, but i dont know how to fix errors.

Код:
//=========================================================
		if(PlayerInfo[playerid][playertutorial] == 0 || RegistrationStep[playerid] == 1)
		{
		    if(PlayerInfo[playerid][tutpart] == 0)
		    {
			    SetPlayerCameraPos(playerid, 1443.4468, -1667.0455, 172.4551);
				SetPlayerCameraLookAt(playerid, 1444.4482, -1667.0360, 169.3003);
				SendClientMessage(playerid, COLOR_WHITE, "What is RolePlay?");
				SendClientMessage(playerid, COLOR_WHITE, "Roleplay is a way of gaming. The word already says what it means. You have to play a role");
				SendClientMessage(playerid, COLOR_WHITE, "For example, you play a drug dealer,You will act like a dealer in-game. You talk like");
				SendClientMessage(playerid, COLOR_WHITE, "a drug dealer you act like a drug dealer etc.");
				SendClientMessage(playerid, COLOR_WHITE, "Whiles you are playing a drug dealer, other people might be a police officer or boxer.");
	   			TogglePlayerControllable(playerid, 0); //
	    		SetTimerEx("playertutfinish", 30000, false, "i", playerid);
	    		PlayerInfo[playerid][tutpart] = 1;
	    	}
	    	if(PlayerInfo[playerid][tutpart] == 1)
		    {
				SetPlayerCameraPos(playerid, 1516.8138, -1637.0669, 14.0503);
				SetPlayerCameraLookAt(playerid, 1515.8191, -1637.1910, 14.2505);
				SendClientMessage(playerid, COLOR_WHITE, "What is metagaming?");
				SendClientMessage(playerid, COLOR_WHITE, "Metagaming is mixing IC and OOC information.");
				SendClientMessage(playerid, COLOR_WHITE, "First, what is IC and OOC.");
				SendClientMessage(playerid, COLOR_WHITE, "IC stands for In Character. So that’s the drug dealer we were talking about earlier.");
				SendClientMessage(playerid, COLOR_WHITE, "OOC stands for Out Of Character. That’s you, the man behind the computer basically.");
				SendClientMessage(playerid, COLOR_WHITE, "So mixing IC and OOC info is called metagaming. An example:");
				SendClientMessage(playerid, COLOR_WHITE, "");
				SendClientMessage(playerid, COLOR_WHITE, "You see a guy, with some text above his head. Jason_Mendez (31)");
				SendClientMessage(playerid, COLOR_WHITE, "So, now you know you see a guy called Jason, and he has ID 31. This info is OOC, since people don’t");
				SendClientMessage(playerid, COLOR_WHITE, "have their names above their head in real life.");
				SendClientMessage(playerid, COLOR_WHITE, "So if you talk to the man, you will say: ‘Hey man, what’s your name?’");
				SendClientMessage(playerid, COLOR_WHITE, "Saying stuff like: ‘Hey Jason!’ is metagaming. You don’t know his name.");
			   	TogglePlayerControllable(playerid, 0); //
			    SetTimerEx("playertutfinish", 25000, false, "i", playerid);
			    PlayerInfo[playerid][tutpart] = 2;
			}
			if(PlayerInfo[playerid][tutpart] == 2)
		    {
				SetPlayerCameraPos(playerid, 1241.6555, -1396.2627, 13.6066);
				SetPlayerCameraLookAt(playerid, 1241.2216, -1395.3585, 13.8616);
				SendClientMessage(playerid, COLOR_WHITE, "What is Powergaming?");
				SendClientMessage(playerid, COLOR_WHITE, "Powergaming is doing unrealistic actions. Like: /me takes his superman suit and flies to the moon.");
				SendClientMessage(playerid, COLOR_WHITE, "This is not realistic, and considered as powergaming. Powergaming is NOT allowed.");
				SendClientMessage(playerid, COLOR_WHITE, "Powergaming is also forcing somebody to do something. It’s hard to explain, but some examples will do.");
				SendClientMessage(playerid, COLOR_WHITE, "Imagine, you are arguing with somebody. Then you decide that you are going to use a /me command.");
				SendClientMessage(playerid, COLOR_WHITE, "");
				SendClientMessage(playerid, COLOR_WHITE, "Example: /me takes a plastic bag, pulls it over Who_Ever’s head and kills him.");
				SendClientMessage(playerid, COLOR_WHITE, "This is powergaming. You are forcing the player to kill himself.");
				SendClientMessage(playerid, COLOR_WHITE, "If the player won’t kill himself, the RolePlay is messed up.");
				SendClientMessage(playerid, COLOR_WHITE, "So, never force people to kill themselves.");
				TogglePlayerControllable(playerid, 0); //
	    		SetTimerEx("playertutfinish", 30000, false, "i", playerid);
			}
	 	}
	}
ERRORS:
Код:
C:\Users\MaticKepa\Desktop\Real Life ENG\gamemodes\mazda.pwn(19164) : warning 213: tag mismatch
C:\Users\MaticKepa\Desktop\Real Life ENG\gamemodes\mazda.pwn(19177) : warning 213: tag mismatch
C:\Users\MaticKepa\Desktop\Real Life ENG\gamemodes\mazda.pwn(19195) : warning 213: tag mismatch
C:\Users\MaticKepa\Desktop\Real Life ENG\gamemodes\mazda.pwn(19197) : warning 213: tag mismatch
C:\Users\MaticKepa\Desktop\Real Life ENG\gamemodes\mazda.pwn(23373) : error 022: must be lvalue (non-constant)
C:\Users\MaticKepa\Desktop\Real Life ENG\gamemodes\mazda.pwn(23373) : warning 215: expression has no effect
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase



Re: Tutorial system - kepa333 - 27.06.2012

fixed it, but now, when 1 player login its shows when he writing Password how to make it it will be after password and how to make timer work correct, becouse its shows all at 1 time.

Код:
public OnPlayerRequestClass(playerid, classid)
{
	new string[768];
	PlayerPlaySound(playerid, 1068, 0.0, 0.0, 0.0);
	PlayerInfo[playerid][pModel] = Peds[classid][0];
    if(IsPlayerNPC(playerid))
	{
	    SpawnPlayer(playerid);
		return 1;
	}
	if (RegistrationStep[playerid] == 0 && gPlayerLogged[playerid] != 1)
	{
// =========================================================
        PlayerPlaySound(playerid, 1185, 0.0, 0.0, 0.0);
	    SetPlayerCameraPos(playerid,1460.0, -1324.0, 287.2);
	    SetPlayerCameraLookAt(playerid,1374.5, -1291.1, 239.0);
	    Camera[playerid] = 1;
	    CameraX[playerid] = 1460.0;
	    CameraY[playerid] = -1324.0;
	    CameraZ[playerid] = 287.2;
//=========================================================

        ClearChatbox(playerid, 20);
        format(string, sizeof(string), "{33CCFF} Welcome To Evolution Roleplay", Version);
        SendClientMessage(playerid, COLOR_YELLOW, string);
        format(string, sizeof(string), "{33CCFF} Your home to the ultimate Role-Playing experience!", Version);
		SendClientMessage(playerid, COLOR_YELLOW, string);
		SendClientMessage(playerid, COLOR_YELLOW2, " ");
		new message[] = "\t\t\t\t\t\t Evolution Roleplay Terms and Conditions \n\n\n\n\n\n 1- This server contains adult content. You agree that you have the legal age in your country to be exposed to such material\n\n 2- This server does not allows Hacks, you agree that you are not going to use any third party program in order to get any advantage.";
		new message2[] = "\n\n 3- By Reading this, you agree to Follow all server /rules with risk of being kicked or banned by breaking them.\n\n 4- By reading this you also agree that you will obey administrators ALWAYS, unless it breaks any term (1) (2) (3) (5). \n\n 5- This server obeys the Terms and Conditions made by the SA:MP Team at www.sa-mp.com/service_agreement \n\n\n Press on 'Agree' If you Agree, 'Refuse' If you refuse.";
		format(string, sizeof(string),"%s %s",message,message2);
		ShowPlayerDialog(playerid,1244,DIALOG_STYLE_MSGBOX,"Evolution RP Terms and Conditions",string,"Agree","Refuse");
		PlayerInfo[playerid][pModel] = Peds[classid][0];
		SetPlayerTeamFromClass(playerid,classid);

//=========================================================

	    SetPlayerCameraPos(playerid,755.1537,-1592.8079,70.7801);
	    SetPlayerCameraLookAt(playerid,755.1537,-1592.8079,70.7801);
	    Camera[playerid] = 1;
	    CameraX[playerid] = 755.1537;
	    CameraY[playerid] = -1592.8079;
	    CameraZ[playerid] = 70.7801;
	    new Welcomemessege[128],name[MAX_PLAYER_NAME];
		GetPlayerName(playerid,name,MAX_PLAYER_NAME);
		format(Welcomemessege,sizeof(Welcomemessege),"~k~ ~y~Welcome %s !",name); //~k~ is not a valid color , you have to replace it
		GameTextForPlayer(playerid,Welcomemessege,10000,6);
//=========================================================
		if(PlayerInfo[playerid][playertutorial] == 0 || RegistrationStep[playerid] == 1)
		{
		    if(tutpart == 0)
		    {
			    SetPlayerCameraPos(playerid, 1443.4468, -1667.0455, 172.4551);
				SetPlayerCameraLookAt(playerid, 1444.4482, -1667.0360, 169.3003);
				SendClientMessage(playerid, COLOR_WHITE, "What is RolePlay?");
				SendClientMessage(playerid, COLOR_WHITE, "Roleplay is a way of gaming. The word already says what it means. You have to play a role");
				SendClientMessage(playerid, COLOR_WHITE, "For example, you play a drug dealer,You will act like a dealer in-game. You talk like");
				SendClientMessage(playerid, COLOR_WHITE, "a drug dealer you act like a drug dealer etc.");
				SendClientMessage(playerid, COLOR_WHITE, "Whiles you are playing a drug dealer, other people might be a police officer or boxer.");
	   			TogglePlayerControllable(playerid, 0); //
	    		SetTimerEx("playertutfinish", 30000, false, "i", playerid);
	    		tutpart = 1;
	    	}
	    	if(tutpart == 1)
		    {
				SetPlayerCameraPos(playerid, 1516.8138, -1637.0669, 14.0503);
				SetPlayerCameraLookAt(playerid, 1515.8191, -1637.1910, 14.2505);
				SendClientMessage(playerid, COLOR_WHITE, "What is metagaming?");
				SendClientMessage(playerid, COLOR_WHITE, "Metagaming is mixing IC and OOC information.");
				SendClientMessage(playerid, COLOR_WHITE, "First, what is IC and OOC.");
				SendClientMessage(playerid, COLOR_WHITE, "IC stands for In Character. So that’s the drug dealer we were talking about earlier.");
				SendClientMessage(playerid, COLOR_WHITE, "OOC stands for Out Of Character. That’s you, the man behind the computer basically.");
				SendClientMessage(playerid, COLOR_WHITE, "So mixing IC and OOC info is called metagaming. An example:");
				SendClientMessage(playerid, COLOR_WHITE, "");
				SendClientMessage(playerid, COLOR_WHITE, "You see a guy, with some text above his head. Jason_Mendez (31)");
				SendClientMessage(playerid, COLOR_WHITE, "So, now you know you see a guy called Jason, and he has ID 31. This info is OOC, since people don’t");
				SendClientMessage(playerid, COLOR_WHITE, "have their names above their head in real life.");
				SendClientMessage(playerid, COLOR_WHITE, "So if you talk to the man, you will say: ‘Hey man, what’s your name?’");
				SendClientMessage(playerid, COLOR_WHITE, "Saying stuff like: ‘Hey Jason!’ is metagaming. You don’t know his name.");
			   	TogglePlayerControllable(playerid, 0); //
			    SetTimerEx("playertutfinish", 25000, false, "i", playerid);
			    tutpart = 2;
			}
			if(tutpart == 2)
		    {
				SetPlayerCameraPos(playerid, 1241.6555, -1396.2627, 13.6066);
				SetPlayerCameraLookAt(playerid, 1241.2216, -1395.3585, 13.8616);
				SendClientMessage(playerid, COLOR_WHITE, "What is Powergaming?");
				SendClientMessage(playerid, COLOR_WHITE, "Powergaming is doing unrealistic actions. Like: /me takes his superman suit and flies to the moon.");
				SendClientMessage(playerid, COLOR_WHITE, "This is not realistic, and considered as powergaming. Powergaming is NOT allowed.");
				SendClientMessage(playerid, COLOR_WHITE, "Powergaming is also forcing somebody to do something. It’s hard to explain, but some examples will do.");
				SendClientMessage(playerid, COLOR_WHITE, "Imagine, you are arguing with somebody. Then you decide that you are going to use a /me command.");
				SendClientMessage(playerid, COLOR_WHITE, "");
				SendClientMessage(playerid, COLOR_WHITE, "Example: /me takes a plastic bag, pulls it over Who_Ever’s head and kills him.");
				SendClientMessage(playerid, COLOR_WHITE, "This is powergaming. You are forcing the player to kill himself.");
				SendClientMessage(playerid, COLOR_WHITE, "If the player won’t kill himself, the RolePlay is messed up.");
				SendClientMessage(playerid, COLOR_WHITE, "So, never force people to kill themselves.");
				TogglePlayerControllable(playerid, 0); //
	    		SetTimerEx("playertutfinish", 30000, false, "i", playerid);
			}
	 	}
	}
	else
	{
		SpawnPlayer(playerid);
	}
	return false;
}



Re: Tutorial system - [MM]RoXoR[FS] - 27.06.2012

Just put that code after player login's.


Re: Tutorial system - kepa333 - 27.06.2012

i want to do this after login,register system...


Re: Tutorial system - kepa333 - 28.06.2012

bump