SA-MP Forums Archive
Special Action. - 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: Special Action. (/showthread.php?tid=400759)



Special Action. - JaKe Elite - 20.12.2012

How do i play the dancing special action with out clicking the button "<<" or ">>" in the Request Class.

I set player's special action. BUT. it doesn't play. It only play when i press "<<" or ">>".

How do i play it without clicking the buttons?


Re: Special Action. - eesh - 20.12.2012

Isnt Dancing an Animation? SetPlayerAnimation in OnPlayerRequestClass


Re: Special Action. - JaKe Elite - 20.12.2012

^^

SetPlayerANimation doesn't exist.
It's applyanimation. And no i don't want to play any animation. I like to play special actions.


Re: Special Action. - eesh - 20.12.2012

Quote:
Originally Posted by Romel
Посмотреть сообщение
^^

SetPlayerANimation doesn't exist.
It's applyanimation. And no i don't want to play any animation. I like to play special actions.
Yeah im sorry. I came back after months XD so i dont remember most of the functions properly.

try setting it to dance then none then dance again?
sometimes functions dont work when used once (like ApplyAnimation)


Re: Special Action. - iggy1 - 20.12.2012

Could you show what code you already have? I'd try this:

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerSpecialAction( playerid, SPECIAL_ACTION_DANCE1 );
    //rest of stuff
    return 1;
}
Having to assume you haven't already tried it.


Re: Special Action. - JaKe Elite - 20.12.2012

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    PlayerPlaySound(playerid, 1185, 0.0, 0.0, 0.0);
    SetPlayerPos(playerid, 1981.4408,-2105.0007,13.3446);
    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE1);
    SetPlayerFacingAngle(playerid, 91.0592);
    SetPlayerCameraPos(playerid, 1975.1997,-2105.1047,13.3705);
    SetPlayerCameraLookAt(playerid, 1981.4408,-2105.0007,13.3446);
    return 1;
}

public OnPlayerConnect(playerid)
{
    new str[356], ip[16];
    new color = random(sizeof(Colors));
    for(new i=0;i<47;i++) Weapon[playerid][i] = false;
    SetPlayerColor(playerid, COLOR_WHITE);
    SetPlayerColor(playerid, Colors[color]);
    GetPlayerIp(playerid, ip, sizeof(ip));
    pInfo[playerid][Admin] = 0;
    pInfo[playerid][VIP] = 0;
    pInfo[playerid][Banned] = 0;
    pInfo[playerid][Cookies] = 1;
    pInfo[playerid][Logged] = 0;
    pInfo[playerid][Seconds] = 0;
    pInfo[playerid][Minutes] = 0;
    pInfo[playerid][Hours] = 0;
    pInfo[playerid][Spawn] = 0;
    SetPlayerScore(playerid, 0);
    pInfo[playerid][Score] = 1;
    hasBeenPast[playerid] = 0;
    pInfo[playerid][Duty] = 0;
    SetPlayerScore(playerid, pInfo[playerid][Score]);
    ResetPlayerCash(playerid);
    pInfo[playerid][Money] = 100000;
    GivePlayerCash(playerid, pInfo[playerid][Money]);
    pInfo[playerid][Kills] = 0;
    ABike[playerid] = 1;
    SB[playerid] = 1;
    God[playerid] = 0;
    pInfo[playerid][Deaths] = 0;
    SetTimerEx("UpdateGamePlay", 1000, true, "i", playerid);
    SendClientMessage(playerid, -1, " ");
    GameTextForPlayer(playerid, "~w~Stunt ~g~4 ~w~Life!!", 3500, 6);
    format(str, sizeof(str), "* %s has been connected to Stunt 4 Life!!", GetName(playerid));
    SendClientMessageToAll(COLOR_LIME, str);
    TextDrawShowForPlayer(playerid, Textdraw0);
    TextDrawShowForPlayer(playerid, Textdraw1);
    TextDrawShowForPlayer(playerid, Textdraw2);
    TextDrawShowForPlayer(playerid, Textdraw3);
    SendClientMessage(playerid, COLOR_ORANGE, "Weclome to [ Stunt 4 Life ] :: Fun never ends of Stunts!!");
    SendClientMessage(playerid, COLOR_YELLOW, "Server owned by Jake, JellalKoayz and BRevoK");
    SendClientMessage(playerid, -1, "/help or /cmds for information or commands.");
    SendClientMessage(playerid, COLOR_YELLOW, "Fun starts now..");
    SendClientMessage(playerid, -1, " ");
    if(fexist(Path(playerid)))
    {
        INI_ParseFile(Path(playerid), "loadaccount_user", .bExtra = true, .extra = playerid);
        if(pInfo[playerid][Banned] == 1)
        {
            for(new x = 0; x < 100; x++)
            SendClientMessage(x, COLOR_WHITE, " ");
            SendClientMessage(playerid, COLOR_RED, "You're banned from this server");
            SendClientMessage(playerid, COLOR_RED, "Create a ban appeal to unban yourself!");
            SendClientMessage(playerid, COLOR_WHITE, "Kicked!");
            Kick(playerid);
            return 1;
        }
        for(new i=0; i < IpBanned; i++)
        {
            if(!strcmp(ib[i], ip, true))
            {
                for(new x = 0; x < 100; x++)
                SendClientMessage(x, COLOR_WHITE, " ");
                SendClientMessage(playerid, COLOR_RED, "You're banned from this server");
                SendClientMessage(playerid, COLOR_RED, "Create a ban appeal to unban yourself!");
                SendClientMessage(playerid, COLOR_WHITE, "Kicked!");
                Kick(playerid);
                return 1;
            }
        }
        if(!strcmp(ip, pInfo[playerid][Ip]))
        {
            INI_ParseFile(Path(playerid), "loadaccount_user", .bExtra = true, .extra = playerid);
            SetPlayerScore(playerid, pInfo[playerid][Score]);
            ResetPlayerMoney(playerid);
            GivePlayerCash(playerid, pInfo[playerid][Money]);
            pInfo[playerid][Logged] = 1;
            format(str, sizeof(str), "Welcome back, %s, You've been automatically logged in!", GetName(playerid));
            SendClientMessage(playerid, COLOR_LIME, str);
            format(str, sizeof(str), "You've been online for %i hours, %i minutes, %i seconds", pInfo[playerid][Hours], pInfo[playerid][Minutes], pInfo[playerid][Seconds]);
            SendClientMessage(playerid, COLOR_YELLOW, str);
            if(pInfo[playerid][Admin] >= 1)
            {
                new AdminRank[71];
                switch(pInfo[playerid][Admin])
                {
                    case 1: AdminRank = "Moderator";
                    case 2: AdminRank = "Administrator";
                    case 3: AdminRank = "Junior Administrator";
                    case 4: AdminRank = "Senior Administrator";
                    case 5: AdminRank = "Server Manager";
                }
                format(str, sizeof(str), "AdminLog: %s %s(%d) has been automatically logged in!", AdminRank, GetName(playerid), playerid);
                SendClientMessageToAll(COLOR_LIME, str);
                new Text3D:Tag = Create3DTextLabel(AdminRank, COLOR_WHITE, 30.0, 40.0, 50.0, 40.0, 0);
                Attach3DTextLabelToPlayer(Tag, playerid, 0.0, 0.0, 0.7);
            }
            if(pInfo[playerid][VIP] >= 1)
            {
                new AdminRank[71];
                switch(pInfo[playerid][VIP])
                {
                    case 1: AdminRank = "Bronze VIP";
                    case 2: AdminRank = "Silver VIP";
                    case 3: AdminRank = "Gold VIP";
                }
                format(str, sizeof(str), "VipLog: %s %s(%d) has been automatically logged in!", AdminRank, GetName(playerid), playerid);
                SendClientMessageToAll(COLOR_ORANGE, str);
                new Text3D:Tag = Create3DTextLabel(AdminRank, COLOR_WHITE, 30.0, 40.0, 50.0, 40.0+1, 0);
                Attach3DTextLabelToPlayer(Tag, playerid, 0.0, 0.0, 0.7);
            }
            return 1;
        }
        format(str, sizeof(str), ""white"Welcome back %s to Stunt 4 Life,\n\nThis account is registered, Please insert your\npassword to login to your account!\nIf you're not the owner of this account.\nPlease leave the game. And use your own username.", GetName(playerid));
        ShowPlayerDialog(playerid, Login, DIALOG_STYLE_PASSWORD, ""white"Login", str, "Login", "Exit");
    }
    else
    {
        format(str, sizeof(str), ""white"Welcome %s to Stunt 4 Life,\n\nThis account is not registered, Please\ninsert your own password to create your own account!", GetName(playerid));
        ShowPlayerDialog(playerid, Register, DIALOG_STYLE_PASSWORD, ""white"Register", str, "Register", "Exit");
    }
    GetPlayerIp(playerid, pInfo[playerid][Ip], 16);
    return 1;
}



Re: Special Action. - Lordzy - 20.12.2012

The request class you did was right but sometimes it occur clashes while switching class selection.(If using some changes for each class), so it'd be good if you add the action for each class too.