Gate command retarted
#1

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

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??
Reply
#3

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

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

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

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

Fixed. Thanks though!
Reply
#8

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

Ahhh didnt know that. Thank you very much!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)