SA-MP Forums Archive
Multiple classes in 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)
+--- Thread: Multiple classes in OnPlayerRequestClass (/showthread.php?tid=636745)



Multiple classes in OnPlayerRequestClass - Nykal - 03.07.2017

How do I place multiple classes in the OnPlayerRequestClass function?

For example, I want to make CJ spawn in front of his house and Ryder in front of his house.


Re: Multiple classes in OnPlayerRequestClass - Whatname - 03.07.2017

PHP код:
switch(classid)
{
      case 
0SetPlayerPos(playeridxyz); //the first skin if cj set in cj house if ryder in ryder's house
      
case 1SetPlayerPos(playeridxyz); //the second skin if cj set in cj house if ryder in ryder's house
      
case default: SetPlayerPos(playeridxyz); //if neither set other pos




Re: Multiple classes in OnPlayerRequestClass - Nykal - 03.07.2017

Thank you! I knew that I needed a switch but didn't know how to write one.


Re: Multiple classes in OnPlayerRequestClass - Nykal - 03.07.2017

The default case is causing me a problem. I can't compile, I get error 029: invalid expression, assumed zero.


Re: Multiple classes in OnPlayerRequestClass - Whatname - 03.07.2017

ohh my bad

PHP код:
case default: SetPlayerPos(playeridxyz); //if neither set other pos 
to

PHP код:
default: SetPlayerPos(playeridxyz); //if neither set other pos 



Re: Multiple classes in OnPlayerRequestClass - nG Inverse - 03.07.2017

Remove the 'case' keyword from that line.