01.09.2013, 20:56
pawn Код:
CMD:asellcar(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 5)
{
new string[256], file[64], car[64], vid;
vid = GetPlayerVehicleID(playerid);
format(file, sizeof(file),"LARP/Users/%s.ini", CarInfo[vid][cOwner]);
new INI:ufile = INI_Open(file);
if(fexist(file))
{
if(INI_Int(ufile,"Car") == vid)
{
INI_WriteInt(ufile, "Car", 9999);
}
if(INI_Int(ufile,"Car2") == vid)
{
INI_WriteInt(ufile, "Car2", 9999);
}
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "{FF0000}[AdmCmd]{FFFFFF}: You have just admin sold vehicle-id: %d.", vid);
SCM(playerid, COLOR_WHITE, string);
DestroyVehicle(vid);
}
INI_Close(ufile);
format(car, sizeof(car),"LARP/Vehicles/%d.ini", vid);
fremove(car);
}
return 1;
}
pawn Код:
if(INI_Int(ufile,"Car") == vid)
{
INI_WriteInt(ufile, "Car", 9999);
}
if(INI_Int(ufile,"Car2") == vid)
{
INI_WriteInt(ufile, "Car2", 9999);
}