[SOLVED] Diffrent camera areas for diffrent teams on OnPlayerRequestClass
#1

How do I make the Camera look in a diffrent area for each team

Here's an example, lets say someone scrolls to the triad team on OnPlayerRequestClass

It shows that area for that team..

Now lets say someone goes to the Cops team on OnPlayerRequestClass:


I know, I have to do:

SetPlayerPos(playerid,x,y,z);
SetPlayerCameraPos(playerid,x,y,z);
SetPlayerCameraLookAt(playerid,x,y,z);

for each team, but I don't know how to make it show as they scroll through the teams.. xD

Thanks
Reply
#2

under OnPlayerRequestClass:

pawn Код:
switch(classid)
{
   case 0:
   {
     //firstskin
   }
   case 1:
   {
     //secondskin
   }
}
Reply
#3

Thanks dude, I knew it had to be done with cases, but I was doing it with ifs and else ifs xD Thanks for reminding me
Reply
#4

but if you want to do a team so use gTeam
Reply
#5

Quote:
Originally Posted by nuriel8833
but if you want to do a team so use gTeam
case works better, and its easier.
Reply
#6

Quote:
Originally Posted by Zer0[x
]
Quote:
Originally Posted by nuriel8833
but if you want to do a team so use gTeam
case works better, and its easier.
but it is doing for only 1 skin.if he have like 5 groups of 5,he wont do 25 cases ><
Reply
#7

Quote:
Originally Posted by nuriel8833
Quote:
Originally Posted by Zer0[x
]
Quote:
Originally Posted by nuriel8833
but if you want to do a team so use gTeam
case works better, and its easier.
but it is doing for only 1 skin.if he have like 5 groups of 5,he wont do 25 cases ><
Works just fine on my server, test it out (in sig)
Reply
#8

use an array..

new Float:cams[][7] = {
{x,y,z,x,y,z,angle},
{x,y,z,x,y,z,angle},
{x,y,z,x,y,z,angle}
};

thats x y z for camera pos and x y z angle for where the person is at

each line is a skin

OnPlayerRequestClass:

SetCameraPos(playerid, cams[classid][0],cams[classid][1],cams[classid][2]);
SetCamerLookAt(playerid, cams[classid][3],cams[classid][4],cams[classid][5]);
SetPlayerPos(playerid, cams[classid][3],cams[classid][4],cams[classid][5]);
SetPlayerFacingAngle(playerid, cams[classid][6]);

should work untested
Reply
#9

Its solved already, sorry :P
Reply
#10

i know thats just easier than having 700 lines of code where you can have 200
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)