14.07.2016, 10:18
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#include <dini>
#if defined FILTERSCRIPT
#define DIALOG_REGISTER1 0
#define DIALOG_REGISTER2 1
#define DIALOG_REGISTER3 2
#define DIALOG_REGISTER4 3
#define DIALOG_LOGIN1 4
#define DIALOG_NOPW1 5
#define DIALOG_NOPW2 6
#define DIALOG_WRONGPW 7
enum Info
{
sex, //0= male 1=female
age, // age :3
logged, // If is player connected
}
new pInfo[MAX_PLAYERS][Info];
new pname[MAX_PLAYER_NAME], path[200];
GetPlayerName(playerid, pname, sizeof(pname));
format(path, sizeof(path), "/spieler/%s.ini", pname);
if(!dini_Exists(path))
{
// f the player is not registered
ShowPlayerDialog(playerid, DIALOG_REGISTER1, DIALOG_STYLE_INPUT, "Registruj", "Tvoja Sifra:", "OK", "Otkazi");
}
else
{
//If the player is registered
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Prijava", "tvoja sifra", "OK", "Otkazi");
}
public OnDialogResponse
{
new pname[MAX_PLAYER_NAME], path[200];
GetPlayerName(playerid, pname, sizeof(pname));
format(path, sizeof(path), "/spieler/%s.ini", pname);
switch(dialogid)
{
case DIALOG_REGISTER1:
{
if(!response)
{
Kick(playerid);
}
else
{
new pwlength = strlen(inputtext);
if(pwlength > 0)
{
dini_Create(path); /i
dini_Set(path, "password", inputtext);
ShowPlayerDialog(playerid, DIALOG_REGISTER2, DIALOG_STYLE_LIST, "musko\ili\zensko", "OK", "Cancel");
}
else
{
ShowPlayerDialog(playerid, DIALOG_NOPW1, DIALOG_STYLE_MSGBOX, "Registracija", "Moras uneti godine!", "OK", "Cancel");
}
case DIALOG_REGISTER2:
{
if(!response)
{
dini_Remove(path);
Kick(playerid);
}
else
{
dini_IntSet(path, "sex", listitem);
ShowPlayerDialog(playerid, DIALOG_REGISTER3, DIALOG_STYLE_INPUT, "Registracija", "Tvoje godine?", "OK", "Cancel");
}
case DIALOG_REGISTER3:
{
if(!response)
{
dini_Remove(path);
Kick(playerid);
}
else
{
dini_Set(path, "age", inputtext);
ShowPlayerDialog(playerid, DIALOG_REGISTER4, DIALOG_STYLE_MSGBOX, "Registracija", "Tvoja Registracija je gotova!", "OK", "OK");
}
case DIALOG_REGISTER4:
{
pInfo[playerid][sex] = dini_Int(path, "sex");
pInfo[playerid][age] = dini_Int(path, "age");
pInfo[playerid][logged] = 1;
}
case DIALOG_LOGIN1:
{
if(!response)
{
Kick(playerid);
}
else
{
new pwlength = strlen(inputtext);
if(pwlength > 0)
{
new pw[200];
format(pw, sizeof(pw), "%s", dini_Get(path, "password");
if(strcmp(inputtext, pw) == 0)
{
pInfo[playerid][sex] = dini_Int(path, "sex");
pInfo[playerid][age] = dini_Int(path, "age");
pInfo[playerid][logged] = 1;
}
else
{
ShowPlayerDialog(playerid, DIALOG_WRONGPW, DIALOG_STYLE_MSGBOX, "Login", "Wrong Password!", "OK", "Cancel");
}
}
else
{
ShowPlayerDialog(playerid, DIALOG_NOPW2, DIALOG_STYLE_MSGBOX, "Login", "SYou have to enter a password!", "OK", "Cancel");
}
case DIALOG_NOPW1:
{
if(!response)
{
Kick(playerid);
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER1, DIALOG_STYLE_INPUT, "Register", "Your Password", "OK", "Cancel");
}
case DIALOG_NOPW2:
{
if(!response)
{
Kick(playerid);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN1, DIALOG_STYLE_INPUT, "Login", "Your Password:", "OK", "Abbrechen");
}
}
case DIALOG_WRONGPW:
{
if(!response)
{
Kick(playerid);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN1, DIALOG_STYLE_INPUT, "Login", "Your Password:", "OK", "Cancel");
}
}
}
return 1;
}
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
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)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new pname[MAX_PLAYER_NAME], path[200];
GetPlayerName(playerid, pname, sizeof(pname));
format(path, sizeof(path), "/spieler/%s.ini", pname);
dini_IntSet(path, "sex", pInfo[playerid][sex]);
dini_IntSet(path, "age", pInfo[playerid][age]);
pInfo[playerid][logged] = 0;
return 1;
}
C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\pawno\strcamp.pwn(21 : error 017: undefined symbol "pInfo"
C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\pawno\strcamp.pwn(21 : warning 215: expression has no effect
C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\pawno\strcamp.pwn(21 : error 001: expected token: ";", but found "]"
C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\pawno\strcamp.pwn(21 : error 029: invalid expression, assumed zero
C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\pawno\strcamp.pwn(21 : fatal error 107: too many error messages on one line
help
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#include <dini>
#if defined FILTERSCRIPT
#define DIALOG_REGISTER1 0
#define DIALOG_REGISTER2 1
#define DIALOG_REGISTER3 2
#define DIALOG_REGISTER4 3
#define DIALOG_LOGIN1 4
#define DIALOG_NOPW1 5
#define DIALOG_NOPW2 6
#define DIALOG_WRONGPW 7
enum Info
{
sex, //0= male 1=female
age, // age :3
logged, // If is player connected
}
new pInfo[MAX_PLAYERS][Info];
new pname[MAX_PLAYER_NAME], path[200];
GetPlayerName(playerid, pname, sizeof(pname));
format(path, sizeof(path), "/spieler/%s.ini", pname);
if(!dini_Exists(path))
{
// f the player is not registered
ShowPlayerDialog(playerid, DIALOG_REGISTER1, DIALOG_STYLE_INPUT, "Registruj", "Tvoja Sifra:", "OK", "Otkazi");
}
else
{
//If the player is registered
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Prijava", "tvoja sifra", "OK", "Otkazi");
}
public OnDialogResponse
{
new pname[MAX_PLAYER_NAME], path[200];
GetPlayerName(playerid, pname, sizeof(pname));
format(path, sizeof(path), "/spieler/%s.ini", pname);
switch(dialogid)
{
case DIALOG_REGISTER1:
{
if(!response)
{
Kick(playerid);
}
else
{
new pwlength = strlen(inputtext);
if(pwlength > 0)
{
dini_Create(path); /i
dini_Set(path, "password", inputtext);
ShowPlayerDialog(playerid, DIALOG_REGISTER2, DIALOG_STYLE_LIST, "musko\ili\zensko", "OK", "Cancel");
}
else
{
ShowPlayerDialog(playerid, DIALOG_NOPW1, DIALOG_STYLE_MSGBOX, "Registracija", "Moras uneti godine!", "OK", "Cancel");
}
case DIALOG_REGISTER2:
{
if(!response)
{
dini_Remove(path);
Kick(playerid);
}
else
{
dini_IntSet(path, "sex", listitem);
ShowPlayerDialog(playerid, DIALOG_REGISTER3, DIALOG_STYLE_INPUT, "Registracija", "Tvoje godine?", "OK", "Cancel");
}
case DIALOG_REGISTER3:
{
if(!response)
{
dini_Remove(path);
Kick(playerid);
}
else
{
dini_Set(path, "age", inputtext);
ShowPlayerDialog(playerid, DIALOG_REGISTER4, DIALOG_STYLE_MSGBOX, "Registracija", "Tvoja Registracija je gotova!", "OK", "OK");
}
case DIALOG_REGISTER4:
{
pInfo[playerid][sex] = dini_Int(path, "sex");
pInfo[playerid][age] = dini_Int(path, "age");
pInfo[playerid][logged] = 1;
}
case DIALOG_LOGIN1:
{
if(!response)
{
Kick(playerid);
}
else
{
new pwlength = strlen(inputtext);
if(pwlength > 0)
{
new pw[200];
format(pw, sizeof(pw), "%s", dini_Get(path, "password");
if(strcmp(inputtext, pw) == 0)
{
pInfo[playerid][sex] = dini_Int(path, "sex");
pInfo[playerid][age] = dini_Int(path, "age");
pInfo[playerid][logged] = 1;
}
else
{
ShowPlayerDialog(playerid, DIALOG_WRONGPW, DIALOG_STYLE_MSGBOX, "Login", "Wrong Password!", "OK", "Cancel");
}
}
else
{
ShowPlayerDialog(playerid, DIALOG_NOPW2, DIALOG_STYLE_MSGBOX, "Login", "SYou have to enter a password!", "OK", "Cancel");
}
case DIALOG_NOPW1:
{
if(!response)
{
Kick(playerid);
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER1, DIALOG_STYLE_INPUT, "Register", "Your Password", "OK", "Cancel");
}
case DIALOG_NOPW2:
{
if(!response)
{
Kick(playerid);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN1, DIALOG_STYLE_INPUT, "Login", "Your Password:", "OK", "Abbrechen");
}
}
case DIALOG_WRONGPW:
{
if(!response)
{
Kick(playerid);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN1, DIALOG_STYLE_INPUT, "Login", "Your Password:", "OK", "Cancel");
}
}
}
return 1;
}
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
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)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new pname[MAX_PLAYER_NAME], path[200];
GetPlayerName(playerid, pname, sizeof(pname));
format(path, sizeof(path), "/spieler/%s.ini", pname);
dini_IntSet(path, "sex", pInfo[playerid][sex]);
dini_IntSet(path, "age", pInfo[playerid][age]);
pInfo[playerid][logged] = 0;
return 1;
}
C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\pawno\strcamp.pwn(21 : error 017: undefined symbol "pInfo"
C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\pawno\strcamp.pwn(21 : warning 215: expression has no effect
C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\pawno\strcamp.pwn(21 : error 001: expected token: ";", but found "]"
C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\pawno\strcamp.pwn(21 : error 029: invalid expression, assumed zero
C:\Users\PC\Desktop\Dejanovi folderi\Black Shadow Roleplay\pawno\strcamp.pwn(21 : fatal error 107: too many error messages on one line
help