SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 23/12/2009, 02:46 PM   #1
_Sami_
Big Clucker
 
Join Date: Nov 2009
Posts: 72
Reputation: 0
Default Need a bit help

Code:
	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 ?
Code:
C:\Documents and Settings\Administrator\Desktop\gamemodes\lvdm.pwn(2475) : error 001: expected token: ",", but found ";"
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.
i tried my best but wasnt able to solve this bugs
_Sami_ is offline  
Old 23/12/2009, 02:59 PM   #2
_Sami_
Big Clucker
 
Join Date: Nov 2009
Posts: 72
Reputation: 0
Default Re: Need a bit help

no one ?
_Sami_ is offline  
Old 23/12/2009, 03:00 PM   #3
MadeMan
High-roller
 
MadeMan's Avatar
 
Join Date: Jun 2007
Posts: 3,488
Reputation: 256
Default Re: Need a bit help

Try this. (Added brackets for else)

pawn Code:
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);
    }
MadeMan is offline  
Old 23/12/2009, 03:01 PM   #4
Gamer_Z
Guest
 
Posts: n/a
Default Re: Need a bit help

pawn Code:
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
 
Old 23/12/2009, 03:07 PM   #5
MadeMan
High-roller
 
MadeMan's Avatar
 
Join Date: Jun 2007
Posts: 3,488
Reputation: 256
Default Re: Need a bit help

I just noticed you got some brackets missing

pawn Code:
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);
    }
MadeMan is offline  
Old 23/12/2009, 03:08 PM   #6
_Sami_
Big Clucker
 
Join Date: Nov 2009
Posts: 72
Reputation: 0
Default Re: Need a bit help

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

pawn Code:
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
_Sami_ is offline  
Old 23/12/2009, 03:34 PM   #7
_Sami_
Big Clucker
 
Join Date: Nov 2009
Posts: 72
Reputation: 0
Default Re: Need a bit help

stuck in this point

pawn Code:
new killer = dini_Int(udb_encode(playername),("kills"));
    dini_Set(playername, "killer++", kills);//this giving me an error
Code:
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 (c) 1997-2006, ITB CompuPhase


1 Warning.
_Sami_ is offline  
Old 23/12/2009, 03:37 PM   #8
MadeMan
High-roller
 
MadeMan's Avatar
 
Join Date: Jun 2007
Posts: 3,488
Reputation: 256
Default Re: Need a bit help

pawn Code:
dini_Set(playername, "killer++", kills);

I think it should be like this

pawn Code:
dini_Set(playername, "kills", killer++);
MadeMan is offline  
Old 23/12/2009, 03:40 PM   #9
_Sami_
Big Clucker
 
Join Date: Nov 2009
Posts: 72
Reputation: 0
Default Re: Need a bit help

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


1 Error.
_Sami_ is offline  
Old 23/12/2009, 03:42 PM   #10
Dark_Kostas
Gangsta
 
Join Date: Dec 2007
Location: Greece, Athens
Posts: 542
Reputation: 17
Default Re: Need a bit help

Quote:
Originally Posted by Sami_
pawn Code:
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.
__________________
Quote:
Help != Scripting for you.

Give a man a fish he eats for a day, teach a man to fish he eats for a life time.
Dark_Kostas is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 03:20 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.