Pawno not responding
#1

Code:
    if(dialogid == CMD_DIALOG)
    {
        if(response) 
        {
       if(listitem == 0)
            {
            new id, string[1028];
	 sscanf(params, "u", id);
	 if (isnull(params))
	 {
		format(string, sizeof(string), "Soldier %s\nScore: %d\nMoney: $%d\nKills: %d\nDeaths: %d\nRatio: %0.2f\nRank: %s\nAdmin Level: %d\nVip Level: %d\nHelper: %d",PlayerName(playerid), GetPlayerScore(playerid), GetPlayerMoney(playerid), PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], Float:PlayerInfo[playerid][pKills]/Float:PlayerInfo[playerid][pDeaths], GetRankName(playerid), PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pVIP], PlayerInfo[playerid][pHelper]);
	 	ShowPlayerDialog(playerid,13,DIALOG_STYLE_MSGBOX,"informacion", string, ">>","");
	 		 return 1;
		  }
      }
      }
       if(listitem == 1)
(..................code.........code.....code.......code......)
i want insert this code.
Reply
#2

You are missing one }
Reply
#3

Quote:
Originally Posted by Matz
View Post
You are missing one }
Where?
Reply
#4

Or maybe you added one extra } not sure because rest of code is unavailable so try removing red one

Code:
if(dialogid == CMD_DIALOG)
    {
        if(response) 
        {
       if(listitem == 0)
            {
            new id, string[1028];
	 sscanf(params, "u", id);
	 if (isnull(params))
	 {
		format(string, sizeof(string), "Soldier %s\nScore: %d\nMoney: $%d\nKills: %d\nDeaths: %d\nRatio: %0.2f\nRank: %s\nAdmin Level: %d\nVip Level: %d\nHelper: %d",PlayerName(playerid), GetPlayerScore(playerid), GetPlayerMoney(playerid), PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], Float:PlayerInfo[playerid][pKills]/Float:PlayerInfo[playerid][pDeaths], GetRankName(playerid), PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pVIP], PlayerInfo[playerid][pHelper]);
	 	ShowPlayerDialog(playerid,13,DIALOG_STYLE_MSGBOX,"informacion", string, ">>","");
	 		 return 1;
		  }
      }
      }
       if(listitem == 1)
(..................code.........code.....code.......code......)
Reply
#5

Except the extra bracket, keep in mind that "params" is undefined symbol in OnDialogResponse. You should use "inputtext" instead if you want to retrieve data from the text given from an input style dialog.

pawn Code:
new id, string[400];
// if sscanf returns failure (no input or not an id/part of player), assign "id" to "playerid" to see their own statistics
if (sscanf(inputtext, "u", id)) id = playerid;
else if (id == INVALID_PLAYER_ID) return ... // error: not player connected

format(string, sizeof(string), "Soldier %s\nScore: %d\nMoney: $%d\nKills: %d\nDeaths: %d\nRatio: %0.2f\nRank: %s\nAdmin Level: %d\nVip Level: %d\nHelper: %d", PlayerName(id), GetPlayerScore(id), GetPlayerMoney(id), PlayerInfo[id][pKills], PlayerInfo[id][pDeaths], Float: PlayerInfo[id][pKills] / Float: PlayerInfo[id][pDeaths], GetRankName(id), PlayerInfo[id][pAdmin], PlayerInfo[id][pVIP], PlayerInfo[id][pHelper]);
ShowPlayerDialog(playerid, 13, DIALOG_STYLE_MSGBOX, "informacion", string, ">>", "");
and consider using switch instead of many if/else if statements for dialogs and listitems.
Reply
#6

now i get.
Code:
D:\samp03\gamemodes\cod.pwn(2964) : error 017: undefined symbol "params"
D:\samp03\gamemodes\cod.pwn(2965) : error 017: undefined symbol "params"
D:\samp03\gamemodes\cod.pwn(2965) : error 029: invalid expression, assumed zero
D:\samp03\gamemodes\cod.pwn(2965) : error 017: undefined symbol "params"
D:\samp03\gamemodes\cod.pwn(2965) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Reply
#7

Konstantinos, Hmm, me need totorial how use inputtext... Maybe you cant fix this command,
would be a good lesson
Reply
#8

Quote:
Originally Posted by cielkute
View Post
Konstantinos, Hmm, me need totorial how use inputtext... Maybe you cant fix this command,
would be a good lesson
Sorry, I pasted your code to modify it and forgot to change "params" to "inputtext". Take a look again.
Reply
#9

Quote:
Originally Posted by Konstantinos
View Post
Sorry, I pasted your code to modify it and forgot to change "params" to "inputtext". Take a look again.
Now i insert, this code
Code:
       if(listitem == 0)
            {
new id, string[400];
// if sscanf returns failure (no input or not an id/part of player), assign "id" to "playerid" to see their own statistics
if (sscanf(inputtext, "u", id)) id = playerid;
else if (id == INVALID_PLAYER_ID) return ... // error: not player connected

format(string, sizeof(string), "Soldier %s\nScore: %d\nMoney: $%d\nKills: %d\nDeaths: %d\nRatio: %0.2f\nRank: %s\nAdmin Level: %d\nVip Level: %d\nHelper: %d", PlayerName(id), GetPlayerScore(id), GetPlayerMoney(id), PlayerInfo[id][pKills], PlayerInfo[id][pDeaths], Float: PlayerInfo[id][pKills] / Float: PlayerInfo[id][pDeaths], GetRankName(id), PlayerInfo[id][pAdmin], PlayerInfo[id][pVIP], PlayerInfo[id][pHelper]);
ShowPlayerDialog(playerid, 13, DIALOG_STYLE_MSGBOX, "informacion", string, ">>", "");
}
But get error.
Code:
D:\samp03\gamemodes\cod.pwn(2965) : error 029: invalid expression, assumed zero
D:\samp03\gamemodes\cod.pwn(2967) : error 001: expected token: ";", but found "-identifier-"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#10

Konstantin, but working for this
Quote:

if(listitem == 0)
{
new id, string[1028];
sscanf(inputtext, "u", id);
if (isnull(inputtext))
{
format(string, sizeof(string), "Soldier %s\nScore: %d\nMoney: $%d\nKills: %d\nDeaths: %d\nRatio: %0.2f\nRank: %s\nAdmin Level: %d\nVip Level: %d\nHelper: %d",PlayerName(playerid), GetPlayerScore(playerid), GetPlayerMoney(playerid), PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], Float:PlayerInfo[playerid][pKills]/Float:PlayerInfo[playerid][pDeaths], GetRankName(playerid), PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pVIP], PlayerInfo[playerid][pHelper]);
ShowPlayerDialog(playerid,13,DIALOG_STYLE_MSGBOX," informacion", string, ">>","");
}
}
if(listitem == 1)

////----------/////
not working , No error, but not show dialog...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)