PDA

View Full Version : Multiple classes in OnPlayerRequestClass


Nykal
03/07/2017, 03:30 PM
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.

Whatname
03/07/2017, 03:34 PM
switch(classid)
{
case 0: SetPlayerPos(playerid, x, y, z); //the first skin if cj set in cj house if ryder in ryder's house
case 1: SetPlayerPos(playerid, x, y, z); //the second skin if cj set in cj house if ryder in ryder's house
case default: SetPlayerPos(playerid, x, y, z); //if neither set other pos
}

Nykal
03/07/2017, 04:07 PM
Thank you! I knew that I needed a switch but didn't know how to write one.

Nykal
03/07/2017, 05:21 PM
The default case is causing me a problem. I can't compile, I get error 029: invalid expression, assumed zero.

Whatname
03/07/2017, 05:28 PM
ohh my bad


case default: SetPlayerPos(playerid, x, y, z); //if neither set other pos


to


default: SetPlayerPos(playerid, x, y, z); //if neither set other pos

nG Inverse
03/07/2017, 05:29 PM
Remove the 'case' keyword from that line.