2019-04-18, 12:39 AM
(2019-04-18, 12:34 AM)hastlaking Wrote: example:
Code:enum E_ADMIN_DATA { ? ? ? e_admin_position_none = 0, ? ? ? e_admin_position_admin = 1 } enum E_PLAYER_DATA { ? ? ?e_id, ? ? ?e_name[MAX_PLAYER_NAME], ? ? ?E_ADMIN_DATA:e_admin, } new player[MAX_PLAYERS][E_PLAYER_DATA]; .... public OnPlayerConnect(playerid) { ? ? ?// will it be like so.....? ? ? ?player[playerid][e_admin] = E_ADMIN_DATA:e_admin_position_none; ? ? ?return 1; } RetrieveAdminLevel(playerid, E_ADMIN_DATA:level) { ? ? ? ?switch(level) { .... } ? ? ? ?return level; }
can any of the code i gave as an example will help distributing data into enums/arrays to its usage?
As far as I am aware what you are doing is perfectly acceptable. However you don't need to re-tag the assignment since both variables are already tagged with the same tag
so this
PHP Code:
player[playerid][e_admin] = E_ADMIN_DATA:e_admin_position_none;
can be just this
PHP Code:
player[playerid][e_admin] = e_admin_position_none;
this works because `e_admin_position_none` is already part of the enum `E_ADMIN_DATA` so already has the tag
and because you've declared the tag on `e_admin` inside the enum.
Remember to always refer to J0sh as `J0sh...`
# Services/Platforms
forum.open.mp (Forum Manager)
open.mp (Member)
Pawn Playground (Creator/Maintainer)
Pawn Packages (Creator/Maintainer)
# Services/Platforms
forum.open.mp (Forum Manager)
open.mp (Member)
Pawn Playground (Creator/Maintainer)
Pawn Packages (Creator/Maintainer)

