SA-MP Forums Archive
Unexpected Anim - 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: Unexpected Anim (/showthread.php?tid=432842)



Unexpected Anim - JSkulloz - 24.04.2013

Conditions:
timertest.pwn - Gamemode - Provided with the SAMP Server Package
new.pwn - Has just one animation /sit

Thats all!!
new.pwn
Код:
      // This is a comment
            // uncomment the line below if you want to write a filterscript
            #define FILTERSCRIPT

            #include <a_samp>

            #if defined FILTERSCRIPT

            public OnFilterScriptInit()
            {
                    print("\n--------------------------------------");
                    print(" Blank Filterscript by your name here");
                    print("--------------------------------------\n");
                    return 1;
            }

            public OnFilterScriptExit()
            {
                    return 1;
            }

            #else

            main()
            {
                    print("\n----------------------------------");
                    print(" Blank Gamemode by your name here");
                    print("----------------------------------\n");
            }

            #endif

        /*    public OnGameModeInit()
            {
                     Don't use these lines if it's a filterscript
                    SetGameModeText("Blank Script");
                    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
                    return 1;
            }*/

            public OnGameModeExit()
            {
                    return 1;
            }

            public OnPlayerRequestClass(playerid, classid)
            {
                    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
                    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
                    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
                    return 1;
            }

            public OnPlayerConnect(playerid)
            {
                    return 1;
            }

            public OnPlayerDisconnect(playerid, reason)
            {
                    return 1;
            }

            public OnPlayerSpawn(playerid)
            {
    ApplyAnimation(playerid,"CRACK","null",0.0,0,0,0,0,0);
    ApplyAnimation(playerid,"PARK","null",0.0,0,0,0,0,0);
    ApplyAnimation(playerid,"DEALER","null",0.0,0,0,0,0,0);
    ApplyAnimation(playerid,"INT_HOUSE","null",0.0,0,0,0,0,0);
    ApplyAnimation(playerid,"BEACH","null",0.0,0,0,0,0,0);
    ApplyAnimation(playerid,"ON_LOOKERS","null",0.0,0,0,0,0,0);
    ApplyAnimation(playerid,"COP_AMBIENT","null",0.0,0,0,0,0,0);
    ApplyAnimation(playerid,"SMOKING","null",0.0,0,0,0,0,0);
    ApplyAnimation(playerid,"SHOP","null",0.0,0,0,0,0,0);
    ApplyAnimation(playerid,"FOOD","null",0.0,0,0,0,0,0);
    ApplyAnimation(playerid,"DEALER","null",0.0,0,0,0,0,0);
    ApplyAnimation(playerid,"BOMBER","null",0.0,0,0,0,0,0);
    ApplyAnimation(playerid,"RAPPING","null",0.0,0,0,0,0,0);
    ApplyAnimation(playerid,"CARRY","null",0.0,0,0,0,0,0);
    return 1;
            }

            public OnPlayerDeath(playerid, killerid, reason)
            {
                    return 1;
            }

            public OnVehicleSpawn(vehicleid)
            {
                    return 1;
            }

            public OnVehicleDeath(vehicleid, killerid)
            {
                    return 1;
            }

            public OnPlayerText(playerid, text[])
            {
                return 1;
            }

            public OnPlayerCommandText(playerid, cmdtext[])
            {
                    if (!strcmp("/sit", cmdtext, true) == 0)
                    {
                            ApplyAnimation(playerid,"BEACH", "bather", 4.0, 1, 0, 0, 0, 0, 1); // Animation.
                            return 1;
                    }
                    return 0;
            }
Problem/Bug:
When I type /rconlogin an anim comes

Solutions Tried:
Reinstalled SAMP and running the latest version of SAMP


Re: Unexpected Anim - M3hdi - 27.04.2013

Probably just a one time bug did you try it again?


AW: Unexpected Anim - BigETI - 27.04.2013

http://forum.sa-mp.com/forumdisplay.php?f=12


Re: Unexpected Anim - Dan.. - 27.04.2013

This is the problem:
Код:
if (!strcmp("/sit", cmdtext, true) == 0)
Fixes:
Код:
if (strcmp("/sit", cmdtext, true) == 0)
or
Код:
if (!strcmp("/sit", cmdtext, true))



Re: Unexpected Anim - FFX - 27.04.2013

Considering you are at the start of creating your own gamemode. Highly suggest you to be using a professional and a fast command processor, in your case, your command processor is very slow.

Take a look at zcmd. More user-friendly, and less complicated.


Re: Unexpected Anim - Basssiiie - 27.04.2013

Quote:
Originally Posted by FFX
Посмотреть сообщение
Considering you are at the start of creating your own gamemode. Highly suggest you to be using a professional and a fast command processor, in your case, your command processor is very slow.
What he's using isn't slow. In fact, this is a lot quicker than ZCMD. ZCMD is only quicker when you have a lot of commands in the same script. He has only one command.

The difference here is that when you type a command without ZCMD, it has to compare your command with every other command available. But when you do use something like ZCMD, it directly calls the correct command without comparing it to all the other commands. If there's only one command to compare, using just strcmp is a lot quicker than ZCMD.