Merging FS with GM
#4

The functions PutRiotShieldOnArm(playerid) and RemoveItems(playerid) should be put outside the callbacks

Example:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/arm", cmdtext, true, 10) == 0)
    {
        if(PutRiotShieldOnArm(playerid))
        {
            if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
            SetPlayerAttachedObject(playerid, 1, 18637, 3, 0.3, -0.2, 0, 180, 170, 270, 1, 1, 1);
        }
            return 1;
    }
    if (strcmp("/armoff", cmdtext, true, 10) == 0)
    {
        if(RemoveItems(playerid))
        {
            if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
                if(IsPlayerAttachedObjectSlotUsed(playerid,2)) RemovePlayerAttachedObject(playerid,2);
        }
        return 1;
    }
    return 0;
}

PutRiotShieldOnArm(playerid)
{
    if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
    SetPlayerAttachedObject(playerid, 1, 18637, 3, 0.3, -0.2, 0, 180, 170, 270, 1, 1, 1);
    return 1;
}

RemoveItems(playerid)
{
    if(IsPlayerAttachedObjectSlotUsed(playerid,1)) RemovePlayerAttachedObject(playerid,1);
    if(IsPlayerAttachedObjectSlotUsed(playerid,2)) RemovePlayerAttachedObject(playerid,2);
}
Reply


Messages In This Thread
Merging FS with GM - by Kuruskt - 03.01.2011, 16:51
Re: Merging FS with GM - by HyperZ - 03.01.2011, 17:01
Re: Merging FS with GM - by Kuruskt - 03.01.2011, 18:05
Re: Merging FS with GM - by Patrik356b - 03.01.2011, 18:49

Forum Jump:


Users browsing this thread: 1 Guest(s)