help with some error -
kevi11 - 01.04.2016
Script:
PHP код:
//INCLUDE
#include <a_samp>
#include <dini>
//new
new nome[25];
new stringa[250];
new Giocatore[MAX_PLAYERS][Giocatore];
//define
#define DIALOGREG 1060
#define DIALOGLOGIN 1061
//enum
enum Giocatore{Livello,Uccisioni,Morti,Loggato};
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(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.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_Int(stringa,"Livello",Giocatore[playerid][Livello]);//Salva tutti i valori che ci interessano
dini_Int(stringa,"Morti",Giocatore[playerid][Morti]);
dini_Int(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(playerid, killerid, reason)
{
Giocatore[playerid][Morti]++;//Aumentiamo il valore dei dati da salvare
Giocatore[killerid][Uccisioni]++;
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
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(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
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];
Pass=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;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
Error:
PHP код:
C:\Users\Kevin11\Desktop\server freeroam\gamemodes\freeroam.pwn(7) : error 017: undefined symbol "Giocatore"
C:\Users\Kevin11\Desktop\server freeroam\gamemodes\freeroam.pwn(7) : error 009: invalid array size (negative, zero or out of bounds)
C:\Users\Kevin11\Desktop\server freeroam\gamemodes\freeroam.pwn(12) : error 021: symbol already defined: "Giocatore"
C:\Users\Kevin11\Desktop\server freeroam\gamemodes\freeroam.pwn(27) : error 026: no matching "#if..."
C:\Users\Kevin11\Desktop\server freeroam\gamemodes\freeroam.pwn(36) : error 026: no matching "#if..."
C:\Users\Kevin11\Desktop\server freeroam\gamemodes\freeroam.pwn(72) : warning 213: tag mismatch
C:\Users\Kevin11\Desktop\server freeroam\gamemodes\freeroam.pwn(75) : warning 213: tag mismatch
C:\Users\Kevin11\Desktop\server freeroam\gamemodes\freeroam.pwn(75) : warning 202: number of arguments does not match definition
C:\Users\Kevin11\Desktop\server freeroam\gamemodes\freeroam.pwn(76) : warning 213: tag mismatch
C:\Users\Kevin11\Desktop\server freeroam\gamemodes\freeroam.pwn(76) : warning 202: number of arguments does not match definition
C:\Users\Kevin11\Desktop\server freeroam\gamemodes\freeroam.pwn(77) : warning 213: tag mismatch
C:\Users\Kevin11\Desktop\server freeroam\gamemodes\freeroam.pwn(77) : warning 202: number of arguments does not match definition
C:\Users\Kevin11\Desktop\server freeroam\gamemodes\freeroam.pwn(78) : warning 213: tag mismatch
C:\Users\Kevin11\Desktop\server freeroam\gamemodes\freeroam.pwn(89) : warning 213: tag mismatch
C:\Users\Kevin11\Desktop\server freeroam\gamemodes\freeroam.pwn(90) : warning 213: tag mismatch
C:\Users\Kevin11\Desktop\server freeroam\gamemodes\freeroam.pwn(265) : error 047: array sizes do not match, or destination array is too small
C:\Users\Kevin11\Desktop\server freeroam\gamemodes\freeroam.pwn(268) : error 017: undefined symbol "DIALOGLOGIN_DIALOG_STYLE_INPUT"
C:\Users\Kevin11\Desktop\server freeroam\gamemodes\freeroam.pwn(271) : warning 213: tag mismatch
C:\Users\Kevin11\Desktop\server freeroam\gamemodes\freeroam.pwn(272) : warning 213: tag mismatch
C:\Users\Kevin11\Desktop\server freeroam\gamemodes\freeroam.pwn(273) : warning 213: tag mismatch
C:\Users\Kevin11\Desktop\server freeroam\gamemodes\freeroam.pwn(274) : warning 213: tag mismatch
C:\Users\Kevin11\Desktop\server freeroam\gamemodes\freeroam.pwn(278) : warning 217: loose indentation
C:\Users\Kevin11\Desktop\server freeroam\gamemodes\freeroam.pwn(278) : error 029: invalid expression, assumed zero
C:\Users\Kevin11\Desktop\server freeroam\gamemodes\freeroam.pwn(278) : error 004: function "OnPlayerClickPlayer" is not implemented
C:\Users\Kevin11\Desktop\server freeroam\gamemodes\freeroam.pwn(282) : error 030: compound statement not closed at the end of file (started at line 248)
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
10 Errors.
Re: help with some error -
jlalt - 01.04.2016
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(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.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(playerid, killerid, reason)
{
Giocatore[playerid][Morti]++;//Aumentiamo il valore dei dati da salvare
Giocatore[killerid][Uccisioni]++;
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
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(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
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;
}
Re: help with some error -
kevi11 - 01.04.2016
wow man ty u so much