07.07.2010, 14:10
I possible got it:
[pawn]if(strcmp("/carcolor", cmdtext, true, 10)== 0)[/pawn[
Notice that "10"? It checks if that's the string length. Just remove it.
Replace it by:
So you'll get:
Tip for saving time:
Checks if it compares.
Does the same.
[pawn]if(strcmp("/carcolor", cmdtext, true, 10)== 0)[/pawn[
Notice that "10"? It checks if that's the string length. Just remove it.
Replace it by:
pawn Код:
if(strcmp("/carcolor", cmdtext, true)== 0)
pawn Код:
if(strcmp("/carcolor", cmdtext, true)== 0)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You must be in a vehicle to use this command !");
new tmp[4];
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /carcolor [color1] [color2]");
new color1 = strval(tmp);
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /carcolor [color1] [color2]");
new color2 = strval(tmp);
ChangeVehicleColor(GetPlayerVehicleID(playerid), color1, color2);
return 1;
}
pawn Код:
if(strcmp(cmdtext,"/bla",true) == 0)
pawn Код:
if(!strcmp(cmdtext,"/bla",true))