// Include this file
#include <file>
// OnDialogResponse
switch(dialogid)
{
case 3:
{
if(response==1)
{
switch(listitem)
{
case 0:
{
GetPlayerPos(playerid,x,y,z);
CreateVehicle(432,x-3.0,y,z,0.0,1,1,300);
}
case 1:
{
GetPlayerPos(playerid,x,y,z);
CreateVehicle(407,x-3.0,y,z,0.0,1,3,300);
}
case 2:
{
GetPlayerPos(playerid,x,y,z);
CreateVehicle(411,x-3.0,y,z,0.0,1,0,300);
}
case 3:
{
GetPlayerPos(playerid,x,y,z);
CreateVehicle(451,x-3.0,y,z,0.0,0,1,300);
}
case 4:
{
GetPlayerPos(playerid,x,y,z);
CreateVehicle(406,x-3.0,y,z,0.0,1,1,300);
}
}
}
}
case 1:
{
if(response==1)
{
if(strcmp(ReadPlayer(1,playerid),inputtext,false)!=0)
{
SendClientMessage(playerid,WHITE,\"Invalid Password!\");
ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,\"Login\",\"Welcome! Please Login!\",\"Login\",\"Exit\");
}
else TogglePlayerSpectating(playerid,0);
}
else Kick(playerid);
}
case 2:
{
if(response==1)
{
WritePlayer(inputtext,playerid,true);
TogglePlayerSpectating(playerid,0);
}
else Kick(playerid);
}
}
// OnPlayerConnect
TogglePlayerSpectating(playerid,1);
new string[256], name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(string,256,\"~r~Hello %s !\",name);
GameTextForPlayer(playerid,string,10000,6);
format(string,256,\"Players/%s.ini\",name);
if(fexist(string))
{
ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,\"Login\",\"Welcome! Please Login!\",\"Login\",\"Exit\");
}
else
{
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,\"Register\",\"Welcome! Please Register!\",\"Register\",\"Exit\");
}
// ReadWrite Player Functions
ReadPlayer(line,playerid)
{
new string[256],name[MAX_PLAYER_NAME];
new File:player;
GetPlayerName(playerid,name,sizeof(name));
format(string,256,\"Players/%s.ini\",name);
player = fopen(string, io_read);
for(new i=1; i<=line; i++)
{
fread(player,string);
if(line==i)
{fclose(player); return string;}
}
return string;
}
WritePlayer(text[],playerid, bool:filestart)
{
new string[256],name[MAX_PLAYER_NAME];
new File:player;
GetPlayerName(playerid,name,sizeof(name));
format(string,256,\"Players/%s.ini\",name);
player = fopen(string, io_append);
if(filestart)
{
fwrite(player,text);
}
else
{
format(string,256,\"\\n%s\",text);
fwrite(player,string);
}
fclose(player);
}</file>
Ezt irhatod át kedvedre az x,y,z-t asszem a regisztrációs spawnpontrakell irni