10.10.2011, 18:09
now i have this
how can I retrieve rank as admin? in this script
Код:
public OnPlayerRegister( playerid, password[ ] ) { new p_str[ 48 ], str[ 32 ], playerFile; format( p_str, sizeof( p_str ), PLAYER_FILE, PlayerName( playerid ) ); if( !fexist( p_str ) ) { new hour, minute, second; getdate( gYear, gMonth, gDay ); gettime( hour, minute, second ); playerFile = ini_createFile ( p_str ); format( str, sizeof( str ), "%i/%s/%i - %02d:%02d:%02d", gDay, Months[ gMonth-1 ], gYear, hour, minute, second ); ini_setString ( playerFile, "Date_Registered", str ); ini_setString ( playerFile, "Password_hash", Whirlpool_hash( password ) ); ini_setString(playerFile,"AdminLevel", "0"); ini_closeFile ( playerFile ); SendClientMessage( playerid, RULE, "Dein Account wurde erfolgreich erstellt" ); PlayerPlaySound( playerid, 1058, 0.0, 0.0, 0.0 ); SetPVarInt( playerid, "pLogged", 1 );
Код:
stock LoadPlayerData( playerid, file[ ] ) { new explode_str[ 128 ], str[ 28 ], data[ 2 ]; new playerFile = ini_openFile( file ); format( str, sizeof ( str ), "Month_kills_%i", gYear ); ini_getString ( playerFile, str, explode_str ); explodevalue( p_month_kills[ playerid ], explode_str, "|" ); format( str, sizeof( str ), "Month_deaths_%i", gYear ); ini_getString ( playerFile, str, explode_str ); explodevalue( p_month_deaths[ playerid ], explode_str, "|" ); ini_getString ( playerFile, "Total_kills_deaths", explode_str ); explodevalue( data, explode_str, "|" ); SetPVarInt( playerid, "pKills", data[ 0 ] ); SetPVarInt( playerid, "pDeaths", data [ 1 ] ); ini_closeFile ( playerFile ); }