Sziasztok!
Készülõ modomba raknék bele egyedi kiírásokat objectek amire persze írtam egy kis \"próba modot\" mielõtt beleraknám a rendes modba.Még jó is mivel amikor létrehozom, és elmentem akkor még tök jó ugyebár megvan rajta az átlátszó háttér meg a szöveg is.Viszont amikor betölti mod indulásakor az objectet akkor nem írja rá a szövegem.
Itt az egész kód:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#include <streamer>
#include <sscanf2>
#include <zcmd>
#include <dini>
#include <dudb>
#define MAX_GRAFFS 500
#pragma unused ret_memcpy
new g_Szoveg[64][MAX_PLAYERS];
new g_Betu[64][MAX_PLAYERS];
new g_Meret[MAX_PLAYERS];
new g_Szin[64][MAX_PLAYERS];
new g_VW[MAX_PLAYERS];
new g_Inti[MAX_PLAYERS];
new o_Szoveg[64][MAX_GRAFFS];
new o_Betu[64][MAX_GRAFFS];
new o_Meret[MAX_GRAFFS];
new o_Szin[64][MAX_GRAFFS];
new o_VW[MAX_GRAFFS];
new o_Inti[MAX_GRAFFS];
new gObject[MAX_GRAFFS];
new graffid[MAX_PLAYERS];
enum gAdatok
{
Text[64],
Font[64],
Size,
VW,
Inti,
Color[64],
Object,
Float:Xg,
Float:Yg,
Float:Zg,
Float:RXg,
Float:RYg,
Float:RZg,
};
new gInfo[MAX_GRAFFS][gAdatok];
forward ObjectPrint(objectid);
main()
{
print(\"\\n----------------------------------\");
print(\" Blank Gamemode by your name here\");
print(\"----------------------------------\\n\");
}
public OnGameModeInit()
{
// Don\'t use these lines if it\'s a filterscript
SetGameModeText(\"Blank Script\");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
for(new gI = 1; gI < MAX_GRAFFS+1; gI++)
{
new file[256];
format(file,256, \"/Graff/%i.ini\",gI);
{
if(dini_Exists(file))
{
strunpack(o_Szoveg[gI], dini_Get(file, \"Text\"));
strunpack(o_Betu[gI], dini_Get(file, \"Font\"));
strunpack(o_Szin[gI], dini_Get(file, \"Color\"));
o_Meret[gI] = dini_Int(file, \"Size\");
gInfo[gI][Xg] = dini_Float(file, \"X\");
gInfo[gI][Yg] = dini_Float(file, \"Y\");
gInfo[gI][Zg] = dini_Float(file, \"Z\");
gInfo[gI][RXg] = dini_Float(file, \"RX\");
gInfo[gI][RYg] = dini_Float(file, \"RY\");
gInfo[gI][RZg] = dini_Float(file, \"RZ\");
gObject[gI] = CreateDynamicObject(19353, gInfo[gI][Xg], gInfo[gI][Yg], gInfo[gI][Zg], gInfo[gI][RXg], gInfo[gI][RYg], gInfo[gI][RZg]);
ObjectPrint(gObject[gI]);
for(new pI;pI < MAX_PLAYERS; pI++)
{
Streamer_UpdateEx(pI, gInfo[gI][Xg], gInfo[gI][Yg], gInfo[gI][Zg], gInfo[gI][VW],gInfo[gI][inti]);
}
}
}
}
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(\"/mycommand\", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
{
if(response == EDIT_RESPONSE_UPDATE)
{
MoveDynamicObject(objectid, x, y, z, 10.0, rx, ry, rz);
}
if(response == EDIT_RESPONSE_FINAL || response == EDIT_RESPONSE_CANCEL)
{
SetDynamicObjectPos(objectid, x, y, z);
SetDynamicObjectRot(objectid, rx, ry, rz);
gInfo[objectid][Xg] = x;
gInfo[objectid][Yg] = y;
gInfo[objectid][Zg] = z;
gInfo[objectid][RXg] = rx;
gInfo[objectid][RYg] = ry;
gInfo[objectid][RZg] = rz;
new file[256];
format(file,sizeof(file), \"/Graff/%i.ini\",graffid[playerid]);
if(!dini_Exists(file))
{
dini_Create(file);
dini_Set(file, \"Font\", g_Betu[playerid]);
dini_Set(file, \"Text\", g_Szoveg[playerid]);
dini_Set(file, \"Color\", g_Szin[playerid]);
dini_IntSet(file, \"Size\", g_Meret[playerid]);
dini_IntSet(file, \"VW\", g_VW[playerid]);
dini_IntSet(file, \"Inti\", g_Inti[playerid]);
dini_FloatSet(file, \"X\", gInfo[objectid][Xg]);
dini_FloatSet(file, \"Y\", gInfo[objectid][Yg]);
dini_FloatSet(file, \"Z\", gInfo[objectid][Zg]);
dini_FloatSet(file, \"RX\", gInfo[objectid][RXg]);
dini_FloatSet(file, \"RY\", gInfo[objectid][RYg]);
dini_FloatSet(file, \"RZ\", gInfo[objectid][RZg]);
}
}
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(response)
{
strunpack(g_Szoveg[playerid], inputtext);
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, \"RavenRPG - Size | Graffiti\", \"Írd be a graffiti kívánt méretét!\", \"Következõ\", \"Elõzõ\");
}
}
if(dialogid == 2)
{
if(response)
{
g_Meret[playerid] = strval(inputtext);
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, \"RavenRPG - Font | Graffiti\", \"Arial\\nCourier New\\nImpact\", \"Következõ\", \"Elõzõ\");
}else ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, \"RavenRPG - Text | Graffiti\", \"Írd be a graffitin megjeleníteni kívánt szöveget!\", \"Következõ\", \"Bezár\");
}
if(dialogid == 3)
{
if(response)
{
switch(listitem)
{
case 0: g_Betu[playerid] = \"Arial\";
case 1: g_Betu[playerid] = \"Courier New\";
case 2: g_Betu[playerid] = \"Impact\";
}
ShowPlayerDialog(playerid, 4, DIALOG_STYLE_INPUT, \"RavenRPG - Color | Graffiti\", \"Írd be a graffiti kívánt színét!\", \"Kész!\", \"Elõzõ\");
}else ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, \"RavenRPG - Size | Graffiti\", \"Írd be a graffiti kívánt méretét!\", \"Következõ\", \"Elõzõ\");
}
if(dialogid == 4)
{
if(response)
{
new Float:gX,Float:gY,Float:gZ,Float:gAngle;
GetPlayerPos(playerid, gX,gY,gZ);
SetPlayerPos(playerid, gX+5,gY+5,gZ+3);
g_VW[playerid] = GetPlayerVirtualWorld(playerid);
g_Inti[playerid] = GetPlayerInterior(playerid);
GetPlayerFacingAngle(playerid, gAngle);
strunpack(g_Szin[playerid], inputtext);
gInfo[graffid[playerid]][Object] = CreateDynamicObject(19353, gX, gY, gZ, 0.0, 0.0, gAngle-90.0);
SetDynamicObjectMaterial(gInfo[graffid[playerid]][Object], 0,0, \"none\", \"none\", 0);
SetDynamicObjectMaterialText(gInfo[graffid[playerid]][Object], 0, g_Szoveg[playerid], OBJECT_MATERIAL_SIZE_256x128, g_Betu[playerid], g_Meret[playerid], 0, HexToInt(g_Szin[playerid]), 0x00000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
Streamer_UpdateEx(playerid, gX, gY, gZ, g_VW[playerid],g_Inti[playerid]);
EditDynamicObject(playerid, gInfo[graffid[playerid]][Object]);
}else ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, \"RavenRPG - Font | Graffiti\", \"Arial\\nCourier New\\nImpact\", \"Következõ\", \"Elõzõ\");
}
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
public ObjectPrint(objectid)
{
print(\"Objectek kiírva!\");
SetDynamicObjectMaterial(gObject[objectid], 0,0, \"none\", \"none\", 0);
SetDynamicObjectMaterialText(gObject[objectid], 0, o_Szoveg[objectid], OBJECT_MATERIAL_SIZE_256x128, o_Betu[objectid], o_Meret[objectid], 0, HexToInt(o_Szin[objectid]), 0x00000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
}
CMD:newgraff(playerid, params[])
{
new id;
if(sscanf(params,\"i\",id)) SendClientMessage(playerid, -1, \"/newgraff [graffID]\");
new file[256];
format(file,sizeof(file), \"/Graff/%i.ini\",id);
if(!dini_Exists(file))
{
graffid[playerid] = id;
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, \"RavenRPG - Text | Graffiti\", \"Írd be a graffitin megjeleníteni kívánt szöveget!\", \"Következõ\", \"Bezár\");
}
return 1;
}
Én arra gondoltam hogy nem olvassa be azt a 2sort amivel ugyebár ráraknám a szövegem.
Pár kérdés megelõzésére:
IGEN minden szükséges infót elment.
IGEN dini létrehozza a fájlot a mappában.
IGEN jó helyrõl próbálom betöltetni az objecteket(mivel azokat betölti csak a textet nem dobja rá)
Tehát csakis a betöltéssel van a gond!
Hasznos válaszokat elõre is köszönöm!
Dupla hozzászólás automatikusan összefûzve. ( 2014. szeptember 10. - 15:20:33 )
Mind1 sikerült megoldani.
Megoldás(om):
« Utoljára szerkesztve: 2014. szeptember 10. - 15:20:33 írta norbinator09 »
Naplózva