17.10.2010, 04:10
pawn Код:
else if(strcmp(x_nr,"color",true) == 0)
{
if(PlayerInfo[playerid][pPcarkey] == 999 && PlayerInfo[playerid][pPcarkey2] == 999 && PlayerInfo[playerid][pPcarkey3] == 999)
{
SendClientMessage(playerid, COLOR_GREY,"No tienes un coche para pintar!");
return 1;
}
if(GetPlayerMoney(playerid) < 99)
{
SendClientMessage(playerid, COLOR_GREY,"No Tienes Tanto Dinero Para Pintar Este Coche.");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Utiliza: /V Color [Color 1] [Color 2]");
return 1;
}
new color1;
color1 = strval(tmp);
if(color1 < 0 && color1 > 126)
{
SendClientMessage(playerid, COLOR_GREY, "Color Erronea. Utilize: Numero 0 ~ 126.");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Utiliza: /V Color [Color 1] [Color 2]");
return 1;
}
new color2;
color2 = strval(tmp);
if(color2 < 0 && color2 > 126)
{
SendClientMessage(playerid, COLOR_GREY, "Color Erronea. Utilize: Numero 0 ~ 126.");
return 1;
}
new vehid;
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { vehid = PlayerInfo[playerid][pPcarkey]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { vehid = PlayerInfo[playerid][pPcarkey2]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { vehid = PlayerInfo[playerid][pPcarkey3]; }
else { return 1; }
if(IsPlayerInVehicle(playerid, vehid))
{
CarInfo[vehid][cColorOne] = color1;
CarInfo[vehid][cColorTwo] = color2;
SafeGivePlayerMoney(playerid, -100);
GameTextForPlayer(playerid, "~w~Vehiculo Pintado Por~n~~r~-$100", 5000, 1);
ChangeVehicleColor(vehid, color1, color2);
OnPropUpdate();
OnPlayerUpdate(playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY," Este Coche No Es Tuyo.");
return 1;
}
}
CarInfo[vehid][cColorOne] = color1;
CarInfo[vehid][cColorTwo] = color2;
esa es la info de cada color que modifica en el script poreso no se puede usar con carros que no sean de venta...