[HELP] Stuning and arresting player!
#3

Try this:

pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid) //Works
{
    if(Enforcer[playerid] == 1)
    {
        if(GetPlayerWeapon(playerid) == 33)
        {
            StunPlayer(damagedid);
            SetTimerEx("StunTime",7000,false,"d",damagedid);
        }
        return 1;
    }
    return 0;
}

public StunTime(damagedid) //Works
{
    if(Stuned[damagedid] == 1)
    {
        TogglePlayerControllable(damagedid,1);
        Stuned[damagedid] = 0;
        ClearAnimations(damagedid);
        return 1;
    }
    return 1;
}
COMMAND:arrest(playerid, params[]) //Dont works
{
    new stunedid;
    if (Enforcer[playerid] == 1)
    {
        if (strlen(params)>0)
        {
          stuneid = strval(params);
          if (Stuned[stunedid] == 1) //This is the problem
          {
            SetPlayerScore(stunedid,GetPlayerScore(stunedid)-10);
            GivePlayerMoney(stunedid,-10000);
            new rand = random(sizeof(RandomCrimSpawns));
            SetPlayerPos(stunedid, RandomCrimSpawns[rand][0], RandomCrimSpawns[rand][1], RandomCrimSpawns[rand][2]);
            SetPlayerFacingAngle(stunedid, RandomCrimSpawns[rand][3]);
            SetCameraBehindPlayer(stunedid);
            SendClientMessage(stunedid,GCOLOR_GREY,"* You have been arrested! You lost 10000$ and 10 Score");
            SetPlayerScore(playerid,GetPlayerScore(playerid)+10);
            GivePlayerMoney(playerid,10000);
            SendClientMessage(stunedid,GCOLOR_GREY,"* You arrested Criminal and received 10000$ and 10 Score");
          }
          else SendClientMessage(playerid, GCOLOR_RED, "ERROR: That player is not stunned!");
        }
        else SendClientMessage(playerid, GCOLOR_RED, "Usage: /arrest <stuned-playerid>");
    }
    else SendClientMessage(playerid, GCOLOR_RED, "ERROR: Only Enforcers can use this command!");
    return 1;
}
Reply


Messages In This Thread
[HELP] Stuning and arresting player! - by fiki574 - 22.12.2011, 17:25
Re: [HELP] Stuning and arresting player! - by wildcookie007 - 22.12.2011, 17:28
Re: [HELP] Stuning and arresting player! - by Jeffry - 22.12.2011, 17:31
Re: [HELP] Stuning and arresting player! - by fiki574 - 22.12.2011, 17:31
Re: [HELP] Stuning and arresting player! - by fiki574 - 22.12.2011, 17:34
Re: [HELP] Stuning and arresting player! - by Jeffry - 22.12.2011, 18:07

Forum Jump:


Users browsing this thread: 1 Guest(s)