Error messages unsure of why -
slymatt - 16.07.2011
Im recieving errors for this part of my code ive been making constant changes to it but i still cant work it out.
The Errors are:
Код:
C:\Users\mattt\Desktop\New\gamemodes\newserver.pwn(253) : error 017: undefined symbol "kick"
C:\Users\mattt\Desktop\New\gamemodes\newserver.pwn(255) : error 002: only a single statement (or expression) can follow each "case"
C:\Users\mattt\Desktop\New\gamemodes\newserver.pwn(255 -- 256) : error 028: invalid subscript (not an array or too many subscripts): "response"
C:\Users\mattt\Desktop\New\gamemodes\newserver.pwn(255 -- 257) : error 001: expected token: "}", but found "if"
C:\Users\mattt\Desktop\New\gamemodes\newserver.pwn(255 -- 257) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
5 Errors.
This is the part of the code:
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case 1:if(!response)return kick(playerid);
if(!response)
{
if(strlen(inputtext))
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Register", "Please type in a password.", "Register","Exit");
}
if(INI_Open(getINI(playerid)))
{
INI_WriteString("password", inputtext);
INI_WriteInt("age", inputtext);
INI_WriteInt("cash", 200000);
INI_WriteInt("score",1);
INI_WriteInt("kills", 0);
INI_WriteInt("deaths", 0);
INI_WriteInt("timeplayed", 0);
INI_WriteInt("ipaddress", ipaddress);
INI_WriteInt("saveposition", saveposition);
INI_WriteInt("Admin", 0);
INI_WriteInt("faction", 0);
INI_WriteInt("faction", 0);
INI_WriteInt("bankdeposit", 0);
INI_WriteInt("ban", 0);
INI_WriteString("banreason", "");
INI_WriteInt("house", 0);
INI_WriteInt("biz", 0);
INI_WriteInt("fightstyle", 0);
INI_Save();
INI_Close();
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Login", "Please enter your password to login", "Login", "Exit");
}
}
case 2:
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Login", "Please enter your password to login", "Login", "Exit");
}
}
return 1;
}
Thanks for your time
Re: Error messages unsure of why -
Basicz - 16.07.2011
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case 1: { if(!response)return Kick(playerid); // missed a bracket. should be Kick instead of kick
//if(!response) lol
//{ lol
if(strlen(inputtext))
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Register", "Please type in a password.", "Register","Exit");
}
if(INI_Open(getINI(playerid)))
{
INI_WriteString("password", inputtext);
INI_WriteInt("age", inputtext);
INI_WriteInt("cash", 200000);
INI_WriteInt("score",1);
INI_WriteInt("kills", 0);
INI_WriteInt("deaths", 0);
INI_WriteInt("timeplayed", 0);
INI_WriteInt("ipaddress", ipaddress);
INI_WriteInt("saveposition", saveposition);
INI_WriteInt("Admin", 0);
INI_WriteInt("faction", 0);
INI_WriteInt("faction", 0);
INI_WriteInt("bankdeposit", 0);
INI_WriteInt("ban", 0);
INI_WriteString("banreason", "");
INI_WriteInt("house", 0);
INI_WriteInt("biz", 0);
INI_WriteInt("fightstyle", 0);
INI_Save();
INI_Close();
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Login", "Please enter your password to login", "Login", "Exit");
}
}
case 2:
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Login", "Please enter your password to login", "Login", "Exit");
}
}
return 1;
}
I can't read that script, badly indented.
Re: Error messages unsure of why -
slymatt - 16.07.2011
Ive changed the two parts you have shown there and now i get miles more errors =P
C:\Users\mattt\Desktop\New\gamemodes\newserver.pwn (262) : error 035: argument type mismatch (argument 1)
C:\Users\mattt\Desktop\New\gamemodes\newserver.pwn (263) : error 035: argument type mismatch (argument 1)
C:\Users\mattt\Desktop\New\gamemodes\newserver.pwn (264) : error 035: argument type mismatch (argument 1)
C:\Users\mattt\Desktop\New\gamemodes\newserver.pwn (265) : error 035: argument type mismatch (argument 1)
C:\Users\mattt\Desktop\New\gamemodes\newserver.pwn (266) : error 035: argument type mismatch (argument 1)
C:\Users\mattt\Desktop\New\gamemodes\newserver.pwn (267) : error 035: argument type mismatch (argument 1)
C:\Users\mattt\Desktop\New\gamemodes\newserver.pwn (26
: error 035: argument type mismatch (argument 1)
C:\Users\mattt\Desktop\New\gamemodes\newserver.pwn (269) : error 035: argument type mismatch (argument 1)
C:\Users\mattt\Desktop\New\gamemodes\newserver.pwn (270) : error 035: argument type mismatch (argument 1)
C:\Users\mattt\Desktop\New\gamemodes\newserver.pwn (271) : error 035: argument type mismatch (argument 1)
C:\Users\mattt\Desktop\New\gamemodes\newserver.pwn (272) : error 035: argument type mismatch (argument 1)
C:\Users\mattt\Desktop\New\gamemodes\newserver.pwn (273) : error 035: argument type mismatch (argument 1)
C:\Users\mattt\Desktop\New\gamemodes\newserver.pwn (274) : error 035: argument type mismatch (argument 1)
C:\Users\mattt\Desktop\New\gamemodes\newserver.pwn (275) : error 035: argument type mismatch (argument 1)
C:\Users\mattt\Desktop\New\gamemodes\newserver.pwn (276) : error 035: argument type mismatch (argument 1)
C:\Users\mattt\Desktop\New\gamemodes\newserver.pwn (277) : error 035: argument type mismatch (argument 1)
C:\Users\mattt\Desktop\New\gamemodes\newserver.pwn (27
: error 035: argument type mismatch (argument 1)
C:\Users\mattt\Desktop\New\gamemodes\newserver.pwn (279) : error 035: argument type mismatch (argument 1)
C:\Users\mattt\Desktop\New\gamemodes\newserver.pwn (281) : error 017: undefined symbol "INI_Save"
C:\Users\mattt\Desktop\New\gamemodes\newserver.pwn (282) : warning 202: number of arguments does not match definition
C:\Users\mattt\Desktop\New\gamemodes\newserver.pwn (28
: error 014: invalid statement; not in switch
C:\Users\mattt\Desktop\New\gamemodes\newserver.pwn (28
: warning 215: expression has no effect
C:\Users\mattt\Desktop\New\gamemodes\newserver.pwn (28
: error 001: expected token: ";", but found ":"
C:\Users\mattt\Desktop\New\gamemodes\newserver.pwn (28
: error 029: invalid expression, assumed zero
C:\Users\mattt\Desktop\New\gamemodes\newserver.pwn (28
: fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
23 Errors.
Re: Error messages unsure of why -
Basicz - 16.07.2011
Jeez
pawn Код:
INI_WriteInt("ipaddress", ipaddress);
INI_WriteString!
Код:
C:\Users\mattt\Desktop\New\gamemodes\newserver.pwn (281) : error 017: undefined symbol "INI_Save"
INI_Save is not defined.
pawn Код:
INI_WriteInt("age", inputtext);
inputtext = string
age = integer
it should be
pawn Код:
INI_WriteInt("age", strval( inputtext ));
compiled fine for me.
maybe somethings wrong in your script, maybe missing SII include, or PM me the whole gamemode, lemme fix it.
Re: Error messages unsure of why -
slymatt - 16.07.2011
SII? im using YSI am i using the wrong stuff for the wrong include?