Random Spawn Angle Help.
#1

The random spawn works fine so the player spawns randomly at the 5 co-ords.

The problem is that it doesnt let me put in an angle which is annoying as the player never faces the way i want them to.

Код:
public OnPlayerSpawn(playerid)
{
  new rand;
	rand = random(5);
	rand++; 
	switch(rand)
	{
		case 1: SetPlayerPos(playerid, 376.9032,2542.1309,16.5391);
		case 2: SetPlayerPos(playerid, 380.9595,2537.2759,16.5391);
		case 3: SetPlayerPos(playerid, 384.3665,2541.9971,16.5391);
		case 4: SetPlayerPos(playerid, 386.7451,2536.4331,16.5391);
		case 5: SetPlayerPos(playerid, 388.9255,2544.3674,16.5391);
	}
	return 1;
}
Reply
#2

SetPlayerFacingAngle

pawn Код:
public OnPlayerSpawn(playerid)
{
  new rand;
    rand = random(5);
    rand++;
    switch(rand)
    {
        case 1: { SetPlayerPos(playerid, 376.9032,2542.1309,16.5391); SetPlayerFacingAngle(playerid, Float:angle); }
        case 2: { SetPlayerPos(playerid, 380.9595,2537.2759,16.5391); SetPlayerFacingAngle(playerid, Float:angle); }
        case 3: { SetPlayerPos(playerid, 384.3665,2541.9971,16.5391); SetPlayerFacingAngle(playerid, Float:angle); }
        case 4: { SetPlayerPos(playerid, 386.7451,2536.4331,16.5391); SetPlayerFacingAngle(playerid, Float:angle); }
        case 5: { SetPlayerPos(playerid, 388.9255,2544.3674,16.5391); SetPlayerFacingAngle(playerid, Float:angle); }
    }
    return 1;
}
Reply
#3

wouldn't it be randon(4)? Not 5?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)