Sziasztok!
Azt hogy lehetne megoldani ebbe a scriptbe hogy mikor belépett akkor a map közepére spawnolja?
Maga a script:
/*••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
Regisztráció
••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••*/
#include <a_samp>
#include <dudb>
#include <dini>
#pragma unused strtok
#pragma unused ret_memcpy
#define ReGiStEr 8
#define LoGiN 9
#define COLOR_GREEN 0x00FF00FF
#define COLOR_RED 0xFF0000FF
enum pInfo
{
Deaths,
Kills,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
new IsLogged[MAX_PLAYERS];
public OnGameModeInit()
{
print(\"\\n--------------------------------------\");
print(\" tRegistration System by Torran\");
print(\"--------------------------------------\\n\");
return 1;
}
public OnPlayerConnect(playerid)
{
TogglePlayerSpectating( playerid, 1 );
IsLogged[playerid] = 0;
new file[128], string[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),\"/tReg/%s.ini\",name);
if(!fexist(file))
{
format(string, sizeof string, \"Üdv %s! \\nTe még nem vagy regisztrálva! \\n\\nKérjük regisztrálj.\", name);
ShowPlayerDialog(playerid, ReGiStEr, DIALOG_STYLE_INPUT, \"Regisztráció\", string, \"Register\", \"Cancel.\");
}
if(fexist(file))
{
format(string, sizeof string, \"Üdv %s! \\nKérjük jelentkezz be! \\n\\nIrd be a jelszódat.\", name);
ShowPlayerDialog(playerid, LoGiN, DIALOG_STYLE_INPUT, \"Bejelentkezés\", string, \"Login\", \"Cancel.\");
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new file[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),\"/tReg/%s.ini\",name);
if(fexist(file))
{
dini_IntSet(file,\"Score\", GetPlayerScore(playerid));
dini_IntSet(file,\"Money\", GetPlayerMoney(playerid));
dini_IntSet(file,\"Deaths\", PlayerInfo[playerid][Deaths]);
dini_IntSet(file,\"Kills\", PlayerInfo[playerid][Kills]);
}
IsLogged[playerid] = 0;
return 1;
}
public OnPlayerDeath(playerid, killerid)
{
PlayerInfo[playerid][Deaths] ++;
PlayerInfo[killerid][Kills] ++;
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == ReGiStEr)
{
if(response)
{
new file[128];
new string[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(strlen(inputtext) == 0)
{
format(string, sizeof string, \"Regisztráció \\n\\nÜdv %s! \\nTe még nem vagy regisztrálva! \\n\\nKérjük regisztrálj.\", name);
ShowPlayerDialog(playerid, ReGiStEr, DIALOG_STYLE_INPUT, \"Regisztráció\", string, \"Register\", \"Cancel.\");
return 0;
}
format(file,sizeof(file),\"/tReg/%s.ini\",name);
if(!fexist(file))
{
dini_Create(file);
dini_IntSet(file,\"Password\", udb_hash(inputtext));
dini_IntSet(file,\"Score\", GetPlayerScore(playerid));
dini_IntSet(file,\"Money\", GetPlayerMoney(playerid));
dini_IntSet(file,\"Deaths\", PlayerInfo[playerid][Deaths]);
dini_IntSet(file,\"Kills\", PlayerInfo[playerid][Kills]);
format(string, sizeof string, \"Bejelentkezés \\n\\nÜdv %s! \\nTe regisztrálva vagy! \\n\\nKérjük jelentkezz be.\", name);
ShowPlayerDialog(playerid, LoGiN, DIALOG_STYLE_INPUT, \"Bejelentkezés\", string, \"Login\", \"Cancel.\");
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
GetPlayerName(playerid, name, sizeof(name));
printf(\"%s sikeresen regisztrált!\", name);
}
}
}
if(dialogid == LoGiN)
{
if(response)
{
new file[128];
new string[128];
new PlayerName[24];
if(strlen(inputtext) == 0)
{
GetPlayerName(playerid, PlayerName, sizeof PlayerName);
format(string, sizeof string, \"Bejelentkezés \\n\\nÜdv %s! \\nTe regisztrálva vagy! \\n\\nKérjük jelentkezz be.\", PlayerName);
ShowPlayerDialog(playerid, LoGiN, DIALOG_STYLE_INPUT, \"Bejelentkezés\", string, \"Login\", \"Cancel.\");
return 0;
}
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),\"/tReg/%s.ini\",name);
if(fexist(file))
{
new password = dini_Int(file, \"Password\");
if(udb_hash(inputtext) != password)
{
SendClientMessage(playerid, COLOR_RED, \"***Hiba:Nem jó jelszó!\");
Kick(playerid);
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
printf(\"%s Nem tudott bejelentkezni!\", name);
}
else
{
IsLogged[playerid] = 1;
ResetPlayerMoney(playerid);
SetPlayerScore(playerid, dini_Int(file,\"Score\"));
GivePlayerMoney(playerid, dini_Int(file,\"Money\"));
PlayerInfo[playerid][Deaths] = dini_Int(file,\"Deaths\");
PlayerInfo[playerid][Kills] = dini_Int(file,\"Kills\");
SendClientMessage(playerid, COLOR_GREEN, \"Sikeresen be jelentkeztél!\");
TogglePlayerSpectating(playerid,0);
SpawnPlayer(playerid);
SetPlayerPos(playerid, 0.0, 0.0, 3.0);
TogglePlayerSpectating(playerid, 0);
}
}
}
}
return 0;
}
main() { }