25.08.2011, 06:29
pawn Code:
if(strcmp(cmd, "/carcolor", true) == 0)
{
tmp = strtok(cmdtext, idx);
new car = GetCarIDFromPlayer(playerid);
new vehid = GetPlayerVehicleID(playerid);
if(!IsPlayerDriver(playerid))
{
SendClientMessage(playerid, COLOR_GREY," You're not driving a car !");
return 1;
}
if(vehid != car)
{
SendClientMessage(playerid, COLOR_GREY," This is not your car !");
return 1;
}
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY," USUAGE: /carcolor [color 1] [color 2]");
return 1;
}
if(PlayerInfo[playerid][pCash] < 499)
{
SendClientMessage(playerid, COLOR_GREY, " You need $500 !");
return 1;
}
tmp = strtok( cmdtext, idx );
new color = strval( tmp );
tmp = strtok( cmdtext, idx );
new color2 = strval( tmp );
new id = GetCarIDFromPlayer_Enum(playerid);
CarInfo[id][vColorOne] = color;
CarInfo[id][vColorTwo] = color2;
DestroyVehicle(car);
CarInfo[car][ownedvehicle] = CreateVehicle(CarInfo[id][vModel],CarInfo[id][vLocationx],CarInfo[id][vLocationy],CarInfo[id][vLocationz],CarInfo[id][vAngle],CarInfo[id][vColorOne],CarInfo[id][vColorTwo],300000);
SendClientMessage(playerid, COLOR_GREY," Changed color for $500, color changes on respawn !");
GivePlayerMoney(playerid, -500);
PlayerInfo[playerid][pCash] -= 500;
return 1;
}