[HELP] With OnPlayerRequestClass <----
#1

Код:
public OnPlayerRequestClass(playerid, classid)
{
    new file[128], pname[MAX_PLAYER_NAME];
    if(!dini_Exists(file))
    {
   	TogglePlayerSpectating(playerid,0);
    SpawnPlayer(playerid);
	}
	else
    format(file, sizeof(file), "\\Positions\\%s.ini", pname);//leader the name of your folder in scriptfiles
	SetPlayerPos(playerid,508.7362,-87.4335,998.9609);
	SetPlayerFacingAngle(playerid,0.0);
	SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609);
	SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609);
	return 1;
}
i want this code to skip skin selection if the file exists, but it isn't doing so
Reply
#2

Use this before spawnplayer,
pawn Код:
SetSpawnInfo(playerid, NO_TEAM, 0, 0.0 , 0.0, 0.0, 0.0,-1,-1,-1,-1,-1,-1);
You'll need to set the co-ords, skin and wepons right or set position in OnPlayerSpawn. (works good for me)

EDIT: Just seen your other post, don't toggle the player spectating the spawn them that won't work. You can use TogglePlayerSpectating to remove the class select arrow <> spawn dialog.
Reply
#3

Doesn't work. my camera is static, and i see myself fall.
Reply
#4

You need to change the co-ordinates on the code i posted. And it does work trust me. Don't TogglePlayerSpectating.
Reply
#5

can i use SetPlayerPos instead of SetSpawnInfo ?
Reply
#6

Anyways i tried without TogglePlayerSpectating, same thing, can't even choose skins if the file doesn't exist
Reply
#7

As far as i know, no. Its only worked for me with SetSpawnInfo. You could then set the players position in OnPlayerSpawn. You will also need to check if a player has spawned once since they logged in and set a variable saying they have. Then use that variable inside On PlayerRequestClass so it doesnt bypass class select if a player preses f4.

EDIT: @ your last post. Well i'm stumped it works like a treat for me.
Reply
#8

any help with the variables? edit my code? im kinda noobish
Reply
#9

Or also i wouldn't mind all players selecting skins, but only the unregistered ones getting what they chosen and the registered spawn and get their previous skin
Reply
#10

Did you realise the array "file" is empty (i only just did) so the conditional will always return true. (!)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)