Posts: 50
Threads: 19
Joined: Oct 2015
Reputation:
0
18.02.2017, 08:02
(
Последний раз редактировалось UnholyBeast; 18.02.2017 в 21:50.
)
Alright. I'm trying to make a command that changes both colors of your current vehicle, but the command stops and returns nothing if you use /carcolor 4 5. It only works if you use /carcolor 4.
CODE REMOVED
Posts: 570
Threads: 55
Joined: Oct 2016
PHP код:
CMD:carcolor(playerid, params[])
{
if(GetPlayerState(playerid) != 2) return SendClientMessage(playerid, 0xFF0000FF, "You are not driving a vehicle.");
new color[2];
if(sscanf(params, "iI(-1)", color[0], color[1]))
{
return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /carcolor <color1> <color2>");
}
if(color[1] == -1) color[1] = color[0]; // If color2 was left out, set it the same as color 1
new szSuccess[44];
format(szSuccess, sizeof(szSuccess), "Vehicle colors changed to: {FFFFFF}%i and %i.", color[0], color[1]);
SendClientMessage(playerid, 0x00FF00FF, szSuccess);
ChangeVehicleColor(GetPlayerVehicleID(playerid), color[0], color[1]);
return 1;
}
try ZCMD one.
Posts: 50
Threads: 19
Joined: Oct 2015
Reputation:
0
18.02.2017, 19:02
(
Последний раз редактировалось UnholyBeast; 18.02.2017 в 19:55.
)
I've taken over development of a gamemode, and I am just trying to get familiar with it's own command processor. Here's a command that works just fine. That uses multiple variables, and doesn't require the use of params, or zcmd.
CODE REMOVED. If you still feel like helping. Please PM me.
Posts: 6,242
Threads: 8
Joined: Jun 2008
Keep it to the thread, shuffling your assistance off to PMs avoids helping anyone else who has this issue.
The reason it's only getting one color, is because you're only looking for one color with sscanf.
RyderX has the sscanf method you need to use in the command that they handed you,
Posts: 6,242
Threads: 8
Joined: Jun 2008
You may as well delete the entire thread considering you've removed the code on a forum that holds information like this to help the next people who are looking at getting help.
Posts: 6,242
Threads: 8
Joined: Jun 2008
You can, click top right thread tools, delete thread.
Bare in mind that doing what you've done, deleting the code on the forum, will make you unappealing to help in the future...
And even then, when you edit the thread, chances are that the ****** cache already has archived it, so in the larger scale, it's a pointless paranoia that you've got.