public OnPlayerDisconnect(playerid, reason){ Speedometer_Cleanup(playerid);if(lepve[playerid] == 1){ save(playerid);}nullazas(playerid);new Float:X[MAX_PLAYERS], Float:Y[MAX_PLAYERS], Float:Z[MAX_PLAYERS];new name[MAX_PLAYER_NAME];GetPlayerPos(playerid, X[playerid], Y[playerid], Z[playerid]);GetPlayerName(playerid, name, sizeof(name));format(file, sizeof(file), \"/pos/%s.ini\", name);if(!dini_Exists(file)) return dini_Create(file);dini_FloatSet(file, \"Lx\", X[playerid]);dini_FloatSet(file, \"Ly\", Y[playerid]);dini_FloatSet(file, \"Lz\", Z[playerid]);return 1;}public OnPlayerSpawn(playerid){TextDrawShowForPlayer(playerid, ForintTextDraw); new name[MAX_PLAYER_NAME]; new Float:X[MAX_PLAYERS], Float:Y[MAX_PLAYERS], Float:Z[MAX_PLAYERS];GetPlayerName(playerid, name, sizeof(name));new Float:Xx, Float:Yy, Float:Zz;for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(playerid, i, false);format(file, sizeof(file), \"/pos/%s.ini\", name);if(!dini_Exists(file)){ dini_FloatSet(file, \"Lx\", X[playerid]);dini_FloatSet(file, \"Ly\", Y[playerid]);dini_FloatSet(file, \"Lz\", Z[playerid]);SetPlayerPos(playerid, -1408.2825,2654.6626,55.6875);}else{Xx = dini_Int(file, \"Lx\");Yy = dini_Int(file, \"Ly\");Zz = dini_Int(file, \"Lz\");SetPlayerPos(playerid, Xx, Yy, Zz);}return 1;}
#include < a_samp >#include < dini >new file[ 60 ], name[ MAX_PLAYER_NAME ];public OnPlayerDisconnect( playerid, reason ){ new Float:fPos[ 3 ]; GetPlayerPos( playerid, fPos[ 0 ], fPos[ 1 ], fPos[ 2 ] ); GetPlayerName( playerid, name, MAX_PLAYER_NAME ); format( file, sizeof( file ), \"pos/%s.ini\", name ); if( !dini_Exists( file ) ) { dini_Create( file ); dini_FloatSet(file, \"KooX\", fPos[ 0 ] ); dini_FloatSet(file, \"KooY\", fPos[ 1 ] ); dini_FloatSet(file, \"KooZ\", fPos[ 2 ] ); } else { dini_FloatSet(file, \"KooX\", fPos[ 0 ] ); dini_FloatSet(file, \"KooY\", fPos[ 1 ] ); dini_FloatSet(file, \"KooZ\", fPos[ 2 ] ); } return 1;} public OnPlayerSpawn( playerid ){ new Float:fPos[ 3 ]; GetPlayerName( playerid, name, MAX_PLAYER_NAME ); format( file, sizeof( file ), \"pos/%s.ini\", name ); if( dini_Exists( file ) ) { fPos[ 0 ] = dini_Float( file, \"KooX\" ); fPos[ 1 ] = dini_Float( file, \"KooY\" ); fPos[ 2 ] = dini_Float( file, \"KooZ\" ); SetPlayerPos( playerid, fPos[ 0 ], fPos[ 1 ], fPos[ 2 ] ); } else { SetPlayerPos( playerid, -1408.2825,2654.6626,55.6875) ; } return 1;}
Az általam vélt fölösleges dolgokat kivettem, majd rakd vissza. Így próbáld meg: #include < a_samp >#include < dini >new file[ 60 ], name[ MAX_PLAYER_NAME ];public OnPlayerDisconnect( playerid, reason ){ new Float:fPos[ 3 ]; GetPlayerPos( playerid, fPos[ 0 ], fPos[ 1 ], fPos[ 2 ] ); GetPlayerName( playerid, name, MAX_PLAYER_NAME ); format( file, sizeof( file ), \"pos/%s.ini\", name ); if( !dini_Exists( file ) ) { dini_Create( file ); dini_FloatSet(file, \"KooX\", fPos[ 0 ] ); dini_FloatSet(file, \"KooY\", fPos[ 1 ] ); dini_FloatSet(file, \"KooZ\", fPos[ 2 ] ); } else { dini_FloatSet(file, \"KooX\", fPos[ 0 ] ); dini_FloatSet(file, \"KooY\", fPos[ 1 ] ); dini_FloatSet(file, \"KooZ\", fPos[ 2 ] ); } return 1;} public OnPlayerSpawn( playerid ){ new Float:fPos[ 3 ]; GetPlayerName( playerid, name, MAX_PLAYER_NAME ); format( file, sizeof( file ), \"pos/%s.ini\", name ); if( dini_Exists( file ) ) { fPos[ 0 ] = dini_Float( file, \"KooX\" ); fPos[ 1 ] = dini_Float( file, \"KooY\" ); fPos[ 2 ] = dini_Float( file, \"KooZ\" ); SetPlayerPos( playerid, fPos[ 0 ], fPos[ 1 ], fPos[ 2 ] ); } else { SetPlayerPos( playerid, -1408.2825,2654.6626,55.6875) ; } return 1;}