SA-MP Forums Archive
Changing scripts id - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Changing scripts id (/showthread.php?tid=257253)



Changing scripts id - ColdIce - 24.05.2011

Can someone teach me how to change script id? I cant find any tutorial that teaches that.

When I add Votekick script, then /v does not work. If I add speedometer, then /lmenu does not work, so I need to learn how to change that id so it will all work together. So, can someone please teach me this? And please, explain carefully


Re: Changing scripts id - [DM]Kane - 25.05.2011

OnPlayerCommandText callback in every script should return 0; in order make commands from every script work at the same time.


Re: Changing scripts id - ColdIce - 25.05.2011

So if I understand u correctly, I have a votekick fs that is not working with others. This is the code
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
    {
            if(!strcmp("/votekick", cmdtext, true))
            {
                    if(IsVoteKickStarted == true) return SendClientMessage(playerid, COLOR_ERROR,"[ERROR:] {BBBBBB}A votekick has been already started. Wait until it finish to ask for a new one");
                    ShowPlayerDialog(playerid, DIALOG_VOTEKICK, DIALOG_STYLE_INPUT, "{C14124}V{BBBBBB}otekick", "{BBBBBB}Type player's {C14124}ID{BBBBBB} or {C14124}Nick{BBBBBB} you want to votekick.", "VoteKick", "Cancel");
                    return 1;
            }
            return 1;
    }
Change that to

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
    {
            if(!strcmp("/votekick", cmdtext, true))
            {
                    if(IsVoteKickStarted == true) return SendClientMessage(playerid, COLOR_ERROR,"[ERROR:] {BBBBBB}A votekick has been already started. Wait until it finish to ask for a new one");
                    ShowPlayerDialog(playerid, DIALOG_VOTEKICK, DIALOG_STYLE_INPUT, "{C14124}V{BBBBBB}otekick", "{BBBBBB}Type player's {C14124}ID{BBBBBB} or {C14124}Nick{BBBBBB} you want to votekick.", "VoteKick", "Cancel");
                    return 1;
            }
            return 0;
    }
And then it will work?


Re: Changing scripts id - [DM]Kane - 26.05.2011

Hopefully, it will do.


Re: Changing scripts id - DRIFT_HUNTER - 26.05.2011

You talking about dialog ids or you have conflict with command processors?


Re: Changing scripts id - Babul - 26.05.2011

watch at the last post: http://forum.sa-mp.com/showthread.ph...t=loaded+stack ... i tried to "explain" it, if its causing your trouble... anyways it could be the same reason in the OnPlayerCommandText() callback. (having the OPCT returning in the last loaded FS) - if you entirely switch to ZCMD, this wont happen anymore