03.08.2010, 21:31
pawn Код:
if(strcmp(cmd, "/regplate", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new plate[128];
plate = strtok(cmdtext, idx);
if(strlen(plate) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /regplate [SF-XXX-XXX]");
new vehicleid;
new file[256];
vehicleid = GetPlayerVehicleID(playerid);
if(vehicleid > 183)
{
CarInfo[vehicleid][cLicense] = strval(plate);
OnPropUpdate();
OnPlayerUpdate(playerid);
format(file,sizeof(file),"/file/cars.cfg");
dini_Set(file,"plate",plate);
format(string, sizeof(string), "* You've registered the car with this plate: %s. The ID of the car is: %d", plate, vehicleid);
SendClientMessage(playerid, COLOR_WHITE, string);
}
return 1;
}
return 1;
}