SA-MP Forums Archive
Empty Statement? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Empty Statement? (/showthread.php?tid=594965)



Empty Statement? - vassilis - 26.11.2015

PHP код:
CMD:buyhouse(playerid,params[])
{
    new 
hid GetHouseID(playerid);
    new 
price HouseInfo[hid][HPrice];
    if(
GetPlayerMoney(playerid) < price) return SendFM(playeridCOLOR_WHITE""COL_RED"SERVER"COL_WHITE":You can't buy this house it is too expensive for you! House Price %d",price);<<<<==9735
    
if(HouseInfo[hid][HOwned] == 1) return SendClientMessage(playerid,-1,""COLOR_RED"SERVER"COL_WHITE"You can't buy this house because it is already bought!"); <<<----9736
    
if(HouseInfo[hid][HOwnerID] == pinfo[playerid][ID]) return SendClientMessage(playerid, -1""COL_RED"You can't buy your own house!");    
    
HouseBuy(playerid);
    return 
1;

Errors :
pawn Код:
mysql.pwn(9735) : error 029: invalid expression, assumed zero
mysql.pwn(9735) : error 036: empty statement
mysql.pwn(9736) : error 001: expected token: "-string end-", but found "-identifier-"
mysql.pwn(9736) : warning 215: expression has no effect
mysql.pwn(9736) : error 001: expected token: ";", but found "-string-"
mysql.pwn(9736) : warning 215: expression has no effect
mysql.pwn(9736) : error 001: expected token: ";", but found ")"
mysql.pwn(9736) : fatal error 107: too many error messages on one line



Re: Empty Statement? - N0FeaR - 26.11.2015

Wich line is 9736?


Re: Empty Statement? - vassilis - 26.11.2015

PHP код:
if(HouseInfo[hid][HOwned] == 1) return SendClientMessage(playerid,-1,""COLOR_RED"SERVER"COL_WHITE"You can't buy this house because it is already bought!"); <<<----9736 
I Can't find anything wrong to be honest.


Re: Empty Statement? - ATGOggy - 26.11.2015

Show stock SendFM


Re: Empty Statement? - N0FeaR - 26.11.2015

try this!

PHP код:
CMD:buyhouse(playerid,params[])
{
    new 
hid GetHouseID(playerid);
    new 
price HouseInfo[hid][HPrice];
    if(
GetPlayerMoney(playerid) < price) return SendFM(playeridCOLOR_WHITE"COL_RED"SERVER"COL_WHITE":You can't buy this house it is too expensive for you! House Price %d",price);
    if(HouseInfo[hid][HOwned] == 1) return SendClientMessage(playerid,-1,"COLOR_RED"SERVER"COL_WHITE"You can'
t buy this house because it is already bought!");
    if(HouseInfo[hid][HOwnerID] == pinfo[playerid][ID]) return SendClientMessage(playerid, -1, "
COL_RED"You can't buy your own house!");    
    
HouseBuy(playerid);
    return 



Re: Empty Statement? - thefirestate - 26.11.2015

Can I see the defines of COL_RED and COL_WHITE?


Re: Empty Statement? - ATGOggy - 26.11.2015

I think the problem is outside this. Put this command inside /* */ to check if there's any missing bracket outside or something.


Re: Empty Statement? - ATGOggy - 26.11.2015

Found a mistake:

if(HouseInfo[hid][HOwned] == 1) return SendClientMessage(playerid,-1,""COLOR_RED"SERVER"COL_WHITE"You can't buy this house because it is already bought!"); <<<----9736

You wrote COLOR_RED, change it to COL_RED


Re: Empty Statement? - N0FeaR - 26.11.2015

Quote:
Originally Posted by ATGOggy
Посмотреть сообщение
Found a mistake:

if(HouseInfo[hid][HOwned] == 1) return SendClientMessage(playerid,-1,""COLOR_RED"SERVER"COL_WHITE"You can't buy this house because it is already bought!"); <<<----9736

You wrote COLOR_RED, change it to COL_RED
Mabye he defined it as COLOR_RED


Re: Empty Statement? - ATGOggy - 26.11.2015

Means the error in line 36 is fixed?