30.12.2010, 11:52
It does matter.
https://sampwiki.blast.hk/wiki/Category:Scripting_Callbacks
https://sampwiki.blast.hk/wiki/Category:Scripting_Callbacks
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[128], idx;
cmd = strtok(cmdtext, idx);
if (strcmp("/carcolour", cmd, true) == 0)
{
new Colour1[128];
new Colour2[128];
new currentveh;
Colour1 = strtok(cmdtext, idx);
Colour2 = strrest(cmdtext, idx);
currentveh = GetPlayerVehicleID(playerid);
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,RED,"You're not in a car.");
if(IsPlayerInAnyVehicle(playerid))
{
if (!strval(Colour1) || strval(Colour1)> 255)
{
SendClientMessage(playerid, YELLOW, "Invalid colour1.");
return 1;
}
else if (!strval(Colour2) || strval(Colour2) > 255)
{
SendClientMessage(playerid, YELLOW, "Invalid colour2.");
return 1;
}
else
{
ChangeVehicleColor(currentveh, strval(Colour1), strval(Colour2));
}
}
return 1;
}
return 0;
}