SA-MP Forums Archive
Need a "private" helper. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need a "private" helper. (/showthread.php?tid=314121)



Need a "private" helper. - Da' J' - 28.01.2012

Hello, so i'm asking here, if someone is interested to help me out with 2 things. Aka, 2 parts of codes. I can't figure them out, and no-one isn't helping me here. :S

It's just a quick thing, i think.


Re: Need a "private" helper. - Da' J' - 29.01.2012

No-one can't help me out? I don't ask for a scripter btw, i just ask for someone who can help me to fix a few bugs, that's all.


Re: Need a "private" helper. - Twix[KDZ] - 29.01.2012

Mabe i can be at help. Im not a super-scripter and stuff, but im learning it Just tell me when and what u need help for


Re: Need a "private" helper. - [KHK]Khalid - 29.01.2012

post your problems here so we can see about them!


Re: Need a "private" helper. - henry jiggy - 29.01.2012

You dont need a private helper unless your code is level 15346743058743975 classified by the government of the united states.

Post your code and someone will help you, or at least try.


Re: Need a "private" helper. - Da' J' - 31.01.2012

K.

Auto-crack - I try to put a player automticly on an animation when his health drops down in 25. And to get up, he should /getup to get up after 2 minutes, or get /helpup [ID]. Well, the commands aren't working. -_-
Code:
pawn Код:
#include a_samp

    enum crack2
    {
            bool: is_cracked,
            timer,
            c_down,
            bool:c_isover,
            Float:health
    };

    new crack[MAX_PLAYERS][crack2];

    forward Crack_Timer(playerid);
    forward Count_Down(playerid);

    public OnPlayerSpawn(playerid)
    {
            crack[playerid][is_cracked] = false;
            crack[playerid][c_isover] = false;
            crack[playerid][timer] = SetTimerEx("Crack_Timer",1500,true,"i",playerid);
            return 1;
    }
   
        public Crack_Timer(playerid)
    {
            GetPlayerHealth(playerid,crack[playerid][health]);
            if( (crack[playerid][health] <= 25) && (crack[playerid][is_cracked] == false) )
            {
                    crack[playerid][is_cracked] = true;
                    ApplyAnimation(playerid,"PED","KO_spin_L",2.8,0,1,1,1,0);
                    TogglePlayerControllable(playerid,false);
                    crack[playerid][c_down] = SetTimerEx("Count_Down", 5 * 60 * 1000, false, "i", playerid);
            }
            return 1;
    }

    public Count_Down(playerid)
    {
            if(crack[playerid][is_cracked] == true) {
            crack[playerid][c_isover] = true;
            KillTimer(crack[playerid][timer]);
            }
            return 1;
    }

    PlayerToPlayer(playerid,toplayerid)
    {
            new Float:pos[2][3];
            GetPlayerPos(playerid,pos[0][0],pos[0][1],pos[0][2]);
            GetPlayerPos(toplayerid,pos[1][0],pos[1][1],pos[1][2]);
            pos[0][0] -= pos[1][0];
            pos[0][1] -= pos[1][1];
            pos[0][2] -= pos[1][2];
            return floatround( floatsqroot( (floatpower(pos[0][0],2) + floatpower(pos[0][1],2) + floatpower(pos[0][2],2) ) ), floatround_round);
    }
   
    public OnPlayerCommandText(playerid, cmdtext[])
    {
            if(!strcmp(cmdtext,"/getup",true))
            {
                if( (crack[playerid][is_cracked] == true) && (crack[playerid][c_isover] == true))
                {
                    SendClientMessage(playerid, -1, "You got up!");
                    crack[playerid][is_cracked] = false;
                    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
                    TogglePlayerControllable(playerid,true);
                    KillTimer(crack[playerid][timer]);
                    KillTimer(crack[playerid][c_down]);
                    }
                return 1;
            }
            if(!strcmp(cmdtext,"/helpup",true,9))
            {
                if(!cmdtext[8]) SendClientMessage(playerid,-1,"USAGE: /helpup [ID]");
                else if (PlayerToPlayer(playerid,cmdtext[9]) >= 5) SendClientMessage(playerid,-1,"Player too far!");
                    else if( (crack[cmdtext[9]][is_cracked] == true) && (cmdtext[9] != playerid))
                    {
                        ApplyAnimation(playerid,"BOMBER","BOM_Plant",2.6,1,1,1,0,6800);
                        crack[cmdtext[9]][is_cracked] = false;
                        crack[cmdtext[9]][c_isover] = false;
                        KillTimer(crack[cmdtext[9]][timer]);
                        KillTimer(crack[cmdtext[9]][c_down]);
                        SetPlayerSpecialAction(cmdtext[9],SPECIAL_ACTION_NONE);
                    }
                return 1;
            }
            return 0;
}
Trunks - My faction trunks can be abled to be used by anyone. I want only ex. cops can only use the trunks of PD, some mafia can only use their trunks and no-one else could. Just don't know how to make this. :/
My codes are:
pawn Код:
IsACopCar(carid);
IsACop(playerid);