#include <a_samp>#define COLOR_RED 0xFF0000AA#define COLOR_GREEN 0x33AA33AApublic OnPlayerConnect(playerid){return 1;} enum SavePosENUM { Float:sX, Float:sY, Float:sZ, Float:sA, SavedPos };new SavePos[MAX_PLAYERS][savePosENUM];public OnPlayerCommandText(playerid, cmdtext[]){if(!strcmp(cmdtext, \"/sp\", true)) { if (IsPlayerInAnyVehicle(playerid)) { GetVehiclePos(GetPlayerVehicleID(playerid), SavePos[playerid][sX], SavePos[playerid][sY], SavePos[playerid][sZ]); GetVehicleZAngle(GetPlayerVehicleID(playerid), SavePos[playerid][sA]); } else { GetPlayerPos(playerid, SavePos[playerid][sX], SavePos[playerid][sY], SavePos[playerid][sZ]); GetPlayerFacingAngle(playerid, SavePos[playerid][sA]); } SavePos[playerid][savedPos] = 1; return SendClientMessage(playerid, COLOR_GREEN, \"Pozició mentve.Betöltéshez írd be az /lp parancsot.\"); } if(!strcmp(cmdtext, \"/lp\", true)) { if (SavePos[playerid][savedPos] == 0) return SendClientMessage(playerid, COLOR_RED, \"Pozició nincsen mentve.\"); if (IsPlayerInAnyVehicle(playerid)) { SetVehiclePos(GetPlayerVehicleID(playerid), SavePos[playerid][sX], SavePos[playerid][sY], SavePos[playerid][sZ]); SetVehicleZAngle(GetPlayerVehicleID(playerid), SavePos[playerid][sA]); } else { SetPlayerPos(playerid, SavePos[playerid][sX], SavePos[playerid][sY], SavePos[playerid][sZ]); SetPlayerFacingAngle(playerid, SavePos[playerid][sA]); } return SendClientMessage(playerid, COLOR_GREEN, \"Elteleprotáltál a mentet pozicióra.\"); } return 0;}
new Float:Pos[MAX_PLAYERS][3];
if(strcmp(cmdtext, \"/sp\", true)) == 0) { GetPlayerPos(playerid, Pos[playerid][0], Pos[playerid][1], Pos[playerid][2]); SendClientMessage(playerid, 0xFFFFFFFF, \"Elmentve!\"); return 1;}
if(strcmp(cmdtext, \"/lp\", true)) == 0) { SetPlayerPos(playerid, Pos[playerid][0], Pos[playerid][1], Pos[playerid][2]); SendClientMessage(playerid, 0xFFFFFFFF, \"Betöltve!\"); return 1;}
Sziasztok!2 parancsot kérnék tõletek ha lehet akkor az sp és lp parancs lenne az egy kis magyarázattal is (ha nem gond)kösszi
public OnPlayerCommandText(playerid, cmdtext[]){ if(!strcmp(\"/savepos\", cmdtext, true)) return SavePos(playerid); if(!strcmp(\"/loadpos\", cmdtext, true)) LoadPos(playerid); return 0;}forward SavePos(playerid);public SavePos(playerid){ new Float:x,Float:y,Float:z; GetPlayerPos(playerid,x,y,z); // Get the players position SetPVarFloat(playerid,\"xpos\",x); // Save the float into a player variable SetPVarFloat(playerid,\"ypos\",y); // Save the float into a player variable SetPVarFloat(playerid,\"zpos\",z); // Save the float into a player variable return 1;}forward LoadPos(playerid);public LoadPos(playerid){ SetPlayerPos(playerid, GetPVarFloat(playerid,\"xpos\"), GetPVarFloat(playerid,\"ypos\"), GetPVarFloat(playerid,\"zpos\")); return 1;}
Turbo nemvagyok lusta, sõt még a másik sampos forumon is voltam keresni.