Creating a new function
#6

pawn Код:
GetPlayerWeed(playerid) return Weed[playerid];
That will return how much weed the player has.

Edit:
pawn Код:
GetPlayerWeed(playerid) return Weed[playerid];
CMD:smokeweed(playerid, params[])
{
    new string[128];
    if(GetPlayerWeed(playerid) == 0) return SendClientMessage(playerid, WHITE, "You do not have any weed seeds!");
    if(GetPlayerWeed(playerid) >= 1)
    {
        ApplyAnimation(playerid, "JST_BUISNESS", "smoke_01", 4.1, 1, 1, 1, 0, 1, 1);
        new Float:health;
        GetPlayerHealth(playerid, health);
        //if(health > 60) return SendClientMessage(playerid, WHITE, "You cannot smoke weed if your health is 60 or above!");
        SetPlayerHealth(playerid, health+25);
        format(string, sizeof(string), "%s takes out a joint and smokes some weed.", GetOOCName(playerid));
        SendNearByMessage(playerid, ACTION_COLOR, string, 4);
    }
    return 1;
}
Reply


Messages In This Thread
Creating a new function - by Josh_Main - 29.09.2014, 14:57
Re: Creating a new function - by MasonSFW - 29.09.2014, 15:05
Re: Creating a new function - by Josh_Main - 29.09.2014, 15:12
Re: Creating a new function - by Stinged - 29.09.2014, 15:21
Re: Creating a new function - by Josh_Main - 29.09.2014, 15:25
Re: Creating a new function - by awsomedude - 29.09.2014, 15:27
Re: Creating a new function - by Stinged - 29.09.2014, 15:31
Re: Creating a new function - by Josh_Main - 29.09.2014, 16:26
Re: Creating a new function - by DavidBilla - 29.09.2014, 18:15

Forum Jump:


Users browsing this thread: 2 Guest(s)