23.08.2013, 16:10
If you could indent your code, you would be able to fix your problems easier. Take a look:
You open braces, and you continue like that without closing and checking the rest. It's like doing nested if statements, when it should be:
pawn Код:
if (GetPlayerMoney(playerid) <= 5000) return SendClientMessage(playerid, RED, "You don't have enough money!"); //line 314
{
GivePlayerMoney(playerid,-5000);
pInfo[playerid][Cookies] += 10;
new file[100],Name[MAX_PLAYER_NAME],Ip[16]; GetPlayerName(playerid,Name,sizeof(Name)); GetPlayerIp(playerid,Ip,sizeof(Ip)); format(file,sizeof(file),PlayerFile,Name);
dini_IntSet(file,"Cookies :", pInfo[playerid][Cookies]);
}
if(listitem == 3)
{
if (GetPlayerMoney(playerid) <= 10000) return SendClientMessage(playerid, RED, "You don't have enough money!");
{
GivePlayerMoney(playerid,-10000);
pInfo[playerid][Cookies] += 20;
new file[100],Name[MAX_PLAYER_NAME],Ip[16]; GetPlayerName(playerid,Name,sizeof(Name)); GetPlayerIp(playerid,Ip,sizeof(Ip)); format(file,sizeof(file),PlayerFile,Name);
dini_IntSet(file,"Cookies :", pInfo[playerid][Cookies]);
}
if(listitem == 4)
{
if (GetPlayerMoney(playerid) <= 25000) return SendClientMessage(playerid, RED, "You don't have enough money!");
{
GivePlayerMoney(playerid,-25000);
pInfo[playerid][Cookies] += 50;
new file[100],Name[MAX_PLAYER_NAME],Ip[16]; GetPlayerName(playerid,Name,sizeof(Name)); GetPlayerIp(playerid,Ip,sizeof(Ip)); format(file,sizeof(file),PlayerFile,Name);
dini_IntSet(file,"Cookies :", pInfo[playerid][Cookies]);
}
return 1;
}
return 0;
}
pawn Код:
if( something )
{
// blabla..
}
else if( something )
{
// blabla..
}