What's the interest to do this ?
#1

Hi,

All is in the title

Код:
	PlayerInfo[playerid][pHouseX] = 0;
	PlayerInfo[playerid][pHouseY] = 0;
	PlayerInfo[playerid][pHouseZ] = 0;
	PlayerInfo[playerid][pHouseVW] = 0;
	PlayerInfo[playerid][pHouseIntX] = 0;
	PlayerInfo[playerid][pHouseIntY] = 0;
	PlayerInfo[playerid][pHouseIntZ] = 0;
	PlayerInfo[playerid][pHouseInt] = 0;
	PlayerInfo[playerid][pHouseCarX] = 0;
	PlayerInfo[playerid][pHouseCarY] = 0;
	PlayerInfo[playerid][pHouseCarZ] = 0;
	PlayerInfo[playerid][pHouseCarAngle] = 0;
	PlayerInfo[playerid][pHouseCarId] = 0;
	PlayerInfo[playerid][pHouseCarLocked] = 0;
	PlayerInfo[playerid][pHouseCarColorChosen] = 0;
	PlayerInfo[playerid][pHouseCarColor1] = 0;
	PlayerInfo[playerid][pHouseCarColor2] = 0;
	PlayerInfo[playerid][pHouseLevel] = 0;
	PlayerInfo[playerid][pHouseSpawn] = 0;
 	PlayerInfo[playerid][pGotEntrance] = 0;
	PlayerInfo[playerid][pGotCar] = 0;
	PlayerInfo[playerid][pOwnsHouse] = 0;
	PlayerInfo[playerid][pEnterHouse] = 0;
	PlayerInfo[playerid][pMakingHouse] = 0;
With this for example, what's the interest to put it in OnPlayerConnect ?
Thank you
Reply
#2

What are you asking us?
Reply
#3

With this for example, what's the interest to put it in OnPlayerConnect ?

What's the interest to set the value to 0 when a player connect, then load it after ?
Reply
#4

It resets the variables to 0 for newly-connecting players. If you didn't do this, you may end up having the variable from the player who left who had the same ID, for example if you had a variable for someone's admin level, and someone was level 10, when the left, and someone else joined with the same ID, they would be admin level 10. This is a bad example, but it's the general idea.
Reply
#5

Oh, Okay thank you ! +Rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)