SA-MP Forums Archive
Gate command retarted - 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: Gate command retarted (/showthread.php?tid=268669)



Gate command retarted - ColdIce - 13.07.2011

Wtf?! If I do /tinnogate it says Opening and it opens, then I do /tinnogate1 and it says Opening and nothing happens! What is wrong here?

pawn Код:
if(strcmp("/tinnogate", cmdtext, true, 10) == 0)
    {
        if(!IsPlayerLuxAdminLevel(playerid,3)) return SendClientMessage(playerid, 0xFF0000FF, "This Command Can Only Be Used By Authorized Person");
        {
            GameTextForPlayer(playerid, "Opening!", 3000, 4);
            MoveObject(tinno, 1286.86, -611.55, 106.62, 2.0);
        }
        return 1;
    }
    if(strcmp("/tinnogate1", cmdtext, true, 10) == 0)
    {
        if(!IsPlayerLuxAdminLevel(playerid,3)) return SendClientMessage(playerid, 0xFF0000FF, "This Command Can Only Be Used By Authorized Person");
        {
            GameTextForPlayer(playerid, "Closing!", 3000, 4);
            MoveObject(tinno, 1286.86, -611.55, 101.13, 2.0);
        }
        return 1;
    }



Re: Gate command retarted - iRana - 13.07.2011

Quote:
Originally Posted by ColdIce
Посмотреть сообщение
Wtf?! If I do /tinnogate it says Opening and it opens, then I do /tinnogate1 and it says Opening and nothing happens! What is wrong here?
0n /tinnogate1 it would say "Closing" as Your codes??


Re: Gate command retarted - ColdIce - 13.07.2011

It doesnt matter if I do /tinnogate or /tinnogate1, they both say Opening, but that does not make any sense


Re: Gate command retarted - Vero - 13.07.2011

I'm not entirely sure you can have numbers in a command (I could be wrong) change tinnogate1 to tinnoclose or something.


Re: Gate command retarted - ColdIce - 13.07.2011

I have made alot of commands like that and they are all something1 to close. They all work


Re: Gate command retarted - Skylar Paul - 13.07.2011

pawn Код:
if(strcmp("/tinnogate", cmdtext, true, 10) == 0)
    {
        if(!IsPlayerLuxAdminLevel(playerid,3)) return SendClientMessage(playerid, 0xFF0000FF, "This Command Can Only Be Used By Authorized Person");
        {
            GameTextForPlayer(playerid, "Opening!", 3000, 4);
            MoveObject(tinno, 1286.86, -611.55, 106.62, 2.0);
        }
        return 1;
    }
    else if(strcmp("/tinnogate1", cmdtext, true, 10) == 0)
    {
        if(!IsPlayerLuxAdminLevel(playerid,3)) return SendClientMessage(playerid, 0xFF0000FF, "This Command Can Only Be Used By Authorized Person");
        {
            GameTextForPlayer(playerid, "Closing!", 3000, 4);
            MoveObject(tinno, 1286.86, -611.55, 101.13, 2.0);
        }
        return 1;
    }
Just a guess.


Re: Gate command retarted - ColdIce - 13.07.2011

Fixed. Thanks though!


Re: Gate command retarted - Vince - 13.07.2011

Quote:
Originally Posted by Skylar Paul
Посмотреть сообщение
Just a guess.
That's a workaround, not a fix. The problem is in this line really:

if(strcmp("/tinnogate", cmdtext, true, 10) == 0)

This only compares the first 10 characters of the command, hence when you type /tinnogate1 (11 characters) it only compares to /tinnogate (10 characters). Just remove that last parameter from all commands and you should be fine.


Re: Gate command retarted - ColdIce - 13.07.2011

Ahhh didnt know that. Thank you very much!