#include <a_samp>#include <zcmd>#include <sscanf2>new Float:spX[MAX_PLAYERS],Float:spY[MAX_PLAYERS],Float:spZ[MAX_PLAYERS],Float:spA[MAX_PLAYERS];new Float:spX2[MAX_PLAYERS],Float:spY2[MAX_PLAYERS],Float:spZ2[MAX_PLAYERS],Float:spA2[MAX_PLAYERS];new Float:spX3[MAX_PLAYERS],Float:spY3[MAX_PLAYERS],Float:spZ3[MAX_PLAYERS],Float:spA3[MAX_PLAYERS];new Float:spX4[MAX_PLAYERS],Float:spY4[MAX_PLAYERS],Float:spZ4[MAX_PLAYERS],Float:spA4[MAX_PLAYERS];new Float:spX5[MAX_PLAYERS],Float:spY5[MAX_PLAYERS],Float:spZ5[MAX_PLAYERS],Float:spA5[MAX_PLAYERS];#define SCM SendClientMessage#define LPT(%1) SCM(%1, -1, \"{ffff99}* Pozíciód {57a433}sikeresen {ffff99}betöltve.\")#define SPT(%1) SCM(%1, -1, \"{ffff99}* Pozíciód mentve, használd a {57a433}/lp {ffff99}parancsot a vissza teleportáláshoz.\")CMD:sp(playerid, params[]){new number;if(sscanf(params, \"d\", number)) return SendClientMessage(playerid, -1, \"{ffff99}/sp [1-5]\");if(strcmp(params, \"0\", true) == 0){SendClientMessage(playerid, -1, \"{ffff99}/sp [1-5]\");}if(strcmp(params, \"1\", true) == 0){SavePos(playerid);}if(strcmp(params, \"2\", true) == 0){SavePos2(playerid);}if(strcmp(params, \"3\", true) == 0){SavePos3(playerid);}if(strcmp(params, \"4\", true) == 0){SavePos4(playerid);}if(strcmp(params, \"5\", true) == 0){SavePos5(playerid);}return 1;}CMD:lp(playerid, params[]){ new number;if(sscanf(params, \"d\", number)) return SendClientMessage(playerid, -1, \"{ffff99}/lp [1-5]\");if(strcmp(params, \"0\", true) == 0){SendClientMessage(playerid, -1, \"{ffff99}/lp [1-5]\");}if(strcmp(params, \"1\", true) == 0){LoadPos(playerid);}if(strcmp(params, \"2\", true) == 0){LoadPos2(playerid);}if(strcmp(params, \"3\", true) == 0){LoadPos3(playerid);}if(strcmp(params, \"4\", true) == 0){LoadPos4(playerid);}if(strcmp(params, \"5\", true) == 0){LoadPos5(playerid);}return 1;}stock SavePos(playerid){GetPlayerPos(playerid,spX[playerid],spY[playerid],spZ[playerid]);GetPlayerFacingAngle(playerid,spA[playerid]);SPT(playerid);}stock SavePos2(playerid){GetPlayerPos(playerid,spX2[playerid],spY2[playerid],spZ2[playerid]);GetPlayerFacingAngle(playerid,spA2[playerid]);SPT(playerid);}stock SavePos3(playerid){GetPlayerPos(playerid,spX3[playerid],spY3[playerid],spZ3[playerid]);GetPlayerFacingAngle(playerid,spA3[playerid]);SPT(playerid);}stock SavePos4(playerid){GetPlayerPos(playerid,spX4[playerid],spY4[playerid],spZ4[playerid]);GetPlayerFacingAngle(playerid,spA4[playerid]);SPT(playerid);}stock SavePos5(playerid){GetPlayerPos(playerid,spX5[playerid],spY5[playerid],spZ5[playerid]);GetPlayerFacingAngle(playerid,spA5[playerid]);SPT(playerid);}stock LoadPos(playerid){ SetPlayerPos(playerid,spX[playerid],spY[playerid],spZ[playerid]); SetPlayerFacingAngle(playerid,spA[playerid]); LPT(playerid);}stock LoadPos2(playerid){ SetPlayerPos(playerid,spX2[playerid],spY2[playerid],spZ2[playerid]); SetPlayerFacingAngle(playerid,spA2[playerid]); LPT(playerid);}stock LoadPos3(playerid){ SetPlayerPos(playerid,spX3[playerid],spY3[playerid],spZ3[playerid]); SetPlayerFacingAngle(playerid,spA3[playerid]); LPT(playerid);}stock LoadPos4(playerid){ SetPlayerPos(playerid,spX4[playerid],spY4[playerid],spZ4[playerid]); SetPlayerFacingAngle(playerid,spA4[playerid]); LPT(playerid);}stock LoadPos5(playerid){ SetPlayerPos(playerid,spX5[playerid],spY5[playerid],spZ5[playerid]); SetPlayerFacingAngle(playerid,spA5[playerid]); LPT(playerid);}
#include <a_samp>#include <zcmd>#include <sscanf2>new Float:spX[MAX_PLAYERS],Float:spY[MAX_PLAYERS],Float:spZ[MAX_PLAYERS],Float:spA[MAX_PLAYERS];new Float:spX2[MAX_PLAYERS],Float:spY2[MAX_PLAYERS],Float:spZ2[MAX_PLAYERS],Float:spA2[MAX_PLAYERS];new Float:spX3[MAX_PLAYERS],Float:spY3[MAX_PLAYERS],Float:spZ3[MAX_PLAYERS],Float:spA3[MAX_PLAYERS];new Float:spX4[MAX_PLAYERS],Float:spY4[MAX_PLAYERS],Float:spZ4[MAX_PLAYERS],Float:spA4[MAX_PLAYERS];new Float:spX5[MAX_PLAYERS],Float:spY5[MAX_PLAYERS],Float:spZ5[MAX_PLAYERS],Float:spA5[MAX_PLAYERS];new bool:SavedPos[MAX_PLAYERS];new bool:SavedPos2[MAX_PLAYERS];new bool:SavedPos3[MAX_PLAYERS];new bool:SavedPos4[MAX_PLAYERS];new bool:SavedPos5[MAX_PLAYERS];#define SCM SendClientMessage#define LPT(%1) SCM(%1, -1, \"{ffff99}* Pozíciód {57a433}sikeresen {ffff99}betöltve.\")#define SPT(%1) SCM(%1, -1, \"{ffff99}* Pozíciód mentve, használd a {57a433}/lp {ffff99}parancsot a vissza teleportáláshoz.\")public OnPlayerConnect(playerid){SavedPos[playerid] = false;SavedPos2[playerid] = false;SavedPos3[playerid] = false;SavedPos4[playerid] = false;SavedPos5[playerid] = false;return 1;}public OnPlayerDisconnect(playerid){SavedPos[playerid] = false;SavedPos2[playerid] = false;SavedPos3[playerid] = false;SavedPos4[playerid] = false;SavedPos5[playerid] = false;return 1;}CMD:sp(playerid, params[]){new number;if(sscanf(params, \"d\", number)) return SendClientMessage(playerid, -1, \"{ffff99}/sp [1-5]\");if(strcmp(params, \"0\", true) == 0){SendClientMessage(playerid, -1, \"{ffff99}/sp [1-5]\");}if(strcmp(params, \"1\", true) == 0){SavePos(playerid);}if(strcmp(params, \"2\", true) == 0){SavePos2(playerid);}if(strcmp(params, \"3\", true) == 0){SavePos3(playerid);}if(strcmp(params, \"4\", true) == 0){SavePos4(playerid);}if(strcmp(params, \"5\", true) == 0){SavePos5(playerid);}return 1;}CMD:lp(playerid, params[]){ new number;if(sscanf(params, \"d\", number)) return SendClientMessage(playerid, -1, \"{ffff99}/lp [1-5]\");if(strcmp(params, \"0\", true) == 0){SendClientMessage(playerid, -1, \"{ffff99}/lp [1-5]\");}if(strcmp(params, \"1\", true) == 0){LoadPos(playerid);}if(strcmp(params, \"2\", true) == 0){LoadPos2(playerid);}if(strcmp(params, \"3\", true) == 0){LoadPos3(playerid);}if(strcmp(params, \"4\", true) == 0){LoadPos4(playerid);}if(strcmp(params, \"5\", true) == 0){LoadPos5(playerid);}return 1;}stock SavePos(playerid){GetPlayerPos(playerid,spX[playerid],spY[playerid],spZ[playerid]);GetPlayerFacingAngle(playerid,spA[playerid]);SavedPos[playerid] = true;SPT(playerid);}stock SavePos2(playerid){GetPlayerPos(playerid,spX2[playerid],spY2[playerid],spZ2[playerid]);GetPlayerFacingAngle(playerid,spA2[playerid]);SavedPos2[playerid] = true;SPT(playerid);}stock SavePos3(playerid){GetPlayerPos(playerid,spX3[playerid],spY3[playerid],spZ3[playerid]);GetPlayerFacingAngle(playerid,spA3[playerid]);SavedPos3[playerid] = true;SPT(playerid);}stock SavePos4(playerid){GetPlayerPos(playerid,spX4[playerid],spY4[playerid],spZ4[playerid]);GetPlayerFacingAngle(playerid,spA4[playerid]);SavedPos4[playerid] = true;SPT(playerid);}stock SavePos5(playerid){GetPlayerPos(playerid,spX5[playerid],spY5[playerid],spZ5[playerid]);GetPlayerFacingAngle(playerid,spA5[playerid]);SavedPos5[playerid] = true;SPT(playerid);}stock LoadPos(playerid){if(SavedPos[playerid] == true) { SetPlayerPos(playerid,spX[playerid],spY[playerid],spZ[playerid]); SetPlayerFacingAngle(playerid,spA[playerid]); LPT(playerid); } else { SCM(playerid, -1, \"{FF4646}Még nincs mentett pozíciód az {DDDDDD}/sp 1{ff4646} -nél/nál.\"); }}stock LoadPos2(playerid){if(SavedPos2[playerid] == true) { SetPlayerPos(playerid,spX2[playerid],spY2[playerid],spZ2[playerid]); SetPlayerFacingAngle(playerid,spA2[playerid]); LPT(playerid); } else { SCM(playerid, -1, \"{FF4646}Még nincs mentett pozíciód az {DDDDDD}/sp 2{ff4646} -nél/nál.\"); }}stock LoadPos3(playerid){if(SavedPos3[playerid] == true) { SetPlayerPos(playerid,spX3[playerid],spY3[playerid],spZ3[playerid]); SetPlayerFacingAngle(playerid,spA3[playerid]); LPT(playerid); } else { SCM(playerid, -1, \"{FF4646}Még nincs mentett pozíciód az {DDDDDD}/sp 3{ff4646} -nél/nál.\"); }}stock LoadPos4(playerid){if(SavedPos4[playerid] == true) { SetPlayerPos(playerid,spX4[playerid],spY4[playerid],spZ4[playerid]); SetPlayerFacingAngle(playerid,spA4[playerid]); LPT(playerid); } else { SCM(playerid, -1, \"{FF4646}Még nincs mentett pozíciód az {DDDDDD}/sp 4{ff4646} -nél/nál.\"); }}stock LoadPos5(playerid){if(SavedPos5[playerid] == true) { SetPlayerPos(playerid,spX5[playerid],spY5[playerid],spZ5[playerid]); SetPlayerFacingAngle(playerid,spA5[playerid]); LPT(playerid); } else { SCM(playerid, -1, \"{FF4646}Még nincs mentett pozíciód az {DDDDDD}/sp 5{ff4646} -nél/nál.\"); }}
Ha egyedül játszol a szerveren akkor elképzelhetõ hogy megfelelõen mûködik, de ha már többen akkor elég fura dolgokat fog produkálni.
Ha egyedül játszol a szerveren akkor elképzelhetõ hogy megfelelõen mûködik, de ha már többen akkor elég fura dolgokat fog produkálni. Még mindig. :DHa egy játékos elmenti a legelsõ pozíciót akkor egy másik játékos is elmenti az elsõt (beírják /sp 0) , akkor az elsõ játékos beírja /lp 0 és meglepõdik hogy õ nem ide mentette. :D [/quote]de miért? Pedig playerid van tehát jónak kellene lennie
new Float:spX,Float:spY,Float:spZ,Float:spA; //1new Float:spX2,Float:spY2,Float:spZ2,Float:spA2; //2new Float:spX3,Float:spY3,Float:spZ3,Float:spA3; //3new Float:spX4,Float:spY4,Float:spZ4,Float:spA4; //4new Float:spX5,Float:spY5,Float:spZ5,Float:spA5; //5
new Float:f[4][MAX_PLAYERS];
Ha egyedül játszol a szerveren akkor elképzelhetõ hogy megfelelõen mûködik, de ha már többen akkor elég fura dolgokat fog produkálni. Még mindig. :DHa egy játékos elmenti a legelsõ pozíciót akkor egy másik játékos is elmenti az elsõt (beírják /sp 0) , akkor az elsõ játékos beírja /lp 0 és meglepõdik hogy õ nem ide mentette. :D [/quote]de miért? Pedig playerid van tehát jónak kellene lennie [/quote] :facepalm:Mindem playernek létrekell hozni egy változót a [MAX_PLAYERS] operátorral v mivel amit közvetlen a változó neve után kell tenniE: megelõztek
Gondolom MAX_PLAYERS -re gondolt.E:Ezek helyett: new Float:spX,Float:spY,Float:spZ,Float:spA; //1new Float:spX2,Float:spY2,Float:spZ2,Float:spA2; //2new Float:spX3,Float:spY3,Float:spZ3,Float:spA3; //3new Float:spX4,Float:spY4,Float:spZ4,Float:spA4; //4new Float:spX5,Float:spY5,Float:spZ5,Float:spA5; //5 Mehetne ez is: new Float:f[4][MAX_PLAYERS];
new Float:spX[MAX_PLAYERS],Float:spY[MAX_PLAYERS],Float:spZ[MAX_PLAYERS],Float:spA[MAX_PLAYERS];new Float:spX2[MAX_PLAYERS],Float:spY2[MAX_PLAYERS],Float:spZ2[MAX_PLAYERS],Float:spA2[MAX_PLAYERS];new Float:spX3[MAX_PLAYERS],Float:spY3[MAX_PLAYERS],Float:spZ3[MAX_PLAYERS],Float:spA3[MAX_PLAYERS];new Float:spX4[MAX_PLAYERS],Float:spY4[MAX_PLAYERS],Float:spZ4[MAX_PLAYERS],Float:spA4[MAX_PLAYERS];new Float:spX5[MAX_PLAYERS],Float:spY5[MAX_PLAYERS],Float:spZ5[MAX_PLAYERS],Float:spA5[MAX_PLAYERS];
new Float:spX[MAX_PLAYERS][5],Float:spY[MAX_PLAYERS][5],Float:spZ[MAX_PLAYERS][5],Float:spA[MAX_PLAYERS][5];