[POMOC]YSI

Započeo Nadroj
3. Apr. 2013. Zaključano
289
pregleda
9
postova
ladolez
5
Underboss
3. Apr. 2013.
skripta koju koristim: moja od 0
opis problema:

izbaci mi da vec koristim FILE a ja ga koristim na 2 mesta jer tako mi treba e sad jel moze neko da mi pomogle kako da resim to da drugacije bude... evo kodovi

    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Novac",GetPlayerMoney(playerid));
    INI_WriteInt(File,"Admin",PlayerInfo);
    INI_WriteInt(File,"Ubistva",PlayerInfo);
    INI_WriteInt(File,"Smrti",PlayerInfo);
INI_WriteInt(File,"Rank",PlayerInfo);
INI_WriteInt(File,"Clan",PlayerInfo);
INI_WriteInt(File,"Lider",PlayerInfo);
    INI_WriteInt(File,"Skin",PlayerInfo);
    INI_Close(File);
//============================
GetPlayerPos( playerid, PosX[ playerid ], PosY[ playerid ], PosZ[ playerid ] );
    GetPlayerFacingAngle( playerid, Angle[ playerid ] );

    new INI:File = INI_Open( user_ini_file( playerid ) );
    INI_SetTag( File, "position" );
    INI_WriteFloat( File, "PositionX", PosX[ playerid ] );
    INI_WriteFloat( File, "PositionY", PosY[ playerid ] );
    INI_WriteFloat( File, "PositionZ", PosZ[ playerid ] );
    INI_WriteFloat( File, "Angle", Angle[ playerid ] );
    INI_WriteInt( File, "Interior", GetPlayerInterior( playerid ) );
    INI_WriteInt( File, "VirtualWorld", GetPlayerVirtualWorld( playerid ) );
    INI_Close( File );
    return 1;
Mish26
4
Shot Caller
3. Apr. 2013.
Jel su u istoj komandi ili ?
Marko Koprivanac
5
Underboss
3. Apr. 2013.
    new INI:Fajl = INI_Open(UserPath(playerid));
    INI_SetTag(Fajl,"data");
    INI_WriteInt(Fajl,"Novac",GetPlayerMoney(playerid));
    INI_WriteInt(Fajl,"Admin",PlayerInfo);
    INI_WriteInt(Fajl,"Ubistva",PlayerInfo);
    INI_WriteInt(Fajl,"Smrti",PlayerInfo);
INI_WriteInt(Fajl,"Rank",PlayerInfo);
INI_WriteInt(Fajl,"Clan",PlayerInfo);
INI_WriteInt(Fajl,"Lider",PlayerInfo);
    INI_WriteInt(Fajl,"Skin",PlayerInfo);
    INI_Close(Fajl);
//============================
GetPlayerPos( playerid, PosX[ playerid ], PosY[ playerid ], PosZ[ playerid ] );
    GetPlayerFacingAngle( playerid, Angle[ playerid ] );

    new INI:Fajl = INI_Open( user_ini_Fajl( playerid ) );
    INI_SetTag( Fajl, "position" );
    INI_WriteFloat( Fajl, "PositionX", PosX[ playerid ] );
    INI_WriteFloat( Fajl, "PositionY", PosY[ playerid ] );
    INI_WriteFloat( Fajl, "PositionZ", PosZ[ playerid ] );
    INI_WriteFloat( Fajl, "Angle", Angle[ playerid ] );
    INI_WriteInt( Fajl, "Interior", GetPlayerInterior( playerid ) );
    INI_WriteInt( Fajl, "VirtualWorld", GetPlayerVirtualWorld( playerid ) );
    INI_Close( Fajl );
    return 1;
ladolez
5
Underboss
3. Apr. 2013.
da ali da li ce moci onda ovo da uradi
#include 
#include

new
    Float: PosX[ MAX_PLAYERS ],
    Float: PosY[ MAX_PLAYERS ],
    Float: PosZ[ MAX_PLAYERS ],
    Float: Angle[ MAX_PLAYERS ],
    Interior[ MAX_PLAYERS ],
    VirtualWorld[ MAX_PLAYERS ]
;

stock user_ini_file(playerid)
{
    new
        string[ 128 ],
        user_name[ MAX_PLAYER_NAME ]
    ;

    GetPlayerName( playerid, user_name, MAX_PLAYER_NAME );
    format( string, sizeof ( string ), "%s.ini", user_name );
    /* scriptfiles directory */
    return
        string;
}

forward @load_user_position( playerid, name[], value[] );

@load_user_position( playerid, name[], value[] )
{
    INI_Float( "PositionX", PosX[ playerid ] );
    INI_Float( "PositionY", PosY[ playerid ] );
    INI_Float( "PositionZ", PosZ[ playerid ] );
    INI_Float( "Angle", Angle[ playerid ] );
    INI_Int( "Interior", Interior[ playerid ] );
    INI_Int( "VirtualWorld", VirtualWorld[ playerid ] );
    return ( 1 );
}

public OnPlayerDisconnect( playerid, reason )
{
    GetPlayerPos( playerid, PosX[ playerid ], PosY[ playerid ], PosZ[ playerid ] );
    GetPlayerFacingAngle( playerid, Angle[ playerid ] );
   
    new INI:File = INI_Open( user_ini_file( playerid ) );
    INI_SetTag( File, "position" );
    INI_WriteFloat( File, "PositionX", PosX[ playerid ] );
    INI_WriteFloat( File, "PositionY", PosY[ playerid ] );
    INI_WriteFloat( File, "PositionZ", PosZ[ playerid ] );
    INI_WriteFloat( File, "Angle", Angle[ playerid ] );
    INI_WriteInt( File, "Interior", GetPlayerInterior( playerid ) );
    INI_WriteInt( File, "VirtualWorld", GetPlayerVirtualWorld( playerid ) );
    INI_Close( File );
    return ( 1 );
}

public OnPlayerConnect( playerid )
{
    PosX[ playerid ] = 0;
    PosY[ playerid ] = 0;
    PosZ[ playerid ] = 0;
    Angle[ playerid ] = 0;
    Interior[ playerid ] = 0;
    VirtualWorld[ playerid ] = 0;
   
    INI_ParseFile( user_ini_file( playerid ), "load_user_%s", .bExtra = true, .extra = playerid );
    return ( 1 );
}

public OnPlayerSpawn( playerid )
{
    if ( PosX[ playerid ] != 0 && PosY[ playerid ] != 0 && PosZ[ playerid ] != 0 )
    {
        SetPlayerPos( playerid, PosX[ playerid ], PosY[ playerid ], PosZ[ playerid ] );
        SetPlayerFacingAngle( playerid, Angle[ playerid ] );
        SetPlayerInterior( playerid, Interior[ playerid ] );
        SetPlayerVirtualWorld( playerid, VirtualWorld[ playerid ] );
        SendClientMessage( playerid, -1, "Dobrodosli nazad" );
    }
    return ( 1 );
}


evo kako bi ceo kod trebao
ladolez
5
Underboss
3. Apr. 2013.
probao sam kao sto si reko i nece
FlasHica
5
Kingpin
3. Apr. 2013.
new INI:Sisa ?? zašto nebi tako uradio?

a vjerovatno imaš globalnu varijablu 'File' pa je logično da system nemože prepoznat koju ćeš ti koristit.

edit: ne bumpaj svakih sat vremena, pročitaj pravila!
ladolez
5
Underboss
3. Apr. 2013.
i na kraju sta da uradim?
FlasHica
5
Kingpin
3. Apr. 2013.
ladolez wrote on April 3, 2013, 3:10 pm:
i na kraju sta da uradim?

omg
...
new INI:File2 = INI_Open( user_ini_file( playerid ) );
    INI_SetTag( File2, "position" );
    INI_WriteFloat( File2, "PositionX", PosX[ playerid ] );
    INI_WriteFloat( File2, "PositionY", PosY[ playerid ] );
    INI_WriteFloat( File2, "PositionZ", PosZ[ playerid ] );
    INI_WriteFloat( File2, "Angle", Angle[ playerid ] );
    INI_WriteInt( File2, "Interior", GetPlayerInterior( playerid ) );
    INI_WriteInt( File2, "VirtualWorld", GetPlayerVirtualWorld( playerid ) );
    INI_Close( File2);


eto ti primjer.. dalje ćeÅ¡ skužit valjda  :-*
ladolez
5
Underboss
3. Apr. 2013.
neradi -.-

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha