Dini and array
#1

Hey! I have a job drug smuggler and I want to create that after you are done with your work, you wil have to wait 2 minutes to do it again, and time will be saved in your account. This is part of my command:
Код:
enum
        pinfo
{
   pSmugglerWait
}

if( (gettime()- pSmugglerWait[playerid]) > 120 )    // error here
	{
                .
                . 
                .
                pSmugglerWait[playerid] = gettime();
        }
And after I try to compile, I get this error:
invalid subscript (not an array or too many subscripts): "pSmugglerWait"
So I guess my variable pSmugglerWait has to be array, I know how to create it buy I dont know how to set so array will be saved to user account using dini. Please help me.
Reply
#2

pawn Код:
enum
        pinfo
{
   pSmugglerWait
}
new playerINFO[MAX_PLAYERS][pinfo];
if( (gettime()- playerINFO[playerid][pSmugglerWait]) > 120 )    // error here
    {
                .
                .
                .
                playerINFO[playerid][pSmugglerWait] = gettime();
        }
I am comfortable using named enums, so try this?
Now you can just write dini_writeINT to write into the files, since it's just an integer.
Reply
#3

nice, thank you Rajat
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)