Get information before spawn?
#1

Hey guys,
I wonder if we can get a information into the playerfile into the OnGamemodeinit, before spawning.

I did :
Код:
new idskin = PlayerInfo[playerid][skin];
	AddPlayerClass(idskin,1552.5618,-1675.3375,16.1953,269.1425,0,0,0,300,-1,-1);
But, playerid isn't defined.
Any ideas?
Reply
#2

pawn Код:
public OnPlayerConnect(playerid)
{
  // Get player data here and save it to PlayerInfo[playerid][skin]
}

public OnPlayerSpawn(playerid)
{
  SetPlayerSkin(PlayerInfo[playerid][skin]);

  return 1;
}
Reply
#3

Thanks, but it's not what i'm searching for.
I want to change the skin chooser in function of playerskin.
( a cop will have for exemple a cop displayed and a civil his skin)
Reply
#4

I see, the only way I know how to do that would be to make a custom class selection. Make 3 fake AddPlayerClasses, then you can use SetPlayerSkin + SetSpawnInfo on the player when they're in class selection using OnPlayerRequestClass (the 3 classes are for detecting left, right using the classid in this callback). I hope this helps somewhat .
Reply
#5

Okay, i will try, thank you buddy
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)