/Carhelp [1-3]
#1

Hey there, i've just read a guide how to create a command like /Carhelp 1 , and no /Carhelp1

The code:
pawn Код:
if(!strcmp(cmd, "/Carhelp", true))
    {
        tmp = strtok(cmdtext,idx);
        if(!strlen(tmp)) return SendClientMessage(playerid,0xff0000ff,"/Carhelp [1-3]");
        if(!strcmp(tmp,"1",true))
        {
/*          new tmp1[256],tmp2[256];
            tmp1 = strtok(cmdtext,idx);
            tmp2 = strtok(cmdtext,idx); */

            SendClientMessage(playerid,0x0099FFFF,"-------- [Vehicle/Car System!] --------");
            SendClientMessage(playerid,0x00FF00FF,"/Car - Information about a vehicle.");
            SendClientMessage(playerid,0x00FF00FF,"/Cars - Information with Statistics about the server vehicles.");
            SendClientMessage(playerid,0x00FF00FF,"/Buycar - To buy a vehicle.");
            SendClientMessage(playerid,0x00FF00FF,"/Sellcar - To sell your own vehicle.");
            SendClientMessage(playerid,0x00FF00FF,"/Callcar - To call your vehicle to your currect position.");
            SendClientMessage(playerid,0x0099FFFF,"-------- [Carhelp Page 1] --------");
        }
        if(!strcmp(tmp,"2",true))
        {
            SendClientMessage(playerid,0x0099FFFF,"-------- [Vehicle/Car System!] --------");
            SendClientMessage(playerid,0x00FF00FF,"/Watch[Car/off] - To spectate your vehicle.");
            SendClientMessage(playerid,0x00FF00FF,"/[Un]lock - To lock/unlock your vehicle.");
            SendClientMessage(playerid,0x00FF00FF,"/Resetcar - To reset your vehicle to his parking lot.");
            SendClientMessage(playerid,0x00FF00FF,"/Eject[All] - To eject a player from your vehicle.");
            SendClientMessage(playerid,0x0099FFFF,"-------- [Carhelp Page 2] --------");
        }
        if(!strcmp(tmp,"Deny",true))
        {

            SendClientMessage(playerid,0xff6600ff,"BLANK");
            return true;
        }
    }
The problem is the /Carhelp not working, and it's always saying '/Carhelp [1-3]' again and again.

Thanks for helpers!

*The deny it's just a temp till i'm done with the Page 2.
Reply
#2

Add these debug messages

pawn Код:
if(!strcmp(cmd, "/Carhelp", true))
    {
        tmp = strtok(cmdtext,idx);
        SendClientMessage(playerid,-1,cmdtext);
        SendClientMessage(playerid,-1,cmd);
        SendClientMessage(playerid,-1,tmp);
        if(!strlen(tmp)) return SendClientMessage(playerid,0xff0000ff,"/Carhelp [1-3]");
        if(!strcmp(tmp,"1",true))
Then try the command again and post here what you get.
Reply
#3

Here it is.


http://i.imgur.com/tcGzA.jpg
Reply
#4

Can you help me?
Reply
#5

The problem is not in this command, I think somewhere in OnPlayerCommandText before this command.
Reply
#6

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
The problem is not in this command, I think somewhere in OnPlayerCommandText before this command.
pawn Код:
if(!strcmp(cmd,"/flip",true) || !strcmp(cmd,"/flipcar",true))
    {
        if(dini_Int(pFile(playerid),"HaveCar") == 0 && !IsPlayerAdmin(playerid))return SendClientMessage(playerid,red,"You dont have vehicle");
        if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,red,"You dont drive on car");
        if(vehicleid != CarID(playerid) && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,red,"This is not your car");
        if(dini_Int(vFile(vehicleid),"sCar") == 0 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid,red,"For only special cars");
        GetVehiclePos(GetPlayerVehicleID(playerid),X,Y,Z);
        GetVehicleZAngle(GetPlayerVehicleID(playerid),Angle);
        SetVehiclePos(GetPlayerVehicleID(playerid),X,Y,Z+3);
        SetVehicleZAngle(GetPlayerVehicleID(playerid),Angle);
        PlayerPlaySound(playerid,1058,0.0,0.0,0.0);
        return SendClientMessage(playerid,yellow,"You fliped this car!");
    }
This is the command before the /carhelp.
Reply
#7

Can you show your OnPlayerCommandText in pastebin? (all that's before the /carhelp cmd)
Reply
#8

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
Can you show your OnPlayerCommandText in pastebin? (all that's before the /carhelp cmd)
It's about 600 lines all the OnPlayerCommandText, how much before do you mean? ((/Carhelp is the last command onplayercommandtext)).
Reply
#9

Put the /carhelp as first command. If it still don't work, then show everything before it.
Reply
#10

http://pastebin.com/JAabeda9

1000 lines not 600.

Command still not working as first command.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)