CreatePickup [money]
#1



about this photo, how can i make instead of wanted level i put for example, deagle, how do I make that you can only have that deagle if you have $1000, if not, it'll say you don't have enough money to get & buy a deagle, whatever, how do I make that?
Reply
#2

Click me !
Click me !
Reply
#3

Thanks but, actually I want if you have $1000, and if you pass by the icon you'll get the weapon.
But if you don't have $1000, it'll say you do not have enough money to take this weapon. How do I make that?
Reply
#4

PHP код:
if(!GetPlayerMoney(playerid) == 1000) return SendClientMessage(playeridYOURCOLORHERE"You do not have enough money to take this weapon."); 
Reply
#5

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == pickup_hp)
    {

        SetPlayerHealth(playerid, 100);
        GivePlayerMoney(playerid, -1000);
        PlayerPlaySound(playerid,4203,0.0,0.0,0.0);
    }
    return 1;
I got like this, where do I add this:
pawn Код:
if(!GetPlayerMoney(playerid) == 1000) return SendClientMessage(playerid, YOURCOLORHERE, "You do not have enough money to take this weapon.");
?
Reply
#6

PHP код:
public OnPlayerPickUpPickup(playeridpickupid)
{
    if(
pickupid == pickup_hp)
    {
        if(!
GetPlayerMoney(playerid) >= 1000) return SendClientMessage(playeridYOURCOLORHERE"You do not have enough money to take this weapon.");
        
SetPlayerHealth(playerid100);
        
GivePlayerMoney(playerid, -1000);
        
PlayerPlaySound(playerid,4203,0.0,0.0,0.0);
    }
    return 
1;

And i made little mistake, >= not ==. (Fixed)
Reply
#7

Thanks, one more question, how do I make, when the player gets killed, he drops everything, like a pickups, for health, sawnoff, deagle everything that he had, so when I pass their pickups, i get their weapons,health and others. Please help
Thanks.
Reply
#8

And by the way I get this warning
pawn Код:
warning 213: tag mismatch
on this:
pawn Код:
if(!GetPlayerMoney(playerid) >= 1000) return SendClientMessage(playerid, YOURCOLORHERE, "You do not have enough money to take this weapon.");
Why?
Of course I set "COLOR_WHITE" after SCM, but it's not that problem.
Reply
#9

Quote:
Originally Posted by Aleksabre
Посмотреть сообщение
Thanks, one more question, how do I make, when the player gets killed, he drops everything, like a pickups, for health, sawnoff, deagle everything that he had, so when I pass their pickups, i get their weapons,health and others. Please help
Thanks.
I'll give you example for that , it should be like that
Код:
public OnPlayerDeath
Use create hp pickup and use onplayerpickuppickup SetPlayerHealth(playerid,100);
I hope you understand me.
Reply
#10

Quote:
Originally Posted by Aleksabre
Посмотреть сообщение
And by the way I get this warning
pawn Код:
warning 213: tag mismatch
on this:
pawn Код:
if(!GetPlayerMoney(playerid) >= 1000) return SendClientMessage(playerid, YOURCOLORHERE, "You do not have enough money to take this weapon.");
Why?
Of course I set "COLOR_WHITE" after SCM, but it's not that problem.
Suggestion to use GameText instead of SendClientMessage because it will spam out your chat use this
pawn Код:
if(GetPlayerMoney(playerid) < 1000) return GameTextForPlayer(playerid,"~r~You don't have enough money to buy hp",3000,5);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)