07.04.2012, 14:45
Sorry for offtopic , but can i learn you something shabi?
why would you do it like this
when you can do it like this
i mean , this is so simple, and you just read the whole code..
3rd line : If playermoney is less than 100$ , return send that message to player.. else , code send's him message that he bought ak47 , gives him weapon and charge him..
OT: if((GetPlayerMoney(playerid) >= 100)
you don't need 2 bracket here, just one, and the second thing that i bold , it says if playermoney is higher or equal to 100 , so you do it like this
if(GetPlayerMoney(playerid) < 100) return SendClientMessage(playerid,-1,"You don't have enought money");
just read the code, if player money is less than 100 , code will return him message "you don't have enought money.."
why would you do it like this
Код:
if (strcmp("/ak47", cmdtext, true, 10) == 0) { if(GetPlayerMoney(playerid) >= 100)//a extra ( bracket here { // this is line 164 SendClientMessage(playerid, 0xFF0000AA,"You bought an Ak47"); GivePlayerWeapon(playerid, 30, 1000); GivePlayerMoney(playerid, -100); } else { if(GetPlayerMoney(playerid) < 100) { SendClientMessage(playerid, 0xFF0000AA,"You don't have enough money"); } }
Код:
if (strcmp("/ak47", cmdtext, true, 10) == 0) { if(GetPlayerMoney(playerid) < 100) return SendClientMessage(playerid, 0xFF0000AA,"You don't have enough money"); SendClientMessage(playerid, 0xFF0000AA,"You bought an Ak47"); GivePlayerWeapon(playerid, 30, 1000); GivePlayerMoney(playerid, -100); } }
3rd line : If playermoney is less than 100$ , return send that message to player.. else , code send's him message that he bought ak47 , gives him weapon and charge him..
OT: if((GetPlayerMoney(playerid) >= 100)
you don't need 2 bracket here, just one, and the second thing that i bold , it says if playermoney is higher or equal to 100 , so you do it like this
if(GetPlayerMoney(playerid) < 100) return SendClientMessage(playerid,-1,"You don't have enought money");
just read the code, if player money is less than 100 , code will return him message "you don't have enought money.."