11.03.2012, 12:59
Hey! I get this 4 errors, and I think, that I've put it on the wrong place! It's the dialog "case:fastshopdialog"...
I marked the dialog which is causing the issues:
Код:
D:\Program Files\GTA San Andreas\SAMP_Server\gamemodes\deathmatch.pwn(2165) : error 014: invalid statement; not in switch D:\Program Files\GTA San Andreas\SAMP_Server\gamemodes\deathmatch.pwn(2165) : warning 215: expression has no effect D:\Program Files\GTA San Andreas\SAMP_Server\gamemodes\deathmatch.pwn(2165) : error 001: expected token: ";", but found ":" D:\Program Files\GTA San Andreas\SAMP_Server\gamemodes\deathmatch.pwn(2165) : error 029: invalid expression, assumed zero D:\Program Files\GTA San Andreas\SAMP_Server\gamemodes\deathmatch.pwn(2165) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
switch(dialogid)
{
case DIALOG_REGISTER:
{
if(!response)
return Kick(playerid);
if(response)
{
if(!strlen(inputtext))
return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""WHITE"Registering...",""RED"You have entered an invalid password.\n"WHITE"Type your password below to register a new account.","Register","Quit");
if(INI_Open(getINI(playerid)))
{
INI_WriteString("Password",inputtext);
INI_WriteInt("Cash", 0);
INI_WriteInt("Admin", 0);
INI_WriteInt("FirstTime", 0);
INI_WriteInt("Skin", 0);
INI_WriteInt("Score", 0);
INI_WriteInt("Kills", 0);
INI_WriteInt("Deaths", 0);
INI_WriteInt("VIPlevel", 0);
INI_Save();
INI_Close();
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""WHITE"Login",""WHITE"Type your password below to login.","Login","Quit");
}
}
} case DIALOG_LOGIN:
{
if(!response)
return Kick ( playerid );
if(response)
{
if(!strlen(inputtext))
return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""WHITE"Login",""RED"You have entered an invalid password.\n"WHITE"Type your password below to login.","Login","Quit");
if(INI_Open(getINI(playerid)))
{
INI_ReadString(PlayerInfo[playerid][pPass],"Password",20);
if(strcmp(inputtext,PlayerInfo[playerid][pPass],false)) {
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""WHITE"Login",""RED"You have entered an incorrect password.\n"WHITE"Type your password below to login.","Login","Quit");
TimesAttempted[playerid] += 1;
if(TimesAttempted[playerid] == 1) SendClientMessage(playerid,COLOR_RED,"Wrong password, 2 login-attempts left!");
else if(TimesAttempted[playerid] == 2) SendClientMessage(playerid,COLOR_RED,"Wrong password, 1 login-attempt left!");
else if(TimesAttempted[playerid] == 3){
new tname[MAX_PLAYER_NAME], rstring[128];
GetPlayerName(playerid, tname, sizeof(tname));
format(rstring,sizeof(rstring),"SYSTEM: Player %s has been automatically kicked by the server (Exceeding login-attempts)!",tname);
SendClientMessageToAll(COLOR_RED,rstring);
Kick(playerid);
}
}
else {
SendClientMessage(playerid,BRIGHT_GREEN,"You have successfully logged in! Welcome back, homie!");
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
}
GivePlayerMoney( playerid, INI_ReadInt( "Cash" ) );
PlayerInfo[playerid][pAdmin] = INI_ReadInt("Admin");
PlayerInfo[playerid][pKills] = INI_ReadInt("Kills");
PlayerInfo[playerid][pDeaths] = INI_ReadInt("Deaths");
gFirstTimeHasJoined[playerid] = INI_ReadInt("FirstTime");
gPlayerSkinForEver[playerid] = INI_ReadInt("Skin");
SetPlayerScore( playerid, INI_ReadInt( "Score" ) );
PlayerInfo[playerid][VIPlevel] = INI_ReadInt("VIP-Level");
INI_Close();
}
}
case fastshopdialog: //STARTS HERE
{
switch(listitem)
{
case 0: // The first listitem
{
if(GetPlayerMoney(playerid) < 2500) return SendClientMessage(playerid, COLOR_RED,"You need at least $2500 to buy a Desert Eagle!");
GivePlayerMoney(playerid, -2500);
GivePlayerWeapon(playerid, 24, 100);
SendClientMessage(playerid, COLOR_GREEN, "You have successfully bought a Desert Eagle with 100 ammo for $2500!");
}
case 1:
{
if(GetPlayerMoney(playerid) < 3000) return SendClientMessage(playerid, COLOR_RED,"You need at least $3000 to buy a Sniper Rifle!");
GivePlayerMoney(playerid, -3000);
GivePlayerWeapon(playerid, 34, 75);
SendClientMessage(playerid, COLOR_GREEN, "You have successfully bought a Sniper Rifle with 75 ammo for $3000!");
}
case 2:
{
if(GetPlayerMoney(playerid) < 4000) return SendClientMessage(playerid, COLOR_RED,"You need at least $4000 to buy a Shotgun!");
GivePlayerMoney(playerid, -4000);
GivePlayerWeapon(playerid, 25, 175);
SendClientMessage(playerid, COLOR_GREEN, "You have successfully bought a Shotgun with 1175 ammo for $4000!");
}
case 3:
{
if(GetPlayerMoney(playerid) < 6000) return SendClientMessage(playerid, COLOR_RED,"You need at least $6000 to buy a Spas!");
GivePlayerMoney(playerid, -6000);
GivePlayerWeapon(playerid, 27, 200);
SendClientMessage(playerid, COLOR_GREEN, "You have successfully bought a Spas 12 with 200 ammo for $6000!");
}
case 4:
{
if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, COLOR_RED,"You need at least $1000 to buy a MP5!");
GivePlayerMoney(playerid, -1000);
GivePlayerWeapon(playerid, 29, 300);
SendClientMessage(playerid, COLOR_GREEN, "You have successfully bought a MP5 with 300 ammo for $1000!");
}
case 5:
{
if(GetPlayerMoney(playerid) < 1500) return SendClientMessage(playerid, COLOR_RED,"You need at least $1500 to buy a M4!");
GivePlayerMoney(playerid, -1500);
GivePlayerWeapon(playerid, 31, 250);
SendClientMessage(playerid, COLOR_GREEN, "You have successfully bought a M4 with 250 ammo for $1500!");
}
case 6:
{
if(GetPlayerMoney(playerid) < 25000) return SendClientMessage(playerid, COLOR_RED,"You need at least $25000 to buy Sawn-off Shotguns!");
GivePlayerMoney(playerid, -25000);
GivePlayerWeapon(playerid, 26, 150);
SendClientMessage(playerid, COLOR_GREEN, "You have successfully bought a Sawn-off Shotgun with 150 ammo for $25000!");
}
}
}
}
}
return 1;
}