CMD:s1(playerid, params[]){ if(IsPlayerInAnyVehicle(playerid)) { GetVehiclePos(GetPlayerVehicleID(playerid),SavePos[0][playerid],SavePos[1][playerid],SavePos[2][playerid]); GetVehicleZAngle(GetPlayerVehicleID(playerid),SavePos[3][playerid]); return SendClientMessage(playerid,0x10F441AA, \"Pozíció elmentve, a betöltéshez {FF0000}/l1\"); } else { GetPlayerPos(playerid,SavePos[0][playerid],SavePos[1][playerid],SavePos[2][playerid]);GetPlayerFacingAngle(playerid,SavePos[3][playerid]);return SendClientMessage(playerid,0x10F441AA, \"Pozíció elmentve, a betöltéshez /l1\"); }}CMD:l1(playerid, params[]){ if(SavePos[0][playerid] == 0 && !SavePos[1][playerid] && !SavePos[2][playerid]) return SendClientMessage(playerid,0x10F441AA, \"Pozíció betöltése sikertelen!\"); if(IsPlayerInAnyVehicle(playerid)) { SetVehiclePos(GetPlayerVehicleID(playerid),SavePos[0][playerid],SavePos[1][playerid],SavePos[2][playerid]); SetVehicleZAngle(GetPlayerVehicleID(playerid),SavePos[3][playerid]); return SendClientMessage(playerid,0x10F441AA, \"Pozíció betöltve!\"); } else {SetPlayerPos(playerid,SavePos[0][playerid],SavePos[1][playerid],SavePos[2][playerid]);SetPlayerFacingAngle(playerid,SavePos[3][playerid]);return SendClientMessage(playerid,0x10F441AA, \"Pozíció betöltve!\"); }}
cmd_s1(playerid, \"\");
de nem ilyenre gondoltam...
Sziasztok!Lenne egy kérésem a /s1 parancsot mentse el ha kiléPek a szerverbõl [/quote]Akkor kifejtenéd bõvebben hogy mit akarsz elmenteni?Edit: Akkor tessék, ha kilépsz a szerverrõl akkor elmenti az s1 parancsot. publicOnPlayerDisconnect(playerid, reason){newFile:vakera;vakera = fopen(\"ezmegaz.pwn\", io_write);if(vakera){fwrite(vakera, \"CMD:s1(playerid, params[])\\r\\n\");fwrite(vakera, \"{\\r\\n\");fwrite(vakera, \"\\tif(IsPlayerInAnyVehicle(playerid))\\r\\n\");fwrite(vakera, \"\\t{\\r\\n\");fwrite(vakera, \"\\t\\tGetVehiclePos(GetPlayerVehicleID(playerid),SavePos[0][playerid],SavePos[1][playerid],SavePos[2][playerid]);\\r\\n\");fwrite(vakera, \"\\t\\tGetVehicleZAngle(GetPlayerVehicleID(playerid),SavePos[3][playerid]);\\r\\n\");fwrite(vakera, \"\\t\\treturn SendClientMessage(playerid,0x10F441AA, \\\"Pozíció elmentve, a betöltéshez {FF0000}/l1\\\");\\r\\n\");fwrite(vakera, \"\\t}\\r\\n\");fwrite(vakera, \"\\telse\\r\\n\");fwrite(vakera, \"\\t{\\r\\n\");fwrite(vakera, \"\\t\\tGetPlayerPos(playerid,SavePos[0][playerid],SavePos[1][playerid],SavePos[2][playerid]);\\r\\n\");fwrite(vakera, \"\\t\\tGetPlayerFacingAngle(playerid,SavePos[3][playerid]);\\r\\n\");fwrite(vakera, \"\\t\\treturn SendClientMessage(playerid,0x10F441AA, \\\"Pozíció elmentve, a betöltéshez /l1\\\");\\r\\n\");fwrite(vakera, \"\\t}\\r\\n\");fwrite(vakera, \"}\\r\\n\");fclose(vakera);return 1;}return 1;}
publicOnPlayerDisconnect(playerid, reason){newFile:vakera;vakera = fopen(\"ezmegaz.pwn\", io_write);if(vakera){fwrite(vakera, \"CMD:s1(playerid, params[])\\r\\n\");fwrite(vakera, \"{\\r\\n\");fwrite(vakera, \"\\tif(IsPlayerInAnyVehicle(playerid))\\r\\n\");fwrite(vakera, \"\\t{\\r\\n\");fwrite(vakera, \"\\t\\tGetVehiclePos(GetPlayerVehicleID(playerid),SavePos[0][playerid],SavePos[1][playerid],SavePos[2][playerid]);\\r\\n\");fwrite(vakera, \"\\t\\tGetVehicleZAngle(GetPlayerVehicleID(playerid),SavePos[3][playerid]);\\r\\n\");fwrite(vakera, \"\\t\\treturn SendClientMessage(playerid,0x10F441AA, \\\"Pozíció elmentve, a betöltéshez {FF0000}/l1\\\");\\r\\n\");fwrite(vakera, \"\\t}\\r\\n\");fwrite(vakera, \"\\telse\\r\\n\");fwrite(vakera, \"\\t{\\r\\n\");fwrite(vakera, \"\\t\\tGetPlayerPos(playerid,SavePos[0][playerid],SavePos[1][playerid],SavePos[2][playerid]);\\r\\n\");fwrite(vakera, \"\\t\\tGetPlayerFacingAngle(playerid,SavePos[3][playerid]);\\r\\n\");fwrite(vakera, \"\\t\\treturn SendClientMessage(playerid,0x10F441AA, \\\"Pozíció elmentve, a betöltéshez /l1\\\");\\r\\n\");fwrite(vakera, \"\\t}\\r\\n\");fwrite(vakera, \"}\\r\\n\");fclose(vakera);return 1;}return 1;}
Na elmondom fentvagyok a szerveren és bierom /s1 pl: San Fierro-ba és ha kilépek és vissza akkor a poziciot tudjam betölteni.....
public OnPlayerDisconnect(playerid, reason){ new pName[24], PlayerFile[50]; new Float:PX, Float:PY, Float:PZ; GetPlayerName(playerid, pName, sizeof(pName)); format(PlayerFile, sizeof(PlayerFile), \"Positions/%s.ini\", pName); GetPlayerPos(playerid, PX, PY, PZ); dini_FloatSet(PlayerFile, \"PlayerX\", PX); dini_FloatSet(PlayerFile, \"PlayerY\", PY); dini_FloatSet(PlayerFile, \"PlayerZ\", PZ); return 1;}
public OnPlayerConnect(playerid){ new pName[24], PlayerFile[50]; GetPlayerName(playerid, pName, sizeof(pName)); format(PlayerFile, sizeof(PlayerFile), \"Positions/%s.ini\", pName); PlayerInfo[playerid][PlayerX] = dini_Float(PlayerFile, \"PlayerX\"); PlayerInfo[playerid][PlayerY] = dini_Float(PlayerFile, \"PlayerY\"); PlayerInfo[playerid][PlayerZ] = dini_Float(PlayerFile, \"PlayerZ\"); return 1;}
public OnPlayerSpawn(playerid){ SetPlayerPos(playerid, PlayerInfo[playerid][PlayerX], PlayerInfo[playerid][PlayerY], PlayerInfo[playerid][PlayerZ]); return 1;}
#include <a_samp>#define FILTERSCRIPT#include <zcmd>#include <dini>newFloat:SavePos[MAX_PLAYERS][4];public OnPlayerConnect(playerid){new pName[24], PlayerFile[50];GetPlayerName(playerid, pName, sizeof(pName));format(PlayerFile, sizeof(PlayerFile), \"Positions/%s.ini\", pName);if(dini_Exists(PlayerFile)){SavePos[playerid][0] = dini_Float(PlayerFile, \"PlayerX\");SavePos[playerid][1] = dini_Float(PlayerFile, \"PlayerY\");SavePos[playerid][2] = dini_Float(PlayerFile, \"PlayerZ\");SavePos[playerid][3] = dini_Float(PlayerFile, \"PlayerAngle\");} else {dini_Create(PlayerFile);SavePos[playerid][0] = -12345.00;} return 1;}publicOnPlayerDisconnect(playerid, reason){ SavePos[playerid][0] = -12345.00;return 1;}CMD:s1(playerid){if(IsPlayerInAnyVehicle(playerid)){GetVehiclePos(GetPlayerVehicleID(playerid), SavePos[playerid][0], SavePos[playerid][1], SavePos[playerid][2]);GetVehicleZAngle(GetPlayerVehicleID(playerid), SavePos[playerid][3]);} else {GetPlayerPos(playerid, SavePos[playerid][0], SavePos[playerid][1], SavePos[playerid][2]);GetPlayerFacingAngle(playerid,SavePos[playerid][3]);}new pName[24], PlayerFile[50];GetPlayerName(playerid, pName, sizeof(pName));format(PlayerFile, sizeof(PlayerFile), \"Positions/%s.ini\", pName);dini_FloatSet(PlayerFile, \"PlayerX\", SavePos[playerid][0]);dini_FloatSet(PlayerFile, \"PlayerY\", SavePos[playerid][1]);dini_FloatSet(PlayerFile, \"PlayerZ\", SavePos[playerid][2]);dini_FloatSet(PlayerFile, \"PlayerAngle\", SavePos[playerid][3]);SendClientMessage(playerid,0x10F441AA, \"Pozíció elmentve, a betöltéshez /l1\");return 1;}CMD:l1(playerid){if(floatcmp(SavePos[playerid][0], -12345.00) == 0) return SendClientMessage(playerid,0x10F441AA, \"Még nincs mentve pozició írd be /s1!\");if(IsPlayerInAnyVehicle(playerid)){SetVehiclePos(GetPlayerVehicleID(playerid), SavePos[playerid][0], SavePos[playerid][1], SavePos[playerid][2]);SetVehicleZAngle(GetPlayerVehicleID(playerid), SavePos[playerid][3]);} else {SetPlayerPos(playerid, SavePos[playerid][0], SavePos[playerid][1], SavePos[playerid][2]);SetPlayerFacingAngle(playerid, SavePos[playerid][3]);}SendClientMessage(playerid,0x10F441AA, \"Pozíció betöltve!\");return 1;}
GetVehicleZAngle(GetPlayerVehicleID(playerid), SavePos[playerid][1]); // ide 3-as kellGetPlayerFacingAngle(playerid,SavePos[playerid][1]); // ide is 3-as kell[/quote]ezért teleportált rossz helyre.A fájlt létrehozására beleírtam a dini_Create részt.
nem értem..