Level Problem!

Started by W3aPoN^, Jul 27, 2016, 03:28 PM

Previous topic - Next topic

W3aPoN^

Hello Guys I Want To Make Player Levels In VCMP 0.4 Server How Can I Do It?

vito

function onScriptLoad(){
  player_data_fill <- {"level" : 0;}; // usually for this vc-mp coders using "class" though
  player_data <- array(GetMaxPlayers(), player_data_fill);
}
function onPlayerJoin(player){
  player_data[player.ID].level = 1;
}
function onPlayerPart(player, reason){
  player_data[player.ID] = player_data_fill;
}

MatheuS

this guy has not learned to use the forum and is posting in all the wrong places. ???
if( !sucess ) tryAgain();
Thanks to the VCMP community. It was the happiest period of my life.

Kewun

i told this nab to not usebig letters but he did it yet again and posted in wrong sections, go make it your self for atleast once

KAKAN

@vito, due to some problems, your code won't work. You can try it yourself though, the last time I tried it, it didn't work.
oh no

vito

#5
Quote from: KAKAN on Jul 29, 2016, 04:15 PM@vito, due to some problems, your code won't work. You can try it yourself though, the last time I tried it, it didn't work.
I forgot the syntax, sorry it was untested. ( ; after 0 - gets that error)

Correct one:
function onScriptLoad(){
  player_data_fill <- {
    "level" : 0
  }; // usually for this vc-mp coders using "class" though
  player_data <- array(GetMaxPlayers(), player_data_fill);
}
function onPlayerJoin(player){
  player_data[player.ID].level = 1;
}
function onPlayerPart(player, reason){
  player_data[player.ID] = player_data_fill;
}

KAKAN

Instead, why not use a class?
" usually for this vc-mp coders using "class" though" I can't understand that :(
oh no

vito

Quote from: KAKAN on Jul 29, 2016, 05:15 PMInstead, why not use a class?
" usually for this vc-mp coders using "class" though" I can't understand that :(
I don't like to use classes to as table.  If even no methods used there, why it should be class? It's just a table to store player's data.

W3aPoN^

Ok Thanks I used Fuzzie System v3 But It's Not Working Can You Tell Me? What Can I Do Brothers I Am A New Member In This Forum But I Created Some My Scripts But Dont Want To upload Them To Forum Thanks My Problem Tell Me What Can I DO?