PlayerClass and SQLQuery problem

Started by AroliS^, Nov 11, 2018, 04:55 AM

Previous topic - Next topic

AroliS^

so, my problem is the next one, blank server.
i already maked my playerclass,
and did my first class to try it



but my playerclass is not recognized




same happened with my SQLQuery isn't recognized what can i do??
function tablescreator()
{
QuerySQL( db, blah blah)");
}
Lemme love ya

Mötley

Account <- array(GetMaxPlayers());

class PlayerClass {
  battle = false;
}

function onPlayerJoin(player) {
  Account[player.ID] = PlayerClass();
}

function onPlayerPart(player, reason) {
  Account[player.ID] = null;
}

Not tested, assuming it's the right syntax. You should be good to go.

Ehh since you only have one post and your using the usual playerclass name from fuzzie.

Usage:
Account[player.ID].battle = false;

AroliS^

same problem, playerclass isn't recognized
Lemme love ya

Mötley

You must be doing something wrong.. Did you use the two examples on the events above?

Make sure there all running on the same vm, it won't work on two separate scripts without something like dofile. Also like the two examples, make sure you don't have double events going on, an example:

function onPlayerJoin(player) {
  MessagePlayer("Welcome to the server", player);
}

function onPlayerJoin(player) {
  Account[player.ID] = PlayerClass();
}
Doing so and for instance the second one will not get called, only way would be if there on a separate vm in this case

D4rkR420R

Let's see your onPlayerSpawn function.

AroliS^

this is what i have in my playerspawn



Motley i else have just two and it doesnt work!!
Lemme love ya

Kelvin Garcia Mendoza

#6
Quote from: AroliS^ on Nov 11, 2018, 05:44 PMthis is what i have in my playerspawn



Motley i else have just two and it doesnt work!!

Debes tener algo asi en los siguientes 'events':

En onScriptLoad()
pstatus <- array( GetMaxPlayers(), null );
En onPlayerJoin( player )
pstatus[ player.ID ] = PlayerClass();
Y en onPlayerPart( player, reason )
pstatus[ player.ID ] = null;
Y la 'class' obviamente también tiene que estar creada.
Más o menos como te lo explicó @Motley

Si aún nada de esto funciona deberías asegurarte que tu servidor tiene todos los plugins necesarios (también revisa server.cfg).

D4rkR420R

Quote from: =TRC=Kelvin on Nov 11, 2018, 07:41 PM
Quote from: AroliS^ on Nov 11, 2018, 05:44 PMthis is what i have in my playerspawn



Motley i else have just two and it doesnt work!!

Debes tener algo asi en los siguientes 'events':

En onScriptLoad()
pstatus <- array( GetMaxPlayers(), null );
En onPlayerJoin( player )
pstatus[ player.ID ] = PlayerClass();
Y en onPlayerPart( player, reason )
pstatus[ player.ID ] = null;
Y la 'class' obviamente también tiene que estar creada.
Más o menos como te lo explicó @Motley

Si aún nada de esto funciona deberías asegurarte que tu servidor tiene todos los plugins necesarios (también revisa server.cfg).

Como cres el te va entender? How do you think he'll understand you? :c

AroliS^

#8
it is working, thank u so much to you guys xd :D
Lemme love ya