case error -
Karolukas123 - 08.09.2015
C:\Users\Karolis\Desktop\New gamemode\gamemodes\mysqlGM.pwn(517) : error 002: only a single statement (or expression) can follow each "case"
C:\Users\Karolis\Desktop\New gamemode\gamemodes\mysqlGM.pwn(517 -- 51
: error 028: invalid subscript (not an array or too many subscripts): "response"
C:\Users\Karolis\Desktop\New gamemode\gamemodes\mysqlGM.pwn(517 -- 519) : error 001: expected token: "}", but found "if"
C:\Users\Karolis\Desktop\New gamemode\gamemodes\mysqlGM.pwn(517 -- 519) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
if(response) // 517
Re: case error -
Makhmoor - 08.09.2015
Can you show us a code?
Re: case error -
Karolukas123 - 08.09.2015
Код:
}
switch(dialogid)
{
case PropertyBuyDialog:
{
new PropertysCountV;
for(new i = 0; i < MAX_PROPERTYS_IN_SERVER; i ++)
{
if(strcmp(PropertySystem[i][pOwner], "0"))
{
if(!strcmp(PropertySystem[i][pOwner], GetPlayerNameEx(playerid), false, MAX_PLAYER_NAME))
{
PropertysCountV ++;
}
}
}
if(PropertysCountV >= 2)
{
return SendClientMessage(playerid, -1, "Jus jau turite 2 verslus!");
}
}
//new pID = playerData[playerid][SomeoneVariable][0];
if(response)
{
if(PropertySystem[pID][pOwnerForCredits])
{
//new String[270];
new Credits = KiekKredituTuri(GetPlayerNameEx(playerid));
if(Credits < PropertySystem[pID][pPrice]) return SendClientMessage(playerid, -1, "Jums neuюtenka kreditш!");
Credits -= PropertySystem[pID][pPrice];
format(String, sizeof(String), "UPDATE `players` SET `Kreditai` = '%d' WHERE `Vardas` = '%s'", Credits, GetPlayerNameEx(playerid));
mysql_query(String);
format(String, sizeof(String), "Sлkmingai nusipirkote verslа uю %s {ffffff}kreditш (-us)!", konvertuoti_pinigus(PropertySystem[pID][pPrice]));
SendClientMessage(playerid, -1, String);
SendClientMessage(playerid, -1, "Savo verslа valdyti galлsite paraрж /verslai{ffffff}!");
strdel(PropertySystem[pID][pOwner], 0, MAX_PLAYER_NAME);
strcat(PropertySystem[pID][pOwner], GetPlayerNameEx(playerid), MAX_PLAYER_NAME);
format(String, sizeof(String), "{FF0000}%s\n \n{ffffff}Kaina: %d {ffffff}kreditш (-ai)\n{ffffff}Pelnas: €%d/1 {ffffff}min\n{ffffff}Savininkas: {FF0000}%s\n \n{ffffff}Spausk ENTER",
PropertySystem[pID][pTitle], PropertySystem[pID][pPrice], PropertySystem[pID][pEarning], PropertySystem[pID][pOwner]);
UpdateDynamic3DTextLabelText(PropertySystem[pID][pTextLabel], -1, String);
SaveProperty(pID);
}
else
{
if(GetPlayerMoneyA(playerid) >= PropertySystem[pID][pPrice])
{
new String[270];
format(String, sizeof(String), "[INFO]: {ffffff}Sлkmingai nusipirkote verslа uю €%s{ffffff}!", konvertuoti_pinigus(PropertySystem[pID][pPrice]));
SendClientMessage(playerid, -1, String);
SendClientMessage(playerid, -1, "[INFO]: {ffffff}Savo verslа valdyti galлsite paraрж /verslai{ffffff}!");
GivePlayerMoneyA(playerid, -PropertySystem[pID][pPrice]);
strdel(PropertySystem[pID][pOwner], 0, MAX_PLAYER_NAME);
strcat(PropertySystem[pID][pOwner], GetPlayerNameEx(playerid), MAX_PLAYER_NAME);
format(String, sizeof(String), "{FF0000}%s\n \n{ffffff}Kaina: €%s\n{ffffff}Pelnas: €%d/1 {ffffff}min\n{ffffff}Savininkas: {FF0000}%s\n \n{ffffff}Spausk ENTER",
PropertySystem[pID][pTitle], konvertuoti_pinigus(PropertySystem[pID][pPrice]), PropertySystem[pID][pEarning], PropertySystem[pID][pOwner]);
UpdateDynamic3DTextLabelText(PropertySystem[pID][pTextLabel], -1, String);
SaveProperty(pID);
}
else
{
SendClientMessage(playerid, -1, "[KLAIDA]: {ffffff}Jums neuюtenka pinigш рio verslo nusipirkimui!");
}
}
return 1;
Re: case error -
khRamin78 - 08.09.2015
in a case x: you need too open " {} " and close them then you want add some thing add in them you may lost closing one of them so this error shows just check them and fix them then your problem will be sloved
Edit : also better to show full of that part in codes
Re: case error -
khRamin78 - 08.09.2015
PHP код:
switch(dialogid)
{
case PropertyBuyDialog:
{
new PropertysCountV;
for(new i = 0; i < MAX_PROPERTYS_IN_SERVER; i ++)
{
if(strcmp(PropertySystem[i][pOwner], "0"))
{
if(!strcmp(PropertySystem[i][pOwner], GetPlayerNameEx(playerid), false, MAX_PLAYER_NAME))
{
PropertysCountV ++;
}
}
}
if(PropertysCountV >= 2)
{
return SendClientMessage(playerid, -1, "Jus jau turite 2 verslus!");
}
//}
if(response)
{
if(PropertySystem[pID][pOwnerForCredits])
{
//new String[270];
new Credits = KiekKredituTuri(GetPlayerNameEx(playerid));
if(Credits < PropertySystem[pID][pPrice]) return SendClientMessage(playerid, -1, "Jums neuюtenka kreditш!");
Credits -= PropertySystem[pID][pPrice];
format(String, sizeof(String), "UPDATE `players` SET `Kreditai` = '%d' WHERE `Vardas` = '%s'", Credits, GetPlayerNameEx(playerid));
mysql_query(String);
format(String, sizeof(String), "Sлkmingai nusipirkote verslа uю %s {ffffff}kreditш (-us)!", konvertuoti_pinigus(PropertySystem[pID][pPrice]));
SendClientMessage(playerid, -1, String);
SendClientMessage(playerid, -1, "Savo verslа valdyti galлsite paraрж /verslai{ffffff}!");
strdel(PropertySystem[pID][pOwner], 0, MAX_PLAYER_NAME);
strcat(PropertySystem[pID][pOwner], GetPlayerNameEx(playerid), MAX_PLAYER_NAME);
format(String, sizeof(String), "{FF0000}%s\n \n{ffffff}Kaina: %d {ffffff}kreditш (-ai)\n{ffffff}Pelnas: Ђ%d/1 {ffffff}min\n{ffffff}Savininkas: {FF0000}%s\n \n{ffffff}Spausk ENTER",
PropertySystem[pID][pTitle], PropertySystem[pID][pPrice], PropertySystem[pID][pEarning], PropertySystem[pID][pOwner]);
UpdateDynamic3DTextLabelText(PropertySystem[pID][pTextLabel], -1, String);
SaveProperty(pID);
}
else
{
if(GetPlayerMoneyA(playerid) >= PropertySystem[pID][pPrice])
{
new String[270];
format(String, sizeof(String), "[INFO]: {ffffff}Sлkmingai nusipirkote verslа uю Ђ%s{ffffff}!", konvertuoti_pinigus(PropertySystem[pID][pPrice]));
SendClientMessage(playerid, -1, String);
SendClientMessage(playerid, -1, "[INFO]: {ffffff}Savo verslа valdyti galлsite paraрж /verslai{ffffff}!");
GivePlayerMoneyA(playerid, -PropertySystem[pID][pPrice]);
strdel(PropertySystem[pID][pOwner], 0, MAX_PLAYER_NAME);
strcat(PropertySystem[pID][pOwner], GetPlayerNameEx(playerid), MAX_PLAYER_NAME);
format(String, sizeof(String), "{FF0000}%s\n \n{ffffff}Kaina: Ђ%s\n{ffffff}Pelnas: Ђ%d/1 {ffffff}min\n{ffffff}Savininkas: {FF0000}%s\n \n{ffffff}Spausk ENTER",
PropertySystem[pID][pTitle], konvertuoti_pinigus(PropertySystem[pID][pPrice]), PropertySystem[pID][pEarning], PropertySystem[pID][pOwner]);
UpdateDynamic3DTextLabelText(PropertySystem[pID][pTextLabel], -1, String);
SaveProperty(pID);
}
else
{
SendClientMessage(playerid, -1, "[KLAIDA]: {ffffff}Jums neuюtenka pinigш рio verslo nusipirkimui!");
}
}
}
}
return 1;
this SHould Work As I Checked {}'s but you wrote it you better know so check by your self is better way
Re: case error -
Karolukas123 - 08.09.2015
khRamin78 ohh i see thanks