Jump to content
  • 0

Problema


Iulian

Question

Am creat un sistem de atasamente cu save/loading. Am pus ca atunci cand selecteaza stergere, sa stearga fisierul nume.ini (nume = numele playerului). Totul merge perfect pana cand intrii din nou si iti apare obiectul chiar daca fisierul .ini nu exista.

STERGEREA FISIERULUI:

[pawn]RemoveHats(playerid)

{

new Name[24], file[50];

    GetPlayerName( playerid, Name, sizeof Name );

    format( file, sizeof file, "accesorii/%s.ini", Name );

    fremove( file );

    return 1;

}[/pawn]

INCARCAREA OBIECTELOR:

[pawn]forward LoadToys(playerid,name[],value[]);

public LoadToys(playerid,name[],value[])

{

if (!strcmp(name, "sindex")){ PlayerInfo[playerid][pindex] = strval(value); }

if (!strcmp(name, "pmodelid")){ PlayerInfo[playerid][pmodelid] = strval(value); }

if (!strcmp(name, "pboneid")){ PlayerInfo[playerid][pboneid] = 2; }

if (!strcmp(name, "pfOffsetX")){ PlayerInfo[playerid][pfOffsetX] = strval(value); }

if (!strcmp(name, "pfOffsetY")){ PlayerInfo[playerid][pfOffsetY] = strval(value); }

if (!strcmp(name, "pfOffsetY")){ PlayerInfo[playerid][pfOffsetZ] = strval(value); }

if (!strcmp(name, "pfRotX")){ PlayerInfo[playerid][pfRotX] = strval(value); }

if (!strcmp(name, "pfRotY")){ PlayerInfo[playerid][pfRotY] = strval(value); }

if (!strcmp(name, "pfRotZ")){ PlayerInfo[playerid][pfRotZ] = strval(value); }

if (!strcmp(name, "pfScaleX")){ PlayerInfo[playerid][pfScaleX] = strval(value); }

if (!strcmp(name, "pfScaleY")){ PlayerInfo[playerid][pfScaleY] = strval(value); }

if (!strcmp(name, "pfScaleZ")){ PlayerInfo[playerid][pfScaleZ] = strval(value); }

    INI_Int("pindex",PlayerInfo[playerid][pindex]);

INI_Int("pmodelid",PlayerInfo[playerid][pmodelid]);

INI_Int("pboneid",PlayerInfo[playerid][pboneid]);

INI_Float("pfOffsetX",PlayerInfo[playerid][pfOffsetX]);

INI_Float("pfOffsetY",PlayerInfo[playerid][pfOffsetY]);

INI_Float("pfOffsetZ",PlayerInfo[playerid][pfOffsetZ]);

INI_Float("pfRotX",PlayerInfo[playerid][pfRotX]);

INI_Float("pfRotY",PlayerInfo[playerid][pfRotY]);

INI_Float("pfRotZ",PlayerInfo[playerid][pfRotZ]);

INI_Float("pfScaleX",PlayerInfo[playerid][pfScaleX]);

INI_Float("pfScaleY",PlayerInfo[playerid][pfScaleY]);

INI_Float("pfScaleZ",PlayerInfo[playerid][pfScaleZ]);

    return 1;

}[/pawn]

Rate me :)

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.