Need a bit help
#1

Код:
	if(strcmp(cmd, "/mystats", true) == 0)
	{
    if(logged[playerid] == 0) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You cannot use commands because you are not logged in.");
    else
    if(logged[playerid] == -2) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You cannot use commands because you are jailed.");
    else
	  format(string, sizeof(string), "Level: %d", dini_Int(udb_encode(playername), "adminlevel");
		SendClientMessage(playerid, COLOR_WHITE, string);
  return 1;
  }
It giving these errors ?
Код:
C:\Documents and Settings\Administrator\Desktop\gamemodes\lvdm.pwn(2475) : error 001: expected token: ",", but found ";"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
i tried my best but wasnt able to solve this bugs
Reply
#2

no one ?
Reply
#3

Try this. (Added brackets for else)

pawn Код:
if(strcmp(cmd, "/mystats", true) == 0)
    {
    if(logged[playerid] == 0) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You cannot use commands because you are not logged in.");
    else
    if(logged[playerid] == -2) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You cannot use commands because you are jailed.");
    else
    {
        format(string, sizeof(string), "Level: %d", dini_Int(udb_encode(playername), "adminlevel");
        SendClientMessage(playerid, COLOR_WHITE, string);

        format(string, sizeof(string), "Kills: %d", dini_Int(udb_encode(playername), "kills");
        SendClientMessage(playerid, COLOR_WHITE, string);

        format(string, sizeof(string), "Deaths: %d", dini_Int(udb_encode(playername), "deaths");
        SendClientMessage(playerid, COLOR_WHITE, string);
    }
Reply
#4

pawn Код:
new tmp[256],string[128];
tmp = dini_IntGet(udb_encode(PlayerName(playerid)), "whatuwant1");
format(string,128,"whatuwant1: %d",tmp);
SendClientMessage(playerid,color,string);
tmp = dini_IntGet(udb_encode(PlayerName(playerid)), "whatuwant2");
format(string,128,"whatuwant2: %d",tmp);
SendClientMessage(playerid,color,string);

stock dini_IntGet(filename[],slot[]){
    new tmp[256],value;
    tmp = dini_Get(filename, slot);
    value = strval(tmp);
    return value;
}
understood? :P
Reply
#5

I just noticed you got some brackets missing

pawn Код:
if(strcmp(cmd, "/mystats", true) == 0)
    {
    if(logged[playerid] == 0) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You cannot use commands because you are not logged in.");
    else
    if(logged[playerid] == -2) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You cannot use commands because you are jailed.");
    else
    {
        format(string, sizeof(string), "Level: %d", dini_Int(udb_encode(playername), "adminlevel")); // Here
        SendClientMessage(playerid, COLOR_WHITE, string);

        format(string, sizeof(string), "Kills: %d", dini_Int(udb_encode(playername), "kills")); // Here
        SendClientMessage(playerid, COLOR_WHITE, string);

        format(string, sizeof(string), "Deaths: %d", dini_Int(udb_encode(playername), "deaths")); // Here
        SendClientMessage(playerid, COLOR_WHITE, string);
    }
Reply
#6

Quote:
Originally Posted by MadeMan
I just noticed you got some brackets missing

pawn Код:
if(strcmp(cmd, "/mystats", true) == 0)
    {
    if(logged[playerid] == 0) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You cannot use commands because you are not logged in.");
    else
    if(logged[playerid] == -2) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You cannot use commands because you are jailed.");
    else
    {
        format(string, sizeof(string), "Level: %d", dini_Int(udb_encode(playername), "adminlevel")); // Here
        SendClientMessage(playerid, COLOR_WHITE, string);

        format(string, sizeof(string), "Kills: %d", dini_Int(udb_encode(playername), "kills")); // Here
        SendClientMessage(playerid, COLOR_WHITE, string);

        format(string, sizeof(string), "Deaths: %d", dini_Int(udb_encode(playername), "deaths")); // Here
        SendClientMessage(playerid, COLOR_WHITE, string);
    }
thanks it worked
Reply
#7

stuck in this point

pawn Код:
new killer = dini_Int(udb_encode(playername),("kills"));
    dini_Set(playername, "killer++", kills);//this giving me an error
Код:
C:\Documents and Settings\Administrator\Desktop\gamemodes\lvdm.pwn(4003) : warning 204: symbol is assigned a value that is never used: "killer"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Reply
#8

pawn Код:
dini_Set(playername, "killer++", kills);
I think it should be like this

pawn Код:
dini_Set(playername, "kills", killer++);
Reply
#9

Код:
C:\Documents and Settings\Administrator\Desktop\gamemodes\lvdm.pwn(4004) : error 035: argument type mismatch (argument 3)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#10

Quote:
Originally Posted by Sami_
pawn Код:
new killer = dini_Int(udb_encode(playername),("kills"));
    dini_Set(playername, "killer++", kills);//this giving me an error
You need to change here the killer with the Killer ID. its usually "killerid" without quotes.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)