ini SetString problem
#1

Код:
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, "Admin", 0);
		//ini_setString ( playerFile, "Admin", Account[playerid][Admin] = 0);		ini_closeFile ( playerFile );
		SendClientMessage( playerid, RULE, "finish" );
		PlayerPlaySound( playerid, 1058, 0.0, 0.0, 0.0 );
		SetPVarInt( playerid, "pLogged", 1 );
I want to do a query if someone is admin but it'll always fail
what is here wrong
I want him to write in the ini file Admin == 0
Код:
C:\AV.pwn(4819) : error 035: argument type mismatch (argument 3)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#2

It's a string value that you need to set, not a integer.
Reply
#3

I can do this best?
Reply
#4

now i have this

Код:
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 );
how can I retrieve rank as admin? in this script

Код:
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 );
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)