03.08.2010, 21:19
Hi, everyone!
I am currently editing LA-RP, because I've just started with PAWN scripting. Trough my modifications to the script, I've tried to add an /regplate command for the cars that could be bought, which should in theory should save to the cars.cfg file. The problem is, it doesn't save.
Here is the /regplate command:
The thing is in the "You've registered the car with this plate:..." string, the plate and ID of the car, are correct.
Note: The other variables: owner/position/description, are being saved.
And yes I know this is a Godfather edit, and we should not to them anymore, but I'm currently at a noob level when it comes to scripting.
I am currently editing LA-RP, because I've just started with PAWN scripting. Trough my modifications to the script, I've tried to add an /regplate command for the cars that could be bought, which should in theory should save to the cars.cfg file. The problem is, it doesn't save.
Here is the /regplate command:
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;
vehicleid = GetPlayerVehicleID(playerid);
if(vehicleid > 183)
{
CarInfo[vehicleid][cLicense] = strval(plate);
OnPropUpdate();
OnPlayerUpdate(playerid);
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;
}
Note: The other variables: owner/position/description, are being saved.
And yes I know this is a Godfather edit, and we should not to them anymore, but I'm currently at a noob level when it comes to scripting.