[HELP!] With PAWNO! Plzzz
#1

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!
Reply
#2

Код:
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.
Reply
#3

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;
}
Reply
#4

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
Reply
#5

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?
Reply
#6

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)