[HELP] Stuning and arresting player!
#5

Quote:
Originally Posted by Jeffry
Посмотреть сообщение
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;
}
Give this error:
pawn Код:
C:\Users\Bruno\Downloads\GTA San Andreas\SAMP 0.3D\APB\apb.pwn(3765) : error 025: function heading differs from prototype
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
And btw, you forgot forward();




EDIT: Nvm, works! Thank you!
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: 3 Guest(s)