Combaining Regullar enum's with pVar's
#1

My Logic:
- enumerating some Variable's & using 'PVar' for easy resetting

Код:
enum PLAYER_DATA
{
   Logged,
   Regged,
   SQLID,
   Name[MAX_PLAYER_NAME],
   Password[WHIRLPOOL_LEN],
   Ip[16 + 1],
}
new Player[MAX_PLAYERS][PLAYER_DATA];

...

public OnPlayerConnect(playerid)
{
   Player[playerid][Logged] = 0;
   Player[playerid][Regged] = 0;
	
   SetPVarInt(playerid, "Logged", Player[playerid][Logged]);
   SetPVarInt(playerid, "Regged", Player[playerid][Regged]);
   return 0;
}
Notice: i'm loading this in a filterscript so i returned 0. GM is empty for testing purpose

will this make sense? can you show me some advice
Reply
#2

Read note https://sampwiki.blast.hk/wiki/SetPVarInt
Reply
#3

Well you shouldn't need to use pvars unless it makes sense and it doesn't make sense here. However I kind of see where you are coming from when it comes to resetting.

It gives me an idea to create an include that allows you to define self resetting variables with or without enums.
Reply
#4

Quote:
Originally Posted by Pottus
Посмотреть сообщение
Well you shouldn't need to use pvars unless it makes sense and it doesn't make sense here. However I kind of see where you are coming from when it comes to resetting.

It gives me an idea to create an include that allows you to define self resetting variables with or without enums.
Are you making me stupid? , its been a long time since i left my projects way behind schedule, cuz of my work, in-fact i found free time to try something new, i know the code wont magically just make miracles. So im just trying things myway.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)