[HELP!] With PAWNO! Plzzz - 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: [HELP!] With PAWNO! Plzzz (
/showthread.php?tid=244814)
[HELP!] With PAWNO! Plzzz -
nateykurgan - 28.03.2011
Ok Guys Listen i wanna make something like this that when I teleport to For example San Fierro (/SF) i wanna make it to takeaway player money I want it to take away $3000 From Player but when i do "GivePlayerMoney(playerid, -3000" it sets the players money to -3000 i just want it to take away from wat the player has

plz help me!
Re: [HELP!] With PAWNO! Plzzz -
TheYoungCapone - 28.03.2011
Код:
if(strcmp(cmdtext,"/sf",true) == 0)
{
if(GetPlayerMoney(playerid)>=3000)
{
GivePlayerMoney(playerid, -3000);
SetPlayerPos(yourcords);
SetPlayerInterior(playerid, 0);
}
else
{
SendClientMessage(playerid,COLOR_DIS_RED,"You Don't have enough money! Need 3,000!");
}
return 1;
}
Indentation is all messed up you can fix that.
Re: [HELP!] With PAWNO! Plzzz -
omer5198 - 28.03.2011
Quote:
Originally Posted by TheYoungCapone
Код:
if(strcmp(cmdtext,"/sf",true) == 0)
{
if(GetPlayerMoney(playerid)>=3000)
{
GivePlayerMoney(playerid, -3000);
SetPlayerPos(yourcords);
SetPlayerInterior(playerid, 0);
}
else
{
SendClientMessage(playerid,COLOR_DIS_RED,"You Don't have enough money! Need 3,000!");
}
return 1;
}
Indentation is all messed up you can fix that.
|
i fixed the Indentation...
pawn Код:
if(strcmp(cmdtext,"/sf",true) == 0)
{
if(GetPlayerMoney(playerid)>=3000)
{
GivePlayerMoney(playerid, -3000);
SetPlayerPos(yourcords);
SetPlayerInterior(playerid, 0);
}
else
{
SendClientMessage(playerid,COLOR_DIS_RED,"You Don't have enough money! Need 3,000!");
}
return 1;
}
Re: [HELP!] With PAWNO! Plzzz -
nateykurgan - 31.03.2011
Quote:
Originally Posted by omer5198
i fixed the Indentation...
pawn Код:
if(strcmp(cmdtext,"/sf",true) == 0) { if(GetPlayerMoney(playerid)>=3000) { GivePlayerMoney(playerid, -3000); SetPlayerPos(yourcords); SetPlayerInterior(playerid, 0); } else { SendClientMessage(playerid,COLOR_DIS_RED,"You Don't have enough money! Need 3,000!"); } return 1; }
|
Yes but then it makes the player -$3000 and when he respawn he gets back to $0000000000
Re: [HELP!] With PAWNO! Plzzz -
Vince - 31.03.2011
Uhm no. Giving a negative value for GivePlayerMoney just subtracts that amount from the current player's money. If the player has $0 then the money will indeed go to -$3000, but if a player has - let's say - $6500 and you subtract $3000 from that, he'll end up with $3500. Simple, right?
Re: [HELP!] With PAWNO! Plzzz -
nateykurgan - 25.11.2011
Dude , but when i go /SF it teleports me there and it takes away $3000 , yea thats exactly what i wanted , but then, when the player has $0000000000 he is still able to teleport there. And another problem is that even if the player has for example $10000 and teleports there it still says "Sorry you do not have enough cash! cost, $3000