GetVehicleColor problem
#1

i was installed this system https://sampforum.blast.hk/showthread.php?tid=235398 and put this command:
PHP код:
    if(!strcmp(cmd,"/getcolors",true))
    {
        new 
color2;
        new 
ccc;
        new 
vehicleid GetPlayerVehicleID(playerid);
        
GetVehicleColor(vehicleid,ccc,color2);
        
format(str,128,"%d %d",ccc,color2);
         
SendClientMessage(playerid,red,str);
        return 
1;
    } 
and its give me 0, 0 ever
Reply
#2

You sure you didn't had a black colored car?
0 = black
Reply
#3

Quote:
Originally Posted by Adil
Посмотреть сообщение
You sure you didn't had a black colored car?
0 = black
it's 0 ever
Reply
#4

help
Reply
#5

Код:
GetVehicleColor(GetPlayerVehicleID(playerid),ccc,color2);
E: oh sorry didn't notice its already there..
Reply
#6

Quote:
Originally Posted by Jofi
Посмотреть сообщение
Код:
GetVehicleColor(GetPlayerVehicleID(playerid),ccc,color2);
vehicleid = GetPlayerVehicleID(playerid);
Reply
#7

Well i just tested it and worked fine spawned blue (2) car, entered it and says 2, 0
But noticed if you use random color (-1) when create car it will say 0.
Reply
#8

pawn Код:
if(!strcmp(cmd,"/getcolors",true))
    {  if(IsPlayerInAnyVehicle(playerid))
       {
           new color1;
           new color2;
           new vehicleid = GetPlayerVehicleID(playerid);
           GetVehicleColor(vehicleid,color1,color2);
           format(str,128,"%d %d",color1,color2);
           SendClientMessage(playerid,red,str);
       }
       return 1;
    }
maybe ?
Reply
#9

Quote:
Originally Posted by Jay.
Посмотреть сообщение
pawn Код:
if(!strcmp(cmd,"/getcolors",true))
    {  if(IsPlayerInAnyVehicle(playerid))
       {
           new color1;
           new color2;
           new vehicleid = GetPlayerVehicleID(playerid);
           GetVehicleColor(vehicleid,color1,color2);
           format(str,128,"%d %d",color1,color2);
           SendClientMessage(playerid,red,str);
       }
       return 1;
    }
maybe ?
Uhhhhh.

pawn Код:
if(!strcmp(cmd,"/getcolors",true))
    {  if(IsPlayerInAnyVehicle(playerid))
       {
           new color1, color2, str; // You forgot the str.
           new vehicleid = GetPlayerVehicleID(playerid);
           GetVehicleColor(vehicleid,color1,color2);
           format(str,128,"%d %d",color1,color2);
           SendClientMessage(playerid,red,str);
       }
       return 1;
    }
Reply
#10

Quote:
Originally Posted by Famalamalam
Посмотреть сообщение
Uhhhhh.

pawn Код:
if(!strcmp(cmd,"/getcolors",true))
    {  if(IsPlayerInAnyVehicle(playerid))
       {
           new color1, color2, str[32]; // and you made str an integer.
           new vehicleid = GetPlayerVehicleID(playerid);
           GetVehicleColor(vehicleid,color1,color2);
           format(str,128,"%d %d",color1,color2);
           SendClientMessage(playerid,red,str);
       }
       return 1;
    }
If your creating cars with -1, it won't show a correct value.

Try debugging and create a car with 64, 23 then go in that get and type /getcolor or w/e your command is and see the results.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)