Licenses Plate
#4

Well you have to use a INI system for improve the read/write speed. you can use DINI for exemple.

Here is DINI system.

It will be like:

pawn Код:
if(!strcmp(cmd, "/changeplate", true, 12))
{
    new tmp[128], file, name[MAX_PLAYER_NAME];
    tmp = strtok(cmdtext, idx);

    if(!strlen(tmp))
        return SendClientMessage(playerid, 0xFFFFFFAA, "USAGE: /changeplate [platenumber (up to 8 chars, use '-' for space char)]");

    if(!IsPlayerInAnyVehicle(playerid))
        return SendClientMessage(playerid, 0xFF9900AA, "You are not in a vehicle.");

    format(file, sizeof(file), "%s's plate.ini", name);
    if(!dini_Exists(file)) {
        dini_Create(file);
        dini_IntSet(file, "CarPlate", tmp);
    }
    new vehid = GetPlayerVehicleID(playerid);
    SetVehicleNumberPlate(GetPlayerVehicleID(playerid),tmp);
    SetVehicleToRespawn(vehid);
    SendClientMessage(playerid, 0xFF9900AA, "License plate changed!");
    new Float:x, Float:y, Float:z, Float:a;
    GetVehicleZAngle(vehid,a);
    GetPlayerPos(playerid,x,y,z);
    SetVehiclePos(vehid,x,y,z);
    SetVehicleZAngle(vehid,a);
    PutPlayerInVehicle(playerid, vehid, 0);
    return 1;
}
NOTE: This is a exemple of saving. It will save only the number of license plate
Reply


Messages In This Thread
Licenses Plate - by rashier - 07.08.2011, 23:08
Re: Licenses Plate - by RockFire - 09.08.2011, 21:37
Re: Licenses Plate - by rashier - 09.08.2011, 21:48
Re: Licenses Plate - by TheArcher - 09.08.2011, 22:13
Re: Licenses Plate - by rashier - 10.08.2011, 08:59
Re: Licenses Plate - by TheArcher - 10.08.2011, 10:53
Re: Licenses Plate - by rashier - 10.08.2011, 18:17
Re: Licenses Plate - by rashier - 11.08.2011, 13:25
Re : Licenses Plate - by jasonnw666 - 11.08.2011, 13:38
Re: Licenses Plate - by Darnell - 11.08.2011, 14:01

Forum Jump:


Users browsing this thread: 2 Guest(s)