[Help] Plate system saving
#1

Hello,

I am looking for some one to help me with that plate system. I need when I use "/plate" my vehicle plate save in scriptfiles/notepad file.

with dini.

Here is the whole script of my /plate system.

pawn Код:
if(strcmp(cmd, "/plate",true)== 0)
    {
    new ID = GetPlayerVehicleID(playerid);

    new strings[256];
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0x00FFFFFF, "You're not in a vehicle");
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /plate <License Plate>");
    else
    {
        format(strings, sizeof(strings), "%s",tmp);
        SetVehicleNumberPlate(ID,strings);
        strmid(CarInfo[VehicleOwned[ID]][cLicense], strings, 0, strlen(strings), 255);
        SetVehicleToRespawn(ID);
        format(strings,sizeof(strings),"{00C0FF}You've changed your plate name to %s please spawn your vehicle again",tmp);
        SendClientMessage(playerid, COLOR_LIGHTRED, strings);
        PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
        SaveCars();

    }
    return 1;
    }

pawn Код:
public OnVehicleSpawn(vehicleid)
{
    VehicleEngine[vehicleid] = 0;
    VehicleWindows[vehicleid] = 0;
    CarRadio[vehicleid] = 0;
    SetVehicleNumberPlate(vehicleid,CarInfo[VehicleOwned[vehicleid]][cLicense]);
    if(VehicleOwned[vehicleid] != SCRIPT_CARS)
    {
        if(VehSpawned[vehicleid] == 0)
        {
            VehicleOwned[vehicleid] = SCRIPT_CARS;
            DestroyVehicle(vehicleid);
            VehSpawned[vehicleid] = 0;
        }
        else
        {
            VehSpawned[vehicleid] = 0;
        }
    }
    return 1;
}
Reply
#2

Use Y_INI.
Reply
#3

Can you help me with Y_INI in that Script??
Reply
#4

Search for tutorials with it, there are a lot!
Reply
#5

Sir, I search the tutorial. But I'll not find any point how to add stuff in my script..

Thanks for the help!!
Reply
#6

pawn Код:
if(strcmp(cmd, "/plate",true)== 0)
{
    new ID = GetPlayerVehicleID(playerid);

    new strings[256];
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0x00FFFFFF, "You're not in a vehicle");
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /plate <License Plate>");
    else
    {
        format(strings, sizeof(strings), "%s",tmp);
        SetVehicleNumberPlate(ID,strings);
        strmid(CarInfo[VehicleOwned[ID]][cLicense], strings, 0, strlen(strings), 255);
        SetVehicleToRespawn(ID);
        format(strings,sizeof(strings),"{00C0FF}You've changed your plate name to %s please spawn your vehicle again",tmp);
        SendClientMessage(playerid, COLOR_LIGHTRED, strings);
        PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
        new string[128];
        format(string, sizeof(string), "plates.ini");
        if(!dini_Exists(string))
        {
            dini_Create(string);
            dini_Set(string, "License Plate", tmp);
        }
        SaveCars();

    }
    return 1;
}
Untested.
Reply
#7

i need to make any folder in scriptfiles??
Reply
#8

No, why ? it saves in plates.ini.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)