Jump to content
  • 0

pomoc [HELP]Registrace problem s dialogem


W1nCZ

Dotaz

Koukal jsem na jedno fórum kde byl TUT na registraci pres dialog... na zakladě toho TuTu jsem si udělal svou přeloženou a upravenou.. vylezly mi 3erory undefined symbol ShowPlayerDialog

snažil jsem se to opravit nic mě nenapadlo.. když sem si zkopiroval original z webu napsalo mi to uplně ty samé errory nemám ponětí čiím to je..

 

#include <a_samp>
#include <dutils>
#include <Dini>
#pragma unused ret_memcpy
enum pInfo {
   AdminLevel,
   level,
   cash,
   pw,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
public OnGameModeInit()
{
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnPlayerConnect(playerid)
{
   SendClientMessage(playerid, 0xff0000, "Welcome to UK-DM");
   SendClientMessage(playerid, 0xff0000, "Hope you enjoy!");
   SendClientMessage(playerid, 0xff0000, "Type /commands for a list of commands");
   new name[MAX_PLAYER_NAME], file[128];
   GetPlayerName(playerid, name, MAX_PLAYER_NAME);
   format(file, sizeof(file), ".../Users/%s.ini", name);
   if(!fexist(file))
{
    SendClientMessage(playerid, 0xff0000, "You are not registered, please register");
    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Please Register", "Enter Your Password Below", "Register", "Cancel");
   }
   else
{
    new str[128];
    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
    format(str, sizeof(str), "Welcome Back ~r~%s. Enjoy!", name);
    SendClientMessage(playerid, 0xff0000, str);
    ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Please Login", "Enter Your Password Below", "Login", "Cancel");
   }
   return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
   new file[128], name[MAX_PLAYER_NAME];
   GetPlayerName(playerid, name, MAX_PLAYER_NAME);
   format(file, sizeof(file), ".../Users/%s.ini", name);
   if(dini_Exists(file))
{
    dini_IntSet(file, "pw", PlayerInfo[playerid][pw]);
    dini_IntSet(file, "AdminLevel", PlayerInfo[playerid][AdminLevel]);
    dini_IntSet(file, "cash", PlayerInfo[playerid][cash]);
    dini_IntSet(file, "level", PlayerInfo[playerid][level]);
   }
   return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
   if(dialogid == 1)
{
    new file[128], name[MAX_PLAYER_NAME], str[128];
    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
    format(file, sizeof(file), ".../Users/%s.ini", name);
    if(response)
 {
	    if(strlen(inputtext))
  {
		    dini_Create(file);
		    dini_IntSet(file, "pw", num_hash(inputtext));
		    dini_IntSet(file, "AdminLevel", PlayerInfo[playerid][AdminLevel]);
		    dini_IntSet(file, "cash", PlayerInfo[playerid][cash]);
		    dini_IntSet(file, "level", PlayerInfo[playerid][level]);
		    format(str, sizeof(str), "You are registered as ~r~%s. Your password is ~r~%s. /changepass to change it", name, inputtext);
		    SendClientMessage(playerid, 0xff0000, str);
		    PlayerInfo[playerid][level] = dini_Int(file, "level");
		    PlayerInfo[playerid][cash] = dini_Int(file, "cash");
		    PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel");
	    }
    }
    else
 {
	    Kick(playerid);
    }
   }
   if(dialogid == 2)
{
    new file[128], name[MAX_PLAYER_NAME], str[128];
    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
    format(str, sizeof(str), ".../Users/%s.ini", name);
    if(response)
 {
	    if(strlen(inputtext))
  {
		    if(num_hash(inputtext) != dini_Int(file, "pw"))
   {
			    SendClientMessage(playerid, 0xff0000, "Wrong Password");
			    ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Please Login", "Enter Your Password Below", "Login", "Cancel");
		    }
		    else
   {
			    SendClientMessage(playerid, 0xff0000, "Succesfuly logged in");
			    PlayerInfo[playerid][level] = dini_Int(file, "level");
			    PlayerInfo[playerid][cash] = dini_Int(file, "cash");
			    GivePlayerMoney(playerid, dini_Int(file, "cash"));
			    PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel");
		    }
	    }
    }
    else
 {
	    Kick(playerid);
    }
   }
   return 1;
}

 

předem děkuji za pomoc.

Link to comment
Share on other sites

4 odpovědí na tuto otázku

Recommended Posts

  • 0

načo pluginy? chyba je v sampku, stiahni si najnovšie pawno, to keď stiahneš na www.sa-mp.com ten windows server, tam máš to pawno, tak stiahni a skús

 

děkuju, bylo to v tom pawnu.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...