Also ich habe dier hier im Forum gefunden und mein freund hat versucht es in den gm zu packen aber es stellte sich heraus das der verbugt ist oder so.
Ich dachte das ich euch frage was hier los sein könn
/Fraktionskassen by DominikGLL
// Materials, Drogen, Geld
#include <a_samp>
#pragma tabsize 0
#pragma dynamic 8912
#define COLOR_GRAD2 0xBFC0C2FF
//<--------------forward einfach zu den anderen forwards hinzufügen
forward LoadBank(); //---------Geld Bank
forward LoadMBank();//----------Mats-Bank
forward LoadDBank();//---------Drogen-Bank
forward payday(playerid); //------------Timer für den Payday
#define Fraktionsgeld 5000 //----------Anzahl Geld wie viel die Fraktionsbank bekommen soll
#define Payday 60 // nach wie vielen Minuten payday ist
new kasse[10]; //10 <---------- steht für die Anzahl deiner Fraktionen
new mkasse[10];
new dkasse[10];
enum pInfo
{
pLeader,
pMats,
pDrugs,
};
new PlayerInfo[MAX_PLAYERS][pInfo];
main()
{
print("\n----------------------------------");
print(" Fraktionskasse by DominikGLL");
print("----------------------------------\n");
}
public OnGameModeInit()
{
LoadBank(); // [
LoadMBank();// ------ [ Banken werden geladen!
LoadDBank();// [
SetTimer("payday",Payday*1000,1);
// Don't use these lines if it's a filterscript
SetGameModeText("Fraktionskasssen");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
stock ini_GetValue( line[] )
{
new valRes[256];
valRes[0]=0;
if ( strfind( line , "=" , true ) == -1 ) return valRes;
strmid( valRes , line , strfind( line , "=" , true )+1 , strlen( line ) , sizeof( valRes ) );
return valRes;
}
stock ini_GetKey( line[] )
{
new keyRes[256];
keyRes[0] = 0;
if ( strfind( line , "=" , true ) == -1 ) return keyRes;
strmid( keyRes , line , 0 , strfind( line , "=" , true ) , sizeof( keyRes) );
return keyRes;
}
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
public LoadBank()
{
new File: FKassen = fopen("FKassen.ini", io_read);
if(FKassen)
{
new key[ 256 ] , val[ 256 ];
new Data[ 256 ];
while ( fread( FKassen , Data , sizeof( Data ) ) )
{
key = ini_GetKey( Data );
if( strcmp( key , "Kasse1" , true ) == 0 ) { val = ini_GetValue( Data ); kasse[0]= strval( val ); }
if( strcmp( key , "Kasse2" , true ) == 0 ) { val = ini_GetValue( Data ); kasse[1]= strval( val ); }
if( strcmp( key , "Kasse3" , true ) == 0 ) { val = ini_GetValue( Data ); kasse[2]= strval( val ); }
if( strcmp( key , "Kasse4" , true ) == 0 ) { val = ini_GetValue( Data ); kasse[3]= strval( val ); }
if( strcmp( key , "Kasse5" , true ) == 0 ) { val = ini_GetValue( Data ); kasse[4]= strval( val ); }
if( strcmp( key , "Kasse6" , true ) == 0 ) { val = ini_GetValue( Data ); kasse[5]= strval( val ); }
if( strcmp( key , "Kasse7" , true ) == 0 ) { val = ini_GetValue( Data ); kasse[6]= strval( val ); }
if( strcmp( key , "Kasse8" , true ) == 0 ) { val = ini_GetValue( Data ); kasse[7]= strval( val ); }
if( strcmp( key , "Kasse9" , true ) == 0 ) { val = ini_GetValue( Data ); kasse[8]= strval( val ); }
if( strcmp( key , "Kasse10" , true ) == 0 ) { val = ini_GetValue( Data ); kasse[9]= strval( val ); }
}
fclose(FKassen);
}
return 1;
}
public LoadMBank()
{
new File: MKassen = fopen("MKassen.ini", io_read);
if(MKassen)
{
new key[ 256 ] , val[ 256 ];
new Data[ 256 ];
while ( fread( MKassen , Data , sizeof( Data ) ) )
{
key = ini_GetKey( Data );
if( strcmp( key , "MKasse1" , true ) == 0 ) { val = ini_GetValue( Data ); mkasse[0]= strval( val ); }
if( strcmp( key , "MKasse2" , true ) == 0 ) { val = ini_GetValue( Data ); mkasse[1]= strval( val ); }
if( strcmp( key , "MKasse3" , true ) == 0 ) { val = ini_GetValue( Data ); mkasse[2]= strval( val ); }
if( strcmp( key , "MKasse4" , true ) == 0 ) { val = ini_GetValue( Data ); mkasse[3]= strval( val ); }
if( strcmp( key , "MKasse5" , true ) == 0 ) { val = ini_GetValue( Data ); mkasse[4]= strval( val ); }
if( strcmp( key , "MKasse6" , true ) == 0 ) { val = ini_GetValue( Data ); mkasse[5]= strval( val ); }
if( strcmp( key , "MKasse7" , true ) == 0 ) { val = ini_GetValue( Data ); mkasse[6]= strval( val ); }
if( strcmp( key , "MKasse8" , true ) == 0 ) { val = ini_GetValue( Data ); mkasse[7]= strval( val ); }
if( strcmp( key , "MKasse9" , true ) == 0 ) { val = ini_GetValue( Data ); mkasse[8]= strval( val ); }
if( strcmp( key , "MKasse10" , true ) == 0 ) { val = ini_GetValue( Data ); mkasse[9]= strval( val ); }
}
fclose(MKassen);
}
return 1;
}
public LoadDBank()
{
new File: DKassen = fopen("DKassen.ini", io_read);
if(DKassen)
{
new key[ 256 ] , val[ 256 ];
new Data[ 256 ];
while ( fread( DKassen , Data , sizeof( Data ) ) )
{
key = ini_GetKey( Data );
if( strcmp( key , "DKasse1" , true ) == 0 ) { val = ini_GetValue( Data ); dkasse[0]= strval( val ); }
if( strcmp( key , "DKasse2" , true ) == 0 ) { val = ini_GetValue( Data ); dkasse[1]= strval( val ); }
if( strcmp( key , "DKasse3" , true ) == 0 ) { val = ini_GetValue( Data ); dkasse[2]= strval( val ); }
if( strcmp( key , "DKasse4" , true ) == 0 ) { val = ini_GetValue( Data ); dkasse[3]= strval( val ); }
if( strcmp( key , "DKasse5" , true ) == 0 ) { val = ini_GetValue( Data ); dkasse[4]= strval( val ); }
if( strcmp( key , "DKasse6" , true ) == 0 ) { val = ini_GetValue( Data ); dkasse[5]= strval( val ); }
if( strcmp( key , "DKasse7" , true ) == 0 ) { val = ini_GetValue( Data ); dkasse[6]= strval( val ); }
if( strcmp( key , "DKasse8" , true ) == 0 ) { val = ini_GetValue( Data ); dkasse[7]= strval( val ); }
if( strcmp( key , "DKasse9" , true ) == 0 ) { val = ini_GetValue( Data ); dkasse[8]= strval( val ); }
if( strcmp( key , "DKasse10" , true ) == 0 ) { val = ini_GetValue( Data ); dkasse[9]= strval( val ); }
}
fclose(DKassen);
}
return 1;
}
stock SaveBank()
{
new File: FKassen = fopen("FKassen.ini", io_write);
if (FKassen)
{
new var[32];
format(var, 32, "Kasse1=%d\n",kasse[0]);fwrite(FKassen, var);
format(var, 32, "Kasse2=%d\n",kasse[1]);fwrite(FKassen, var);
format(var, 32, "Kasse3=%d\n",kasse[2]);fwrite(FKassen, var);
format(var, 32, "Kasse4=%d\n",kasse[3]);fwrite(FKassen, var);
format(var, 32, "Kasse5=%d\n",kasse[4]);fwrite(FKassen, var);
format(var, 32, "Kasse6=%d\n",kasse[5]);fwrite(FKassen, var);
format(var, 32, "Kasse7=%d\n",kasse[6]);fwrite(FKassen, var);
format(var, 32, "Kasse8=%d\n",kasse[7]);fwrite(FKassen, var);
format(var, 32, "Kasse9=%d\n",kasse[8]);fwrite(FKassen, var);
format(var, 32, "Kasse10=%d\n",kasse[9]);fwrite(FKassen, var);
fclose(FKassen);
}
return 1;
}
stock SaveMBank()
{
new File: MKassen = fopen("MKassen.ini", io_write);
if (MKassen)
{
new var[32];
format(var, 32, "MKasse1=%d\n",mkasse[0]);fwrite(MKassen, var);
format(var, 32, "MKasse2=%d\n",mkasse[1]);fwrite(MKassen, var);
format(var, 32, "MKasse3=%d\n",mkasse[2]);fwrite(MKassen, var);
format(var, 32, "MKasse4=%d\n",mkasse[3]);fwrite(MKassen, var);
format(var, 32, "MKasse5=%d\n",mkasse[4]);fwrite(MKassen, var);
format(var, 32, "MKasse6=%d\n",mkasse[5]);fwrite(MKassen, var);
format(var, 32, "MKasse7=%d\n",mkasse[6]);fwrite(MKassen, var);
format(var, 32, "MKasse8=%d\n",mkasse[7]);fwrite(MKassen, var);
format(var, 32, "MKasse9=%d\n",mkasse[8]);fwrite(MKassen, var);
format(var, 32, "MKasse10=%d\n",mkasse[9]);fwrite(MKassen, var);
fclose(MKassen);
}
return 1;
}
stock SaveDBank()
{
new File: DKassen = fopen("DKassen.ini", io_write);
if (DKassen)
{
new var[32];
format(var, 32, "Kasse1=%d\n",dkasse[0]);fwrite(DKassen, var);
format(var, 32, "Kasse2=%d\n",dkasse[1]);fwrite(DKassen, var);
format(var, 32, "Kasse3=%d\n",dkasse[2]);fwrite(DKassen, var);
format(var, 32, "Kasse4=%d\n",dkasse[3]);fwrite(DKassen, var);
format(var, 32, "Kasse5=%d\n",dkasse[4]);fwrite(DKassen, var);
format(var, 32, "Kasse6=%d\n",dkasse[5]);fwrite(DKassen, var);
format(var, 32, "Kasse7=%d\n",dkasse[6]);fwrite(DKassen, var);
format(var, 32, "Kasse8=%d\n",dkasse[7]);fwrite(DKassen, var);
format(var, 32, "Kasse9=%d\n",dkasse[8]);fwrite(DKassen, var);
format(var, 32, "Kasse10=%d\n",dkasse[9]);fwrite(DKassen, var);
fclose(DKassen);