SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 03/07/2017, 03:30 PM   #1
Nykal
Little Clucker
 
Join Date: Jan 2017
Posts: 3
Reputation: 0
Default Multiple classes in OnPlayerRequestClass

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.
Nykal is offline   Reply With Quote
Old 03/07/2017, 03:34 PM   #2
Whatname
Big Clucker
 
Join Date: Aug 2016
Posts: 178
Reputation: 12
Default Re: Multiple classes in OnPlayerRequestClass

PHP Code:
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

Whatname is offline   Reply With Quote
Old 03/07/2017, 04:07 PM   #3
Nykal
Little Clucker
 
Join Date: Jan 2017
Posts: 3
Reputation: 0
Default Re: Multiple classes in OnPlayerRequestClass

Thank you! I knew that I needed a switch but didn't know how to write one.
Nykal is offline   Reply With Quote
Old 03/07/2017, 05:21 PM   #4
Nykal
Little Clucker
 
Join Date: Jan 2017
Posts: 3
Reputation: 0
Default Re: Multiple classes in OnPlayerRequestClass

The default case is causing me a problem. I can't compile, I get error 029: invalid expression, assumed zero.
Nykal is offline   Reply With Quote
Old 03/07/2017, 05:28 PM   #5
Whatname
Big Clucker
 
Join Date: Aug 2016
Posts: 178
Reputation: 12
Default Re: Multiple classes in OnPlayerRequestClass

ohh my bad

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

PHP Code:
default: SetPlayerPos(playeridxyz); //if neither set other pos 
Whatname is offline   Reply With Quote
Old 03/07/2017, 05:29 PM   #6
nG Inverse
Big Clucker
 
Join Date: Feb 2012
Posts: 58
Reputation: 34
Default Re: Multiple classes in OnPlayerRequestClass

Remove the 'case' keyword from that line.
nG Inverse is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add job classes best way? Robis13 Server Support 0 25/02/2014 09:38 PM
Switching classes OnPlayerRequestClass Darth1993 Scripting Help 1 02/04/2013 12:13 PM
Locking some classes locks ALL classes thefatshizms Scripting Help 0 11/08/2012 11:00 PM
multiple servers with multiple ips on linux yakuzza Server Support 2 09/10/2010 08:08 PM
Multiple angles on onplayerrequestclass? WillyP Help Archive 8 10/08/2010 07:06 PM


All times are GMT. The time now is 11:45 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.