GetVehicleColor problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: GetVehicleColor problem (
/showthread.php?tid=269979)
GetVehicleColor problem -
itay_h7 - 18.07.2011
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
Re: GetVehicleColor problem -
Adil - 18.07.2011
You sure you didn't had a black colored car?
0 = black
Re: GetVehicleColor problem -
itay_h7 - 18.07.2011
Quote:
Originally Posted by Adil
You sure you didn't had a black colored car?
0 = black
|
it's 0 ever
Re: GetVehicleColor problem -
itay_h7 - 20.07.2011
help
Re: GetVehicleColor problem -
Jofi - 20.07.2011
Код:
GetVehicleColor(GetPlayerVehicleID(playerid),ccc,color2);
E: oh sorry didn't notice its already there..
Re: GetVehicleColor problem -
itay_h7 - 20.07.2011
Quote:
Originally Posted by Jofi
Код:
GetVehicleColor(GetPlayerVehicleID(playerid),ccc,color2);
|
vehicleid = GetPlayerVehicleID(playerid);
Re: GetVehicleColor problem -
Jofi - 20.07.2011
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.
Re: GetVehicleColor problem -
Jay. - 20.07.2011
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 ?
Re: GetVehicleColor problem -
Famalamalam - 20.07.2011
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;
}
Re: GetVehicleColor problem -
Donya - 20.07.2011
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.