08.04.2012, 16:08
I changed the script and got fewer errors!
im gonna post the whole ondialogresponse..
The line 239 is the line that begins with: case DIALOG_REGISTER:
MY errors are:
im gonna post the whole ondialogresponse..
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == SHOP_DIALOG)//If the dialog responded to is our Weapon Shop dialog.
{
if(!response) return SendClientMessage(playerid, -1, "Apu voice: Thank you come again!");//If they click "Exit" they have left the dialog(Shop).
switch(listitem)
{
case 0://Country Rifle
{
if(GetPlayerMoney(playerid) >= 3000)//If they have more or equal to the price.
{
GivePlayerMoney(playerid, GetPlayerMoney(playerid) - 3000);//Take the cost.
GivePlayerWeapon(playerid, 33, 60);//Give them the weapon/ammo.
SendClientMessage(playerid, -1, "Country Rifle purchased.");//And let them know they just purchased a weapon.
return 1;//Tell pawno to stop processing now.
}
else//Else the dont have enough money to cover the purchase.
{
SendClientMessage(playerid, COLOR_RED, "You dont have 3000 dollars!");//Tell them.
return 1;//Tell pawno to stop processing now.
}
}
case 1://AK-47
{
if(GetPlayerMoney(playerid) >= 6000)//If they have more or equal to the price.
{
GivePlayerMoney(playerid, GetPlayerMoney(playerid) - 6000);//Take the cost.
GivePlayerWeapon(playerid, 30, 100);//Give them the weapon/ammo.
SendClientMessage(playerid, -1, "AK-47 purchased.");//And let them know they just purchased a weapon.
return 1;//Tell pawno to stop processing now.
}
else//Else the dont have enough money to cover the purchase.
{
SendClientMessage(playerid, COLOR_RED, "You dont have 6000 dollars!");//Tell them.
return 1;//Tell pawno to stop processing now.
}
}
case 2://M4
{
if(GetPlayerMoney(playerid) >= 6000)//If they have more or equal to the price.
{
GivePlayerMoney(playerid, GetPlayerMoney(playerid) - 6000);//Take the cost.
GivePlayerWeapon(playerid, 31, 100);//Give them the weapon/ammo.
SendClientMessage(playerid, -1, "M4 purchased.");//And let them know they just purchased a weapon.
return 1;//Tell pawno to stop processing now.
}
else//Else the dont have enough money to cover the purchase.
{
SendClientMessage(playerid, COLOR_RED, "You dont have 6000 dollars!");//Tell them.
return 1;//Tell pawno to stop processing now.
}
}
case 3://RPG
{
if(GetPlayerMoney(playerid) >= 10000)//If they have more or equal to the price.
{
GivePlayerMoney(playerid, GetPlayerMoney(playerid) - 10000);//Take the cost.
GivePlayerWeapon(playerid, 34, 100);//Give them the weapon/ammo.
SendClientMessage(playerid, -1, "RPG purchased.");//And let them know they just purchased a weapon.
return 1;//Tell pawno to stop processing now.
}
else//Else the dont have enough money to cover the purchase.
{
SendClientMessage(playerid, COLOR_RED, "You dont have 10 000 dollars!");//Tell them.
return 1;//Tell pawno to stop processing now.
}
}
}
if(dialogid == DIALOG_REGISTER)
{
case DIALOG_REGISTER:
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_Close(File);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"Have fun Bitches!","Ok","");
}
}
if(dialogid == DIALOG_REGISTER)
{
case DIALOG_LOGIN;
{
if ( !response ) return Kick ( playerid );
if( response )
{
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok","");
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
}
return 1;
}
}
}
return 1;
}
MY errors are:
Quote:
C:\Users\reha5\Desktop\waht.pwn(239) : error 014: invalid statement; not in switch C:\Users\reha5\Desktop\waht.pwn(239) : warning 215: expression has no effect C:\Users\reha5\Desktop\waht.pwn(239) : error 001: expected token: ";", but found ":" C:\Users\reha5\Desktop\waht.pwn(239) : error 029: invalid expression, assumed zero C:\Users\reha5\Desktop\waht.pwn(239) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors. |