How can i fix this? - 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: How can i fix this? (
/showthread.php?tid=304855)
How can i fix this? -
$$Money$$ - 20.12.2011
pawn Code:
if(dialogid==012012) {
if(response) {
if(listitem==0) { // Deagle
if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough Cash!");
GivePlayerWeapon(playerid,24,99999);
SendClientMessage(playerid, COLOR_PURPLE,"Desert Eagle purchased for $10000.");
}
if(listitem==1) { // MP5K
if(GetPlayerMoney(playerid) < 15000) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough Cash!");
GivePlayerWeapon(playerid,29,99999);
SendClientMessage(playerid, COLOR_PURPLE,"MP5 purchased for $15000.");
}
if(listitem==2) { // AK47
if(GetPlayerMoney(playerid) < 30000) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough Cash!");
GivePlayerWeapon(playerid,30,999999);
SendClientMessage(playerid, COLOR_PURPLE,"AK-47 purchased for $30000");
}
if(listitem==3) { // ARMOUR
if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough Cash!");
SetPlayerArmour(playerid,100.0);
SendClientMessage(playerid, COLOR_PURPLE,"Full Armour purchased for $5000.");
}
}
}
I buy a weapon from ammunation biz ..it say Desert eagle purchased for 10000..but my money is just the same value
Re: How can i fix this? -
Niko_boy - 20.12.2011
Quote:
Originally Posted by $$Money$$
pawn Code:
if(dialogid==012012) { if(response) { if(listitem==0) { // Deagle if(GetPlayerMoney(playerid) < 10000) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough Cash!"); GivePlayerWeapon(playerid,24,99999); SendClientMessage(playerid, COLOR_PURPLE,"Desert Eagle purchased for $10000."); } if(listitem==1) { // MP5K if(GetPlayerMoney(playerid) < 15000) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough Cash!"); GivePlayerWeapon(playerid,29,99999); SendClientMessage(playerid, COLOR_PURPLE,"MP5 purchased for $15000."); } if(listitem==2) { // AK47 if(GetPlayerMoney(playerid) < 30000) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough Cash!"); GivePlayerWeapon(playerid,30,999999); SendClientMessage(playerid, COLOR_PURPLE,"AK-47 purchased for $30000"); } if(listitem==3) { // ARMOUR if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough Cash!"); SetPlayerArmour(playerid,100.0); SendClientMessage(playerid, COLOR_PURPLE,"Full Armour purchased for $5000."); }
} }
I buy a weapon from ammunation biz ..it say Desert eagle purchased for 10000..but my money is just the same value
|
VERY LAME MISTAKE
You Must Add :-
HTML Code:
GivePlayerMoney(playerid, -10000);
-10000 is the amount of money whihc will be reduced when he buy gun
and u need to edit the
lines
if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough Cash!");
etc...
Edit:- u need to add those lines some where before dialog response , Like when player click that dialog id it return first verification of money then the dialog must appear
hope i am clear !!
Re: How can i fix this? -
$$Money$$ - 20.12.2011
Its a roleplay script..Its fixed..but the money return to its original value
Re: How can i fix this? -
Hoborific - 20.12.2011
1, Stop using an edit, 2, Get to know your anticheat, you obviously have to call a specific function to change money value.