SA-MP Forums Archive
Please help! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Please help! (/showthread.php?tid=268430)



Please help! - Pasa - 12.07.2011

i have drug system (it's not my) because i am a beginer i don't understund dini (i don't know how to save the drugs)
can any body help me!

script
http://www.mediafire.com/?gsa1cvtw1657s76

if you can give me the script when you make that drug will save

the line that have should seve the drugs
PHP код:
public SaveDrugs(playerid)
{
    if(
IsPlayerConnected(playerid) == 1)
    {
        new 
string[64];
        
format(stringsizeof(string), "drugs/%s.ini"PlayerName(playerid));
        if(
dini_Exists(string))
        {
            
dini_IntSet(string"Weed"PlayerInfo[playerid][sWeed]);
            
dini_IntSet(string"Cocaine"PlayerInfo[playerid][sCocaine]);
            
dini_IntSet(string"Crack"PlayerInfo[playerid][sCrack]);
            
dini_IntSet(string"Heroin"PlayerInfo[playerid][sHeroin]);
            
dini_IntSet(string"Ecstacy"PlayerInfo[playerid][sEcstacy]);
            
dini_IntSet(string"Steriods"PlayerInfo[playerid][sSteriods]);
        }
    }
    return 
1;
}
//==============================================================================
public LoadDrugs(playerid)
{
    new 
string2[64];
    
format(string2sizeof(string2), "drugs/%s.ini"PlayerName(playerid));
    new 
playername2[MAX_PLAYER_NAME];
    
GetPlayerName(playeridplayername2sizeof(playername2));
    {
        
PlayerInfo[playerid][sWeed] = dini_Int(string2,"Weed");
        
PlayerInfo[playerid][sCocaine] = dini_Int(string2,"Cocaine");
        
PlayerInfo[playerid][sCrack] = dini_Int(string2,"Crack");
        
PlayerInfo[playerid][sHeroin] = dini_Int(string2,"Heroin");
        
PlayerInfo[playerid][sEcstacy] = dini_Int(string2,"Ecstacy");
        
PlayerInfo[playerid][sSteriods] = dini_Int(string2,"Steriods");
    }
    return 
1;

when i go to compail there are no problems


Re: Please help! - Wesley221 - 12.07.2011

Do you have a folder called "drugs" in your scriptfiles?


Re: Please help! - Pasa - 12.07.2011

Yes of course