11.04.2011, 12:50
Hello, I got a problem with GivePlayerMoney. When i buy something. i dont loose money. I recive money instead.
This is my dialogid where you buy stuff from
What is the problem lol?
it gives money instead of taking
This is my dialogid where you buy stuff from
pawn Код:
if(dialogid == WEAPON) // Credits to Etch for making half & Credits to AlexzzPro for making the other half.
{
if(response)
{
if(listitem == 0) //Knife
{
if(GetPlayerMoney(playerid) < 200)
{
EnoughMoney(playerid,200);
}
else
{
GivePlayerWeapon(playerid,4,1);
SendClientMessage(playerid,COLOR_YELLOW,"You've Succesfully Bought A Knife (200$)");
GivePlayerMoney(playerid,-200);
}
}
if(listitem == 1) //Deagle
{
if(response)
{
if(GetPlayerMoney(playerid) < 500)
{
EnoughMoney(playerid,500);
}
else
{
GivePlayerWeapon(playerid,24,50);
SendClientMessage(playerid,COLOR_YELLOW,"You've Succesfully Bought A Desert Eagle (500$)");
GivePlayerMoney(playerid,-500);
}
}
}
if(listitem == 2) //MP5
{
if(response)
{
if(GetPlayerMoney(playerid) < 1000)
{
EnoughMoney(playerid,1000);
}
else
{
GivePlayerWeapon(playerid,29,200);
SendClientMessage(playerid,COLOR_YELLOW,"You've Succesfully Bought A MP5 (1000$)");
GivePlayerMoney(playerid,-1000);
}
}
}
if(listitem == 3) //M4
{
if(response)
{
if(GetPlayerMoney(playerid) < 1000)
{
EnoughMoney(playerid,1000);
}
else
{
GivePlayerWeapon(playerid,31,200);
SendClientMessage(playerid,COLOR_YELLOW,"You've Succesfully Bought A M4 (1000$)");
GivePlayerMoney(playerid,-1000);
}
}
}
if(listitem == 4) //AK47
{
if(response)
{
if(GetPlayerMoney(playerid) < 1300)
{
EnoughMoney(playerid,1300);
}
else
{
GivePlayerWeapon(playerid,30,200);
SendClientMessage(playerid,COLOR_YELLOW,"You've Succesfully Bought A AK-47 (1300$)");
GivePlayerMoney(playerid,-1300);
}
}
}
if(listitem == 5) //Sniper
{
if(response)
{
if(GetPlayerMoney(playerid) <1500)
{
EnoughMoney(playerid,1500);
}
else
{
GivePlayerWeapon(playerid, 34, 40);
SendClientMessage(playerid,COLOR_YELLOW,"You've Succesfully Bought A Sniper (1500$)");
GivePlayerMoney(playerid,-1500);
}
}
}
if(listitem == 6) //Shotgun
{
if(response)
{
if(GetPlayerMoney(playerid) <1000)
{
EnoughMoney(playerid,1000);
}
else
{
GivePlayerWeapon(playerid, 25,50);
SendClientMessage(playerid,COLOR_YELLOW,"You've Succesfully Bought A Shotgun (1000$)");
GivePlayerMoney(playerid,-1000);
}
}
}
if(listitem == 7) //Grenades
{
if(response)
{
if(GetPlayerMoney(playerid) <800)
{
EnoughMoney(playerid,800);
}
else
{
GivePlayerWeapon(playerid,16,10);
SendClientMessage(playerid,COLOR_YELLOW,"You've Succesfully Bought 10 Grenades (800$)");
GivePlayerMoney(playerid,-800);
}
}
}
if(listitem == 8) //Bombs
{
if(response)
{
if(GetPlayerMoney(playerid) <1000)
{
EnoughMoney(playerid,1000);
}
else
{
GivePlayerWeapon(playerid,39,8);
SendClientMessage(playerid,COLOR_YELLOW,"You've Succesfully Bought 8 bombs (1000$)");
GivePlayerMoney(playerid,GetPlayerMoney(playerid)-1000);
}
}
}
}
}
return 1;
}
it gives money instead of taking