How might i go about doing this?(player classes)
#1

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.
Reply
#2

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;
}
Reply
#3

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?
Reply
#4

and what does the
Код:
||
do ?
Reply
#5

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.
Reply
#6

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.
Reply
#7

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.
Reply
#8

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.
Reply
#9

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)