SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 14/12/2012, 05:44 PM   #1
Lz
Big Clucker
 
Join Date: Nov 2012
Location: United Kingdom
Posts: 134
Reputation: 6
Default Enum to check another enum?

Hey guys, im trying to create a faction enum that will be readable from my playerinfo enum... Im not sure if thats possible? well basically heres what im trying to do..

pawn Code:
enum pFactions
{
    SAPD,
    GOV
}


enum pInfo
{
    pPass,
    pCash,
    Float:pPos[3],
                      pFactions,
    pAdmin,
    pKills,
    pDeaths
}

pFactions is loose so you can see what im trying to do..
So basically i want the pInfo enum to check the values of the pFaction variables..

Im pretty new to scripting so im not sure, Is this the best way to create factions?
Lz is offline   Reply With Quote
Old 14/12/2012, 05:46 PM   #2
dr.lozer
Huge Clucker
 
dr.lozer's Avatar
 
Join Date: Oct 2012
Location: Home
Posts: 367
Reputation: 31
Default Re: Enum to check another enum?

Why dont you simply make in 1 enum
__________________
Future Community
ZM-IP: 5.175.145.69:7771
RP-IP: 67.207.208.25:7860
Website: www.F-Community.tk
dr.lozer is offline   Reply With Quote
Old 14/12/2012, 05:49 PM   #3
Lz
Big Clucker
 
Join Date: Nov 2012
Location: United Kingdom
Posts: 134
Reputation: 6
Default Re: Enum to check another enum?

Quote:
Originally Posted by dr.lozer View Post
Why dont you simply make in 1 enum
You mean like?
pawn Code:
enum pInfo
{
    pPass,
    pCash,
    Float:pPos[3],
    pAdmin,
                       fSAPD,
                       fGOV,
    pKills,
    pDeaths
}

Like that?
Lz is offline   Reply With Quote
Old 14/12/2012, 05:56 PM   #4
Lordzy
High-roller
 
Lordzy's Avatar
 
Join Date: Mar 2012
Location: NetherRealm
Posts: 2,701
Reputation: 1177
Default Re: Enum to check another enum?

If it's for player, you can create a variable executing the enum info under the enum.
pawn Code:
new PlayerInfo[MAX_PLAYERS][pInfo];

Now the enum can be used as : PlayerInfo[playerid][pPass] etc.
__________________
Currently inactive - I don't play at any SA-MP servers nor work on anything in PAWN for now. The projects that I've done so far in PAWN, which requires updates will be taking some time.
Lordzy is offline   Reply With Quote
Old 14/12/2012, 06:05 PM   #5
Lz
Big Clucker
 
Join Date: Nov 2012
Location: United Kingdom
Posts: 134
Reputation: 6
Default Re: Enum to check another enum?

Quote:
Originally Posted by Lordz™ View Post
If it's for player, you can create a variable executing the enum info under the enum.
pawn Code:
new PlayerInfo[MAX_PLAYERS][pInfo];

Now the enum can be used as : PlayerInfo[playerid][pPass] etc.
Yea thats kinda what i had before on my first faction attempt but i didn't think it looked.. well.. "professional"? As i would have all the factions and their ranks in the user file would just look like

Pass = ********
Cash = 13434
x = 123123.3434
y = 3535.6456
z = 12.3
Admin = 0
Kills = 9
Deaths = 12
SAPD = 4
GOV = 0
HITMAN = 0
FBI = 0

etc if that makes sence?
Lz is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Check from a enum Lz Scripting Help 2 08/12/2012 06:03 PM
Using Enum ... Healian Scripting Help 3 17/08/2012 12:28 AM
Enum Mento Scripting Help 6 07/05/2012 10:29 AM


All times are GMT. The time now is 03:22 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.