help with some error
#2

here you go sir
PHP код:
//INCLUDE
#include <a_samp>
#include <dini>
//new
new nome[25];
new 
stringa[250];

enum Giocatore1{Livello,Uccisioni,Morti,Loggato};
new 
Giocatore[MAX_PLAYERS][Giocatore1];

//define
#define DIALOGREG 1060
#define DIALOGLOGIN 1061
//enum

#if defined FilterScript
public OnFilterScriptInit()
{
    print(
"\n--------------------------------------");
    print(
" edwardstone");
    print(
"--------------------------------------\n");
    return 
1;
}

public 
OnFilterScriptExit()
{
    return 
1;
}

#else

main()
{
    print(
"\n----------------------------------");
    print(
" edwardstone");
    print(
"----------------------------------\n");
}

#endif

public OnGameModeInit()
{
    
// Don't use these lines if it's a filterscript
    
SetGameModeText("edwardstone");
    
AddPlayerClass(01958.37831343.157215.3746269.1425000000);
    return 
1;
}

public 
OnGameModeExit()
{
    return 
1;
}

public 
OnPlayerRequestClass(playeridclassid)
{
    
SetPlayerPos(playerid1958.37831343.157215.3746);
    
SetPlayerCameraPos(playerid1958.37831343.157215.3746);
    
SetPlayerCameraLookAt(playerid1958.37831343.157215.3746);
    return 
1;
}

public 
OnPlayerConnect(playerid)
{
    
GetPlayerName(playerid,nome,sizeof(nome));
    
format(stringa,sizeof(stringa),"Utenti/%s",nome);
    if(!
dini_Exists(stringa)) //Controlla se il file non esiste
    
ShowPlayerDialog(playerid,DIALOGREG,DIALOG_STYLE_INPUT,"Registrazione","Benvenuto nel server.Immetti la password per registrarti","Registrati","");
    else 
//Se il file esiste
    
ShowPlayerDialog(playerid,DIALOGLOGIN,DIALOG_STYLE_INPUT,"Login","Bentornato nel server.Immetti la tua password per loggarti","Login","");
    return 
1;
}

public 
OnPlayerDisconnect(playerid)
{
    if(!
Giocatore[playerid][Loggato]) return 1//Se il giocatore non и loggato non salva i dati
    
GetPlayerName(playerid,nome,sizeof(nome));
    
format(stringa,sizeof(stringa),"Utenti/%s",nome);
    
dini_IntSet(stringa,"Livello",Giocatore[playerid][Livello]);//Salva tutti i valori che ci interessano
    
dini_IntSet(stringa,"Morti",Giocatore[playerid][Morti]);
    
dini_IntSet(stringa,"Uccisioni",Giocatore[playerid][Uccisioni]);
    
Giocatore[playerid][Loggato]=0;//Cancelliamo lo status loggato per il player
    
return 1;
}

public 
OnPlayerSpawn(playerid)
{
    return 
1;
}

public 
OnPlayerDeath(playeridkilleridreason)
{
    
Giocatore[playerid][Morti]++;//Aumentiamo il valore dei dati da salvare
    
Giocatore[killerid][Uccisioni]++;
    return 
1;
}

public 
OnVehicleSpawn(vehicleid)
{
    return 
1;
}

public 
OnVehicleDeath(vehicleidkillerid)
{
    return 
1;
}

public 
OnPlayerText(playeridtext[])
{
    return 
1;
}

public 
OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/mycommand"cmdtexttrue10) == 0)
    {
        
// Do something here
        
return 1;
    }
    return 
0;
}

public 
OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    return 
1;
}

public 
OnPlayerExitVehicle(playeridvehicleid)
{
    return 
1;
}

public 
OnPlayerStateChange(playeridnewstateoldstate)
{
    return 
1;
}

public 
OnPlayerEnterCheckpoint(playerid)
{
    return 
1;
}

public 
OnPlayerLeaveCheckpoint(playerid)
{
    return 
1;
}

public 
OnPlayerEnterRaceCheckpoint(playerid)
{
    return 
1;
}

public 
OnPlayerLeaveRaceCheckpoint(playerid)
{
    return 
1;
}

public 
OnRconCommand(cmd[])
{
    return 
1;
}

public 
OnPlayerRequestSpawn(playerid)
{
    return 
1;
}

public 
OnObjectMoved(objectid)
{
    return 
1;
}

public 
OnPlayerObjectMoved(playeridobjectid)
{
    return 
1;
}

public 
OnPlayerPickUpPickup(playeridpickupid)
{
    return 
1;
}

public 
OnVehicleMod(playeridvehicleidcomponentid)
{
    return 
1;
}

public 
OnVehiclePaintjob(playeridvehicleidpaintjobid)
{
    return 
1;
}

public 
OnVehicleRespray(playeridvehicleidcolor1color2)
{
    return 
1;
}

public 
OnPlayerSelectedMenuRow(playeridrow)
{
    return 
1;
}

public 
OnPlayerExitedMenu(playerid)
{
    return 
1;
}

public 
OnPlayerInteriorChange(playeridnewinterioridoldinteriorid)
{
    return 
1;
}

public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    return 
1;
}

public 
OnRconLoginAttempt(ip[], password[], success)
{
    return 
1;
}

public 
OnPlayerUpdate(playerid)
{
    return 
1;
}

public 
OnPlayerStreamIn(playeridforplayerid)
{
    return 
1;
}

public 
OnPlayerStreamOut(playeridforplayerid)
{
    return 
1;
}

public 
OnVehicleStreamIn(vehicleidforplayerid)
{
    return 
1;
}

public 
OnVehicleStreamOut(vehicleidforplayerid)
{
    return 
1;
}

public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid==DIALOGREG) {
       if(!
response)return Kick(playerid); //kicka il player se salta la registrazione
       
if(!strlen(inputtext))return
       
ShowPlayerDialog(playerid,DIALOGREG,DIALOG_STYLE_INPUT,"Registrazione","INSERISCI UNA PASSWORD\nImmetti una password per registrarti","Registrati","");
       
GetPlayerName(playerid,nome,sizeof(nome));
       
format(stringa,sizeof(stringa),"Utenti/%s",nome);
       
dini_Create(stringa); //Crea il file per l'account utente
       
dini_IntSet(stringa,"Livello",0);
       
dini_IntSet(stringa,"Uccisioni",0);
       
dini_IntSet(stringa,"Morti",0);
       
dini_Set(stringa,"Password",inputtext);
       
ShowPlayerDialog(playerid,DIALOGLOGIN,DIALOG_STYLE_INPUT,"Login","Ora sei registrato.Immetti la password per loggarti","Login","");
    }
    if(
dialogid==DIALOGLOGIN){
       if(!
response )return Kick(playerid); //kicka il player che nn logga
       
GetPlayerName(playerid,nome,sizeof(nome));
       
format(stringa,sizeof(stringa),"Utenti/%s",nome);
       new 
Pass[250];
       
format(Pass,sizeof Pass,"%s",dini_Get(stringa,"Password"));
       if(
strcmp(Pass,inputtext,true)||!strlen(inputtext)) { //controlla se la password и corretta
           
ShowPlayerDialog(playerid,DIALOGLOGIN,DIALOG_STYLE_INPUT,"Login","PASSWORD ERRATA\nImmetti la password per loggarti","Login","");
           return 
1;
       }
       
Giocatore[playerid][Livello]=dini_Int(stringa,"Livello");//Qui carica i dati del giocatore
       
Giocatore[playerid][Morti]=dini_Int(stringa,"Morti");
       
Giocatore[playerid][Uccisioni]=dini_Int(stringa,"Uccisioni");
       
Giocatore[playerid][Loggato]=1//Ci servirа quando si disconnetterа
    
}
    return 
1;

Reply


Messages In This Thread
help with some error - by kevi11 - 01.04.2016, 18:04
Re: help with some error - by jlalt - 01.04.2016, 18:12
Re: help with some error - by kevi11 - 01.04.2016, 18:14

Forum Jump:


Users browsing this thread: 1 Guest(s)