SA-MP Forums Archive
Combaining Regullar enum's with pVar's - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Combaining Regullar enum's with pVar's (/showthread.php?tid=661170)



Combaining Regullar enum's with pVar's - Mobtiesgangsa - 25.11.2018

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


Re: Combaining Regullar enum's with pVar's - Jefff - 25.11.2018

Read note https://sampwiki.blast.hk/wiki/SetPVarInt


Re: Combaining Regullar enum's with pVar's - Pottus - 25.11.2018

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.


Re: Combaining Regullar enum's with pVar's - Mobtiesgangsa - 25.11.2018

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.