31.07.2015, 16:38
(
Последний раз редактировалось Lirbo; 01.08.2015 в 19:24.
)
It's saving only the first TP, how can i fix this? after restarting only the first tp that has created would be saved
what should i do?
OnGameModeInit
what should i do?
PHP код:
#define MAX_TELEPORTS 500
PHP код:
#define function%0(%1) forward%0(%1); public%0(%1)
#define LoadTeleports INI_ParseFile(tpFile(), "LoadTP", .bExtra = true, .extra = i);
PHP код:
for(new i = 0; i < MAX_TELEPORTS; i++){
LoadTeleports
format(String,sizeof(String),"- Teleport -\n%s",tpDB[i][Description]);
TPText[i] = Create3DTextLabel(String, C_WHITE, tpDB[i][X],tpDB[i][Y],tpDB[i][Z], 25.0, tpDB[i][VW], 0);
TPText[i] = Create3DTextLabel(String, C_WHITE, tpDB[i][ToX],tpDB[i][ToY],tpDB[i][ToZ], 25.0, tpDB[i][ToVW], 0);
}
PHP код:
function LoadTP(playerid, name[], value[])
{
for(new i = 0; i < MAX_TELEPORTS; i++){
INI_String("Description",tpDB[i][Description],64);
INI_Float("X",tpDB[i][X]);
INI_Float("Y",tpDB[i][Y]);
INI_Float("Z",tpDB[i][Z]);
INI_Float("ToX",tpDB[i][ToX]);
INI_Float("ToY",tpDB[i][ToY]);
INI_Float("ToZ",tpDB[i][ToZ]);
INI_Int("VW",tpDB[i][VW]);
INI_Int("ToVW",tpDB[i][ToVW]);}
return 1;
}
stock SaveTPFile()
{
new INI:tpfile = INI_Open(tpFile());
INI_SetTag(tpfile, "Database");
INI_WriteString(tpfile,"Description",tpDB[param[0]][Description]);
INI_WriteFloat(tpfile,"X",tpDB[param[0]][X]);
INI_WriteFloat(tpfile,"Y",tpDB[param[0]][Y]);
INI_WriteFloat(tpfile,"Z",tpDB[param[0]][Z]);
INI_WriteFloat(tpfile,"ToX",tpDB[param[0]][ToX]);
INI_WriteFloat(tpfile,"ToY",tpDB[param[0]][ToY]);
INI_WriteFloat(tpfile,"ToZ",tpDB[param[0]][ToZ]);
INI_WriteInt(tpfile,"VW",tpDB[param[0]][VW]);
INI_WriteInt(tpfile,"ToVW",tpDB[param[0]][ToVW]);
INI_Close(tpfile);
}
stock tpFile()
{
format(String,sizeof(String),"Teleports/Teleport (%i).ini",param[0]);
return String;
}