SA-MP Forums Archive
onplayerrequestclass .... :S - 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: onplayerrequestclass .... :S (/showthread.php?tid=186363)



onplayerrequestclass .... :S - WillyP - 28.10.2010

okay, so can you change the camera position whilst in request class?

such as if skinid = 2

it changes the camera position ect


Re: onplayerrequestclass .... :S - i514x - 28.10.2010

yes you can

pawn Код:
SetPlayerCameraLookAt(playerid, Float:x, Float:y, Float:z)



Re: onplayerrequestclass .... :S - Fj0rtizFredde - 28.10.2010

What do you mean? Something like this?
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    if(classid == 1)
    {
          //SetPlayerPos
         //SetPlayerCameraPos
        //SetPlayerCameraLookAt    
    }
    return 1;
}
you could also use a switch


Re: onplayerrequestclass .... :S - i514x - 28.10.2010

you're making it on every classid you should do it like that:

public OnPlayerRequestClass(playerid, classid)
{
switch(classid)
{
case 1:
{
//SetPlayerPos
//SetPlayerCameraPos
//SetPlayerCameraLookAt
}
case 2:
{
//SetPlayerPos
//SetPlayerCameraPos
//SetPlayerCameraLookAt
}
}
return 1;
}


Re: onplayerrequestclass .... :S - WillyP - 28.10.2010

Quote:
Originally Posted by i514x_
Посмотреть сообщение
you're making it on every classid you should do it like that:

public OnPlayerRequestClass(playerid, classid)
{
switch(classid)
{
case 1:
{
//SetPlayerPos
//SetPlayerCameraPos
//SetPlayerCameraLookAt
}
case 2:
{
//SetPlayerPos
//SetPlayerCameraPos
//SetPlayerCameraLookAt
}
}
return 1;
}
yeah thanks, but i got multiple skins i wish to use with one camera position, would i do something like

new skin[10]; < 10 skins in 1 position

but i dont know how to put that into a switch in one


Re: onplayerrequestclass .... :S - Fj0rtizFredde - 28.10.2010

Just do like
pawn Код:
//Blah
case 1,2,3,4,5,6:
{
    //SetCamera Stuff
}
case 7,8,9,25,68,66,150:
{
   //Insert cat food here!
}



Re: onplayerrequestclass .... :S - Nero_3D - 28.10.2010

Quote:
Originally Posted by Fj0rtizFredde
Посмотреть сообщение
Just do like
pawn Код:
case 1,2,3,4,5,6:
{
    //SetCamera Stuff
}
or

pawn Код:
case 1..6: {}



Re: onplayerrequestclass .... :S - WillyP - 28.10.2010

Quote:
Originally Posted by Fj0rtizFredde
Посмотреть сообщение
Just do like
pawn Код:
//Blah
case 1,2,3,4,5,6:
{
    //SetCamera Stuff
}
case 7,8,9,25,68,66,150:
{
   //Insert cat food here!
}
Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
or

pawn Код:
case 1..6: {}

thank you both