Car Colour Cmd
#1

Where i cant find a /carcolour [id1] [id2]
Reply
#2

pawn Код:
if(!strcmp(cmd, "/CarColour", true))
{
    new tmp[256],tmp2[256],Index; tmp = strtok(cmdtext,Index), tmp2 = strtok(cmdtext,Index);
    if(!strlen(tmp)||!(strval(tmp) >= 0 && strval(tmp) <= 126)||
    !IsNumeric(tmp)||!IsNumeric(tmp2)) return SendClientMessage(playerid,red,"USAGE: /CarColour <Color 1> (<Color 2>)");
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,red,"ERROR: you must be in a vehicle.");
    if(!strlen(tmp2)) tmp2 = tmp;
    new string[256],name[24]; GetPlayerName(playerid,name,24);
    format(string,256,"you have changed your vehicle colours to: [%d %d]",strval(tmp),strval(tmp2));
    return ChangeVehicleColor(GetPlayerVehicleID(playerid),strval(tmp),strval(tmp2));
}
Reply
#3

if u mean u want the ids of colors here it is : https://sampwiki.blast.hk/wiki/Colors_List

if u mean u want to codes of /carcolor here it is :

@ TOP

PHP код:
#include <dudb>
#pragma unused ret_memcpy 
@ OnPlayerCommandText

PHP код:
if(strcmp("/carcolor"cmdtexttrue10)== 0)
{
   if(
IsPlayerInVehicle(playerid))
   {
      new 
idx;
      new 
tmp[256]; tmp strtok(cmdtextidx);
      new 
tmp2[256]; tmp2 strtok(cmdtextidx);
      new 
color1 strval(tmp);
      new 
color2 strval(tmp2);
      if(!
strlen(tmp)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /carcolor [color1] [color2]");
      if(!
strlen(tmp2)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /carcolor [color1] [color2]");
      
ChangeVehicleColor(GetPlayerVehicleID(playerid), color1color2);
   }
   else
   {
      
SendClientMessage(playeridCOLOR_BRIGHTRED"You must be in a vehicle to use this command !");
   }
   return 
1;
}
return 
0
Reply
#4

samy check your User CP please PM you!
Reply
#5

u can simply use SetPlayerVehicleColour(Playerid);
Reply
#6

dont forget to put this under #include <a_samp> :
pawn Код:
#include "../include/gl_common.inc"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)