Moin hier Auszüge aus der Gamemod
Code
Function PlayerUpdate(playerid)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid])
{
M_OnPlayerUpdate(playerid);
new string3[64];
new playername3[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername3, sizeof(playername3));
format(string3, sizeof(string3), "/Accounts/%s.ini", playername3);
new File: hFile = fopen(string3, io_write);
if (hFile)
{
new var[32];
format(var, 32, "Key=%s\n", PlayerInfo[playerid][pKey]);fwrite(hFile, var);
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
format(var, 32, "Level=%d\n",PlayerInfo[playerid][pLevel]);fwrite(hFile, var);
format(var, 32, "AdminLevel=%d\n",PlayerInfo[playerid][pAdmin]);fwrite(hFile, var);
format(var, 32, "Teamspeak=%d\n",PlayerInfo[playerid][pTeamspeak]);fwrite(hFile, var);
fclose(hFile);
}
}
}
return 1;
}
Alles anzeigen
Code
Function OnPlayerLogin(playerid,password[])
{
new tmp2[256];
new string2[128];
new playername2[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername2, sizeof(playername2));
format(string2, sizeof(string2), "/Accounts/%s.ini", playername2);
new File: UserFile = fopen(string2, io_read);
if ( UserFile )
{
new PassData[256];
new keytmp[256], valtmp[256];
fread( UserFile , PassData , sizeof( PassData ) );
keytmp = ini_GetKey( PassData );
if( strcmp( keytmp , "Key" , true ) == 0 )
{
valtmp = ini_GetValue( PassData );
strmid(PlayerInfo[playerid][pKey], valtmp, 0, strlen(valtmp)-1, 255);
}
if(strcmp(PlayerInfo[playerid][pKey],password, true ) == 0 )
{
new key[ 256 ] , val[ 256 ];
new Data[ 256 ];
while ( fread( UserFile , Data , sizeof( Data ) ) )
{
key = ini_GetKey( Data );
if( strcmp( key , "Level" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLevel] = strval( val ); }
if( strcmp( key , "AdminLevel" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAdmin] = strval( val ); }
if( strcmp( key , "Teamspeak" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pTeamspeak] = strval( val ); }
new weapon[14];
new ammo[14];
for(new i = 1;i< 14;i++)
{
new tmpstring[128];
format(tmpstring,sizeof tmpstring, "waffenslot%d",i);
if( strcmp( key , tmpstring , true ) == 0)weapon[i-1] = strval(ini_GetValue( Data ));
format(tmpstring,sizeof tmpstring, "ammoslot%d",i);
if( strcmp( key , tmpstring , true ) == 0)ammo[i-1] = strval(ini_GetValue( Data ));
GivePlayerWeapon(playerid,weapon[i-1],ammo[i-1]);
}
}//end while
fclose(UserFile);//close the file after everything has been read in the while
}
else
{
return 1;
}
Alles anzeigen
Code
if (strcmp(cmdtext, "/boscotsuid", true)==0)
{
ShowPlayerDialog(playerid, TeamspeakUid, DIALOG_STYLE_INPUT, "Teamspeak User id", "Bitte gebe hier dein Teamspeak User id ein.", "Annehmen", "Abbrechen");
return 1;
}
if (strcmp(cmdtext, "/boscots2", true)==0)
{
new tsClient = TSC_GetClientIdByUid(PlayerInfo[playerid][pTeamspeak]);
TSC_MoveClient(tsClient, 6);
return 1;
}
if(dialogid == TeamspeakUid)
{
if(response)
{
if(response == 1)
{
new string[128],str[64];
format(string, sizeof(string), "%s",inputtext);
strmid(PlayerInfo[playerid][pTeamspeak], string, 0, strlen(string), 255);
format(str, 256, "Du hast dein Teamspeak User ID erfolgreich eingeben: %s",PlayerInfo[playerid][pTeamspeak]);
SendClientMessage(playerid, COLOR_RED, str);
PlayerUpdate(playerid);
return 1;
}
}
}
Alles anzeigen
aus der Accounts Bosco
sollte aber so aus sehen: p5g4HacZGu166uVICY7E7VB2yuw=