Car color command.
#1

Okay so bear with me here, I've tried pretty much everything I can think of to get this command working, it's only this command and nothing else. The script is:

pawn Код:
CMD:cc( playerid, params[ ] )
    {
    new ColorID, ColorID2, vehicleid, str[75];
    if(sscanf(params, "dd", ColorID,ColorID2)) return SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Usage:{FFFFFF} /cc (colorid1) (colorid2)");
    else if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFAA, "{ff0000}Error: {ffffff}You are not in a vehicle!");
    else if(ColorID < 0 && ColorID > 126) return SendClientMessage(playerid, 0xFF0000AA, "{FF0000}(!){CCCCCC}CarColor1 cannot be above 126 or below 0!");
    else if(ColorID2 < 0 && ColorID2 > 126) return SendClientMessage(playerid, 0xFF0000AA, "{FF0000}(!){CCCCCC}CarColor2 cannot be above 126 or below 0!");
    else
    {
        vehicleid = GetPlayerVehicleID(playerid);
        ChangeVehicleColor(vehicleid, ColorID, ColorID2);
        format(str, sizeof(str),"{FF0000}(!) {CCCCCC}Car Color changed.",ColorID, ColorID2);
        SendClientMessage(playerid, 0x1B62E4FF, str);
    }
    return 1;
}
Basically what happens after the command has been executed using the criteria it requires, it will just repeat the message telling you to type /cc (colorid1) (colorid2) even though I've already typed /cc 1 1 or any other number. Some help would be greatly appreciated, if anything else is required to solve this then please let me know, thanks and peace.
Reply
#2

The car color won't change? And under which call back did you type this?
Reply
#3

I'm using ZCMD as my command processor so I don't use any callbacks, and nothing happens when the command is executed, just the message repeating itself every time the command is typed, with the /cc or /cc color color.
Reply
#4

it works fine in my localhost server.

Have you updated your sscanf plugin and it's includes to lastest version?
Reply
#5

Try this:

Код:
CMD:cc( playerid, params[ ] )
    {
    new ColorID, ColorID2, vehicleid, str[75];
    if(sscanf(params, "dd", ColorID,ColorID2)) return SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Usage:{FFFFFF} /cc (colorid1) (colorid2)");
    else if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFAA, "{ff0000}Error: {ffffff}You are not in a vehicle!");
    else if(ColorID < 0 && ColorID > 126) return SendClientMessage(playerid, 0xFF0000AA, "{FF0000}(!){CCCCCC}CarColor1 cannot be above 126 or below 0!");
    else if(ColorID2 < 0 && ColorID2 > 126) return SendClientMessage(playerid, 0xFF0000AA, "{FF0000}(!){CCCCCC}CarColor2 cannot be above 126 or below 0!");
    else
    {
        vehicleid = GetPlayerVehicleID(playerid);
        ChangeVehicleColor(vehicleid, ColorID, ColorID2);
        format(str, sizeof(str),"{FF0000}(!) {CCCCCC}Car Color changed.",ColorID, ColorID2);
        SendClientMessage(playerid, 0x1B62E4FF, str);
    }
    return 0;
}
Reply
#6

Well I've just noticed that on my server console I get this after entering the command:

pawn Код:
sscanf error: System not initialised.
Does this mean that it's out of date, and if so could you please give me a link to the latest version, thanks.
Reply
#7

Quote:
Originally Posted by SA-MPDrifter
Посмотреть сообщение
Well I've just noticed that on my server console I get this after entering the command:

pawn Код:
sscanf error: System not initialised.
Does this mean that it's out of date, and if so could you please give me a link to the latest version, thanks.
https://sampforum.blast.hk/showthread.php?tid=120356
Reply
#8

Quote:

sscanf error: System not initialised.

Quote:
Originally Posted by sscanf's thread by ******
If you get this error, you need to make sure that you have recompiled ALL your scripts using the LATEST version of "sscanf2.inc". Older versions didn't really require this as they only had two natives - "sscanf" and "unformat", the new version has some other functions - you don't need to worry about them, but you must use "sscanf2.inc" so that they are correctly called. If you think you have done this and STILL get the error then try again - make sure you are using the correct version of PAWNO for example.
sscanf's Thread: https://sampforum.blast.hk/showthread.php?tid=120356
Download sscanf (v2.6): http://dl.dropbox.com/u/21683085/sscanf.rar
Reply
#9

And the include?
Reply
#10

Quote:
Originally Posted by SA-MPDrifter
Посмотреть сообщение
And the include?
Everything is inside the package, download and extract.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)