Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: [VSS]Shawn on Jul 10, 2015, 11:32 AM

Title: basics
Post by: [VSS]Shawn on Jul 10, 2015, 11:32 AM
well i have added this on my binfo
registered = false;
logged = false;

and add this on pickuppickup

if ( binfo[ player.ID ].logged == false ) msg

but when i pickup the pickup it say in console error index registered or logged does not exist why?
Title: Re: basics
Post by: . on Jul 10, 2015, 11:37 AM
What dafuq do you have in your eyes? Poop? When you pressed that NEW TOPIC button. Did you bother to look at what's below that button (http://forum.vc-mp.org/?topic=872.0)?
Title: Re: basics
Post by: [VSS]Shawn on Jul 10, 2015, 01:18 PM
so your mean i have to add sqlite04rel32 in server.cfg?
Title: Re: basics
Post by: jayant on Jul 10, 2015, 02:28 PM
No, he means,that you should check everything in your script that it actually exist or not..Maybe you will now understand what he & I meant to say..

class PlayerStats
{
 logged = false;
 registered = false;
 cash = 0;// u can add this
 level = 0;// u can add this, etc.
}

function onScriptLoad()
{
binfo <- array( GetMaxPlayers(), null );
}

function onPlayerJoin( player )
{
binfo[player.ID] = PlayerStats(); //Getting the things from class we have created
}
Now, with binfo array you can use your class anywhere in the script,in your own function, in any event with proper parameters..

> I am not good in explaning things.But it may help you.
Title: Re: basics
Post by: [VSS]Shawn on Jul 10, 2015, 05:42 PM
not working ???
Title: Re: basics
Post by: jayant on Jul 11, 2015, 12:11 PM
I only gave you an example of doing these things...The rest is upto you and your coding style.