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



[SOLVED] OnPlayerRequestClass - Fredden1993 - 29.08.2010

What have I done wrong, the skins keeps going over each other, for example, the civilian skins still displayed when the Police skins should be displayed... only some of them, maybe 2.

I have 211 Civilian skins, 7 Police skins and 2 Sheriff skins.

Here is what I'm using:

Код:
public OnPlayerRequestClass(playerid, classid)
{
    new string[256];
    SetPlayerColor(playerid, COLOR_GREY);
    
    if(classid >= 0 && classid <= 209)
    {
		format(string, sizeof(string), "~g~Civilians");
		GameTextForPlayer(playerid, string, 3000, 5);
		SetPlayerPos(playerid, 365.6577,173.8303,1008.3828);
		SetPlayerFacingAngle(playerid, 270.3640);
		SetPlayerCameraPos(playerid, 369.2415,173.8287,1008.3893);
		SetPlayerCameraLookAt(playerid, 365.6577,173.8303,1008.3828);
		SetPlayerInterior(playerid, 3);
		gTeam[playerid] = 1;
	}
 	if(classid >= 210 && classid <= 220)
    {
		format(string, sizeof(string), "~b~Police Department");
		GameTextForPlayer(playerid, string, 3000, 5);
		SetPlayerPos(playerid, 254.4077,75.5373,1003.6406);
		SetPlayerFacingAngle(playerid, 0.3134);
		SetPlayerCameraPos(playerid, 254.4405,79.5426,1003.6406);
		SetPlayerCameraLookAt(playerid, 254.4077,75.5373,1003.6406);
		SetPlayerInterior(playerid, 6);
		gTeam[playerid] = 2;
	}
	if(classid >= 221 && classid <= 222)
    {
		format(string, sizeof(string), "~b~Sheriffs Department");
		GameTextForPlayer(playerid, string, 3000, 5);
		SetPlayerPos(playerid, 325.5504,307.0217,999.1484);
		SetPlayerFacingAngle(playerid, 91.6178);
		SetPlayerCameraPos(playerid, 321.5965,306.9950,999.1484);
		SetPlayerCameraLookAt(playerid, 325.5504,307.0217,999.1484);
		SetPlayerInterior(playerid, 5);
		gTeam[playerid] = 3;
	}
	return 1;
}
All skins are added with AddPlayerClass.

Thanks


Re: [HELP] OnPlayerRequestClass - FireCat - 29.08.2010

like what happenes? i dont get your problem skins get over each other like i dont get it show us a image
_______________________
1-3$ fix warnings 1-5$fix errors
6-15$ make gamemodes(not roleplay) 3-10$ make filterscripts-scriptfiles
Dont ASK! me RolePlay questions
www.mefreeroam.tk



Re: [HELP] OnPlayerRequestClass - Fredden1993 - 29.08.2010

Quote:
Originally Posted by FireCat
Посмотреть сообщение
like what happenes? i dont get your problem skins get over each other like i dont get it show us a image
_______________________
1-3$ fix warnings 1-5$fix errors
6-15$ make gamemodes(not roleplay) 3-10$ make filterscripts-scriptfiles
Dont ASK! me RolePlay questions
www.mefreeroam.tk
Sure, stand-by...


Re: [HELP] OnPlayerRequestClass - iggy1 - 29.08.2010

hmm your using classid and not skinid thats probably why and your string is 256 cells big when it should only need like 50 max and thats if you make a faction thats name is 49 characters long (which is unlikely).


Re: [HELP] OnPlayerRequestClass - Fredden1993 - 29.08.2010



As you can see the civilian skins appears where the Police skins should be... and if I hit next the Police skins appear but too late if you know what I mean.


Re: [HELP] OnPlayerRequestClass - FireCat - 29.08.2010

well yeh iggy1 is right to many cells
_______________________
1-3$ fix warnings 1-5$fix errors
6-15$ make gamemodes(not roleplay) 3-10$ make filterscripts-scriptfiles
Dont ASK! me RolePlay questions
www.mefreeroam.tk



Re: [HELP] OnPlayerRequestClass - iggy1 - 29.08.2010

Use skinid not classid i dont think you understand classid. If the first class you put in your script is a copskin it's class 0.

EG,
pawn Код:
public OnGameModeInit()
{
   
    AddPlayerClass(210,1958.3783,1343.1572,15.3746,270.1425,0,0,24,300,-1,-1);//classid 0
    AddPlayerClass(266,1958.3783,1343.1572,15.3746,270.1425,0,0,24,300,-1,-1);//classid 1
    AddPlayerClass(267,1958.3783,1343.1572,15.3746,270.1425,0,0,24,300,-1,-1);//classid 2
    AddPlayerClass(268,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);//classid 3
    return 1;
}



Re: [HELP] OnPlayerRequestClass - Fredden1993 - 29.08.2010

Quote:
Originally Posted by iggy1
Посмотреть сообщение
Use skinid not classid i dont think you understand classid. If the first class you put in your script is a copskin it's class 0.

EG,
pawn Код:
public OnGameModeInit()
{
   
    AddPlayerClass(210,1958.3783,1343.1572,15.3746,270.1425,0,0,24,300,-1,-1);//classid 0
    AddPlayerClass(266,1958.3783,1343.1572,15.3746,270.1425,0,0,24,300,-1,-1);//classid 1
    AddPlayerClass(267,1958.3783,1343.1572,15.3746,270.1425,0,0,24,300,-1,-1);//classid 2
    AddPlayerClass(268,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);//classid 3
    return 1;
}
Alright, but I've never used skinid, I need the same system like this but how can I change it to skinid?


Re: [HELP] OnPlayerRequestClass - iggy1 - 29.08.2010

Im not sure it will work with skinid, it may tho. somethng like
pawn Код:
if(GetPlayerSkin(playerid) >= 0 && GetPlayerSkin(playerid)<= 209)
{
    format(string, sizeof(string), "~g~Civilians");
    GameTextForPlayer(playerid, string, 3000, 5);
    SetPlayerPos(playerid, 365.6577,173.8303,1008.3828);
    SetPlayerFacingAngle(playerid, 270.3640);
    SetPlayerCameraPos(playerid, 369.2415,173.8287,1008.3893);
    SetPlayerCameraLookAt(playerid, 365.6577,173.8303,1008.3828);
    SetPlayerInterior(playerid, 3);
    gTeam[playerid] = 1;
}
If that doesnt work then you will probably have to re-arrange the classes in your script.


Re: [HELP] OnPlayerRequestClass - Fredden1993 - 29.08.2010

Quote:
Originally Posted by iggy1
Посмотреть сообщение
Im not sure it will work with skinid, it may tho. somethng like
pawn Код:
if(GetPlayerSkin(playerid) >= 0 && GetPlayerSkin(playerid)<= 209)
{
    format(string, sizeof(string), "~g~Civilians");
    GameTextForPlayer(playerid, string, 3000, 5);
    SetPlayerPos(playerid, 365.6577,173.8303,1008.3828);
    SetPlayerFacingAngle(playerid, 270.3640);
    SetPlayerCameraPos(playerid, 369.2415,173.8287,1008.3893);
    SetPlayerCameraLookAt(playerid, 365.6577,173.8303,1008.3828);
    SetPlayerInterior(playerid, 3);
    gTeam[playerid] = 1;
}
If that doesnt work then you will probably have to re-arrange the classes in your script.
This dosn't work, well, it works the same as classid but this don't change the Camera views for PlayerPos and CameraPos ect... but I think thr skins fixed, but now I got that problem.