Unexpected Anim
#1

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
Reply
#2

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

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

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

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.
Reply
#6

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.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)