how i can make change car color? - 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)
+--- Thread: how i can make change car color? (
/showthread.php?tid=344647)
how i can make change car color? -
TheDiscussionCafe - 22.05.2012
hi. i want rcon admin to be able to change car color but only if admin is in car. if not in car it will say "you are not in car!" and if player is not rcon admin then it will say "you are not rcon admin". they can change car colour like this /carcolor . how i do this?
Re: how i can make change car color? -
Jonny5 - 22.05.2012
pawn Код:
YCMD:vcolor(playerid, params[], help)
{
if(!IsPlayerAdmin(playerid)) return 0;
if (help)
{
SendClientMessage(playerid, 0xFF9933FF, "/vcolor [0-128] [0-128]: Change your paint color");
}
else
{
new p1,p2;
new fstring[58];
new vid = GetPlayerVehicleID(playerid);
if (vid == 0) return SendClientMessage(playerid, 0xFF9933FF, "/vcolor [0-255] [0-255] : You must be in a vehivle to Change your paint color");
if(!sscanf(params, "ii", p1,p2)){
ChangeVehicleColor(vid, p1,p2);
format(fstring,58,"/paintjob : Changed your paint color to (%i)(%i)",p1,p2);
SendClientMessage(playerid, 0xFF9933FF, fstring);
}
else
{
SendClientMessage(playerid, 0xFF9933FF, "/vcolor [0-255] [0-255]: Change your paint color");
}
}
return 1;
}
this is what i use
it is in y_commands but could be converted easly
Re: how i can make change car color? -
TheDiscussionCafe - 22.05.2012
Quote:
Originally Posted by Jonny5
pawn Код:
YCMD:vcolor(playerid, params[], help) { if(!IsPlayerAdmin(playerid)) return 0; if (help) { SendClientMessage(playerid, 0xFF9933FF, "/vcolor [0-128] [0-128]: Change your paint color"); } else { new p1,p2; new fstring[58]; new vid = GetPlayerVehicleID(playerid); if (vid == 0) return SendClientMessage(playerid, 0xFF9933FF, "/vcolor [0-255] [0-255] : You must be in a vehivle to Change your paint color"); if(!sscanf(params, "ii", p1,p2)){ ChangeVehicleColor(vid, p1,p2); format(fstring,58,"/paintjob : Changed your paint color to (%i)(%i)",p1,p2); SendClientMessage(playerid, 0xFF9933FF, fstring); } else { SendClientMessage(playerid, 0xFF9933FF, "/vcolor [0-255] [0-255]: Change your paint color"); } } return 1; }
this is what i use
it is in y_commands but could be converted easly
|
i use zcmd. i convert but nothing happens.
Re: how i can make change car color? -
Jonny5 - 22.05.2012
pawn Код:
CMD:vcolor(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return 0;
new p1,p2;
new fstring[58];
new vid = GetPlayerVehicleID(playerid);
if (vid == 0) return SendClientMessage(playerid, 0xFF9933FF, "/vcolor [0-255] [0-255] : You must be in a vehivle to Change your paint color");
if(!sscanf(params, "ii", p1,p2)){
ChangeVehicleColor(vid, p1,p2);
format(fstring,58,"/paintjob : Changed your paint color to (%i)(%i)",p1,p2);
SendClientMessage(playerid, 0xFF9933FF, fstring);
}
else
{
SendClientMessage(playerid, 0xFF9933FF, "/vcolor [0-255] [0-255]: Change your paint color");
}
return 1;
}
try this,
it also requires sscanf2
use it like
/vcolor color1 color2
/vcolor 128 128
Re: how i can make change car color? -
TheDiscussionCafe - 22.05.2012
Quote:
Originally Posted by Jonny5
pawn Код:
CMD:vcolor(playerid, params[]) { if(!IsPlayerAdmin(playerid)) return 0; new p1,p2; new fstring[58]; new vid = GetPlayerVehicleID(playerid); if (vid == 0) return SendClientMessage(playerid, 0xFF9933FF, "/vcolor [0-255] [0-255] : You must be in a vehivle to Change your paint color"); if(!sscanf(params, "ii", p1,p2)){ ChangeVehicleColor(vid, p1,p2); format(fstring,58,"/paintjob : Changed your paint color to (%i)(%i)",p1,p2); SendClientMessage(playerid, 0xFF9933FF, fstring); } else { SendClientMessage(playerid, 0xFF9933FF, "/vcolor [0-255] [0-255]: Change your paint color"); } return 1; }
try this,
it also requires sscanf2
use it like
/vcolor color1 color2
/vcolor 128 128
|
wow this work!!!! thnk you!!!