SA-MP Forums Archive
How might i go about doing this?(player classes) - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How might i go about doing this?(player classes) (/showthread.php?tid=162005)



How might i go about doing this?(player classes) - CSMajor - 21.07.2010

Ok iv been trying for the past 4 days to make a player selection screen that shows the players for one. and when you change the player selection it shows the location you put in the addplayerclass function. so if i put one at union station and another at ls skate park. it would show them both at those corresponding location.


Re: How might i go about doing this?(player classes) - MisterTickle - 22.07.2010

This is an example where if the first 3 classes we're Grove Street and the next 3 we're FBI

Код:
public OnPlayerRequestClass(playerid, classid)
{
    if(classid == 0 || classid == 1 || classid == 2)
	{
		GameTextForPlayer(playerid, "~b~Grove Stret", 3000, 3);
		SetPlayerInterior(playerid, 1);
	 	SetPlayerPos(playerid, 214.7581,-41.0411,1002.0234);
	    SetPlayerFacingAngle(playerid, 94.0821);
	    SetPlayerCameraPos(playerid, 212.6498,-41.0299,1002.0234);
        SetPlayerCameraLookAt(playerid, 214.7581,-41.0411,1002.0234);
	}
	else if(classid == 3 || classid == 4 || classid == 5)
	{
		GameTextForPlayer(playerid, "~b~FBI", 3000, 3);
		SetPlayerInterior(playerid, 1);
	 	SetPlayerPos(playerid, 214.7581,-41.0411,1002.0234);
	    SetPlayerFacingAngle(playerid, 94.0821);
	    SetPlayerCameraPos(playerid, 212.6498,-41.0299,1002.0234);
        SetPlayerCameraLookAt(playerid, 214.7581,-41.0411,1002.0234);
	return true;
}



Re: How might i go about doing this?(player classes) - CSMajor - 22.07.2010

Quote:
Originally Posted by MisterTickle
Посмотреть сообщение
This is an example where if the first 3 classes we're Grove Street and the next 3 we're FBI

Код:
public OnPlayerRequestClass(playerid, classid)
{
    if(classid == 0 || classid == 1 || classid == 2)
	{
		GameTextForPlayer(playerid, "~b~Grove Stret", 3000, 3);
		SetPlayerInterior(playerid, 1);
	 	SetPlayerPos(playerid, 214.7581,-41.0411,1002.0234);
	    SetPlayerFacingAngle(playerid, 94.0821);
	    SetPlayerCameraPos(playerid, 212.6498,-41.0299,1002.0234);
        SetPlayerCameraLookAt(playerid, 214.7581,-41.0411,1002.0234);
	}
	else if(classid == 3 || classid == 4 || classid == 5)
	{
		GameTextForPlayer(playerid, "~b~FBI", 3000, 3);
		SetPlayerInterior(playerid, 1);
	 	SetPlayerPos(playerid, 214.7581,-41.0411,1002.0234);
	    SetPlayerFacingAngle(playerid, 94.0821);
	    SetPlayerCameraPos(playerid, 212.6498,-41.0299,1002.0234);
        SetPlayerCameraLookAt(playerid, 214.7581,-41.0411,1002.0234);
	return true;
}
so i would just go about doing this with an if statement?


Re: How might i go about doing this?(player classes) - CSMajor - 22.07.2010

and what does the
Код:
||
do ?


Re: How might i go about doing this?(player classes) - MisterTickle - 22.07.2010

Yeah like if the 20th class ID was police you'd do if(classid == 21) (Due to 0 being SAMP's default) and || is or so if you have multiple skins that are grove street instead of spamming IF statements you put em all on one line.


Re: How might i go about doing this?(player classes) - CSMajor - 22.07.2010

ok well i did this :
Код:
public OnPlayerRequestClass(playerid, classid)
{
	if(classid == 152 || classid == 167 || classid == 151 || classid == 158 || classid == 102 || classid == 123)
	{
	GameTextForAll("House Spawn",3000,3);
	SetPlayerPos(playerid,1231.7922,-810.8955,87.7598);
	SetPlayerFacingAngle(playerid,1.1316);
	SetPlayerCameraPos(playerid,1230.7089,-805.5256,88.3745);
	SetPlayerCameraLookAt(playerid,1230.7922,-810.8955,87.7598);
	return 1;
	}
	else if (classid == 155 || classid == 159 || classid == 106 || classid == 189 || classid == 111 || classid == 145 || classid == 178 || classid == 198)
	{
	GameTextForAll("AirportSpawn",3000,3);
	SetPlayerPos(playerid,1231.7922,-810.8955,87.7598);
	SetPlayerFacingAngle(playerid,1.1316);
	SetPlayerCameraPos(playerid,1230.7089,-805.5256,88.3745);
	SetPlayerCameraLookAt(playerid,1230.7922,-810.8955,87.7598);
	return 1;
	}
	return true;
}
but it doesnt show the characters model, let alone the location of them.


Re: How might i go about doing this?(player classes) - MisterTickle - 22.07.2010

No, Its not the skin.

For example, The first AddPlayerClass is 0

So lets say I have 5 AddPlayerClass on the top of my gamemode, The last one would be 4 and the first one would be 5

https://sampwiki.blast.hk/wiki/AddPlayerClass

When you add a class, It increases the number up by 1. I'm probably explaining it odd but, It confuses me myself the way I explain it.


Re: How might i go about doing this?(player classes) - CSMajor - 22.07.2010

Quote:
Originally Posted by MisterTickle
Посмотреть сообщение
No, Its not the skin.

For example, The first AddPlayerClass is 0

So lets say I have 5 AddPlayerClass on the top of my gamemode, The last one would be 4 and the first one would be 5

https://sampwiki.blast.hk/wiki/AddPlayerClass

When you add a class, It increases the number up by 1. I'm probably explaining it odd but, It confuses me myself the way I explain it.
ill go thorugh and replace that, and ill ge tback to you.


Re: How might i go about doing this?(player classes) - CSMajor - 22.07.2010

ok umm i have a problem. because my clases are not in order......


Re: How might i go about doing this?(player classes) - MisterTickle - 22.07.2010

I mean you could test it with doing

new skin = GetPlayerSkin(playerid);

Than replacing class id with skin like you did it above, I mean it should work.