[HELP] College system
#1

Hello everybody, good night,

I'm having a problem in a system of college where I quote below:

to the system would work as follows:
the player would type "/study" (estudar) and then he would hold two minutes to earn a point, and every 5 points he would earn a college level.



Quote:

//top
#include a_samp //As includes, senгo tiver baixe...
#include <dutils>
#include <dudb>

new file[128];

new LevelFaculdade[MAX_PLAYERS];
new PontosFaculdade[MAX_PLAYERS];
forward Estudando(playerid);

//Onplayerconnect
if(!fexist(file))
{
dini_Create(file);
dini_IntSet(file,"Faculdade", 0);

}
else if(fexist(file))
{
LevelFaculdade(playerid, dini_Int(file, "Faculdade"));
return 1;
}

//OnPlayerDisconnect
new pName[MAX_PLAYER_NAME], tmp[128], arquivo[128];
GetPlayerName(playerid, pName, sizeof(pName));
format(arquivo, sizeof(arquivo), "%s.cfg", pName);
dini_IntSet(arquivo, "Faculdade", LevelFaculdade(playerid));

//OnPlayerCommandText.
if (strcmp("/estudar", cmdtext, true, 10) == 0)
{
SetTimer("Estudando",120000,false);
TogglePlayerControllable(playerid,false);
GameTextForPlayer(playerid,"~w~Estudando",600000,1 );
return 1;
}

//End.
public Estudando(playerid)
{
if(PontosFaculdade[playerid] == 5)
{
LevelFaculdade[playerid]++;
PontosFaculdade[playerid] = 0;
SendClientMessage(playerid,COR_AQUI,"parabens vocк ganhou um level de Faculdade");
TogglePlayerControllable(playerid,false);
}
else
PontosFaculdade[playerid]++;
SendClientMessage(playerid,COR_AQUI,"Vocк ganhou um Ponto na Faculdade!");

}

and wondered if someone helps me solve the following errors:
Quote:
3149 : error 012: invalid function call, not a valid address
3149 : warning 215: expression has no effect
3797 : error 001: expected token: ";", but found ")"
3797 : error 029: invalid expression, assumed zero
3797 : fatal error 107: too many error messages on one line

Legend:
Quote:
>3149< LevelFaculdade(playerid, dini_Int(file, "Faculdade"));
>3797< dini_IntSet(arquivo, "Faculdade", LevelFaculdade(playerid));

I would like to solve them,
and since my thanks already.
Reply
#2

maybe:
Quote:

dini_IntSet(arquivo, "Faculdade", LevelFaculdade(playerid);

because it says he wanted to find ; and not )
Reply
#3

I dont really know how to fix it, but I did notice something:

its
pawn Код:
#include <a_samp> //As includes, senгo tiver baixe...
not

pawn Код:
#include a_samp //As includes, senгo tiver baixe...
Also its

pawn Код:
TogglePlayerControllable(playerid,0);
and not

pawn Код:
TogglePlayerControllable(playerid,false);
Try fixing those 2 things.
Reply
#4

I think it should be like this: (It has been a while since I used dini )
pawn Код:
//Line 3149:
LevelFaculdade[playerid] = dini_Int(file, "Faculdade");

//Line 3797:
dini_IntSet(arquivo, "Faculdade", LevelFaculdade[playerid]);
Reply
#5

Quote:
Originally Posted by alpha500delta
Посмотреть сообщение
Also its

pawn Код:
TogglePlayerControllable(playerid,0);
and not

pawn Код:
TogglePlayerControllable(playerid,false);
Try fixing those 2 things.
No, you can write either 0 or false, it will not make a difference.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)