Why does /smokeweed work when got no weed?
#5

Quote:
Originally Posted by DavidBilla
Посмотреть сообщение
pawn Код:
GetPlayerWeed(playerid) return Weed[playerid];

CMD:agiveweed(playerid, params[])                                
{
    new targetid, string[128], amount;
    if(PlayerStat[playerid] [AdminLevel] < 2) return SendClientMessage(playerid, GREY, "You don't have access to this command!");
    if(sscanf(params, "ud[128]", targetid, amount)) return SendClientMessage(playerid, GREY, "USAGE: /agiveweed [playerid] [amount]");
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, GREY, "That player is not connected!");
    else
    {
        GetPlayerWeed(playerid);
        Weed[targetid] = amount+1;
        format(string, sizeof(string), "You have given %s %d gram(s) of weed!", GetOOCName(targetid), amount);
        SendClientMessage(playerid, WHITE, string);
        format(string, sizeof(string), "Administrator %s has given you %d gram(s) of weed!", GetOOCName(playerid), amount);
        SendClientMessage(targetid, WHITE, string);
        AdminActionLog(string);
    }
    return 1;
}

   
CMD:smokeweed(playerid, params[])
{
    if(GetPlayerWeed(playerid) < 1 ) return SendClientMessage(playerid, WHITE, "You don't have any weed left!");
    else
        {
            new Float:health;
            if(GetPlayerHealth(playerid, health) > 75) return SendClientMessage(playerid, WHITE, "You cannot smoke weed if your health is above 75!");
            else
            {
                new string[128];
                ApplyAnimation(playerid, "JST_BUISNESS", "smoke_01", 4.1, 1, 1, 1, 0, 1, 1);
                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;                              
}
This will work
But i just messed up the intendation since I'm on mobile
Still lets you /smokeweed as much as you want even if the admin only gives you 1 gram
Reply


Messages In This Thread
Why does /smokeweed work when got no weed? - by Josh_Main - 29.09.2014, 16:48
Re: Why does /smokeweed work when got no weed? - by DavidBilla - 29.09.2014, 17:14
Re: Why does /smokeweed work when got no weed? - by Kyance - 29.09.2014, 17:31
Re: Why does /smokeweed work when got no weed? - by Josh_Main - 30.09.2014, 02:31
Re: Why does /smokeweed work when got no weed? - by Josh_Main - 30.09.2014, 02:35
Re: Why does /smokeweed work when got no weed? - by [CG]Milito - 30.09.2014, 03:23
Re: Why does /smokeweed work when got no weed? - by Josh_Main - 01.10.2014, 05:57
Re: Why does /smokeweed work when got no weed? - by Stinged - 01.10.2014, 06:05

Forum Jump:


Users browsing this thread: 2 Guest(s)