Ginciuxzs

Galit padet del Registracijos/Prisijungimo?

Recommended Posts

As noreciau is gm isimti registracija bet nezinau kaip. gal galit padet.?!

												

#include 
#include 
#include 
#include 

#define VERSIJA         	"v1.0"
#define PAVADINIMAS     	"emptyGM "
#define REGISTRACIJA        1
#define PRISIJUNGIMAS       2

forward                     Saugojimas( playerid, bool:simple );
forward                     Uzkraunam( playerid );

new Float:					RandomSpawn[][4] =
						{
   						{-1969.3687, 138.2617, 27.6875, 86.2244},
   						{-1404.8706, -307.1413, 14.1484, 155.6381}
						};
new                         zaid[ MAX_PLAYERS ]
										  ;

enum yeah
{
admin,
busena
}
new aDB[MAX_PLAYERS][yeah];

//UZKROVIMO PARODYMAS
main()
{
}

public OnGameModeInit()
{
// Nustatom GM pavadinimà
SetGameModeText(PAVADINIMAS VERSIJA);
// Nustatom zaidejo klase
AddPlayerClass( 188,-1969.3687,138.2617,27.6875,86.2244,0,0,0,0,0,0 );
AddPlayerClass( 93,-1969.3687,138.2617,27.6875,86.2244,0,0,0,0,0,0 );
// Pajungiam autoriaus kreditus, bei rodyma
Create3DTextLabel("{FFFFFF}Sios modifikacijos pradininkas yra {EE5555}DEIVIDAS\n{ffffff}Modifikacija padaryta {ee5555}2011'07'09",0x008080FF,-1428.7407, -283.2559, 14.1484, 40.0,0);
CreatePickup(1239, 2, -1428.7407, -283.2559, 14.1484, -1);
return 1;
}

public OnGameModeExit()
{
   foreach (Player, i)
{
SendClientMessage( i, -1, "~ Serveris isjungiamas, prisijunkite vëliau.");
}
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
return 1;
}

public OnPlayerConnect(playerid)
{
new failas[128], vardas[128];
GetPlayerName(playerid, vardas, 128);
	format(failas,128,"vartotojai/%s.ini",vardas);
if(!dini_Exists(failas))
{
ShowPlayerDialog(playerid,REGISTRACIJA,DIALOG_STYLE_INPUT,"Registracija","Iveskite slaptazodi","Registruotis","");
}
else if(dini_Exists(failas))
{
ShowPlayerDialog(playerid,PRISIJUNGIMAS,DIALOG_STYLE_INPUT,"Prisijungimas","Iveskite slaptazodi","Prisijungti","");
}

return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
Saugojimas( playerid, false );
return 1;
}

public OnPlayerSpawn(playerid)
{
aDB[ playerid ][ admin ] = false;
Uzkraunam( playerid );

new rand = random(sizeof(RandomSpawn)); SetPlayerPos(playerid, RandomSpawn[rand][0], RandomSpawn[rand][1], RandomSpawn[rand][2]);

new stringas[ 50 ],vardas[ 24 ];
   GetPlayerName( playerid, vardas, 24 );
   format(stringas, 50, "Labas, %s", vardas);
   GameTextForPlayer(playerid, stringas, 10000, 6);
   aDB[ playerid ][ busena ] = 2;
   zaid[ playerid ] ++;
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
 	SetSpawnInfo(playerid,GetPlayerTeam(playerid),GetPlayerSkin(playerid),-2654.9724,639.2270,14.4531,181.9655,0,0,0,0,0,0);
return 1;
}

public OnVehicleSpawn(vehicleid)
{
return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}

public OnPlayerText(playerid, text[])
{
   new vardas[ 24 ], stringas[ 158 ];
   GetPlayerName( playerid, vardas, 24 );
   format( stringas, 158, "{99FF00}%s sako:{ffffff} %s", vardas, text);
SendClientMessage( playerid, -1, stringas);
return 0;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
return 1;
}

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 == 1)
{
	if(response)
	{
	new file[128], name[128];
	GetPlayerName(playerid,name,128);
	format(file,128,"vartotojai/%s.ini",name);
	dini_Create(file);
	dini_Set(file,"slaptazodis",inputtext);
	SendClientMessage(playerid,0xFFFFFFFF,"Jus uzregistruotas!");
	Saugojimas( playerid, false );
	}

 		else if(!response)
	{
	Kick( playerid );
	}

	return 1;
}

if(dialogid == 2)
{
	if(response)
	{
	new name[MAX_PLAYER_NAME],file[128];
	GetPlayerName(playerid,name,sizeof(name));
	format(file,sizeof(file),"vartotojai/%s.ini",name);
	if(CheckPass(file,inputtext))
	{
		if(dini_Int( file, "Admin" ) == 1){aDB[ playerid ][ admin ] = true;}

		if(aDB[playerid][admin])
		{
			new zini[126],vardas[MAX_PLAYER_NAME];
           	GetPlayerName(playerid,vardas,MAX_PLAYER_NAME);
			format(zini,sizeof(zini),"Labas , administratoriau. Spausk spawn.");
               SendClientMessage(playerid,-1,zini);
		    PlayerPlaySound(playerid, 1150, 257.6206, -41.5307, 1002.0234);// Garsas
		}

		}else{
		    PlayerPlaySound(playerid, 1150, 257.6206, -41.5307, 1002.0234);// Garsas
		    new zini[256],vardas[MAX_PLAYER_NAME];
               GetPlayerName(playerid,vardas,MAX_PLAYER_NAME);
		    format(zini,sizeof(zini),"Labas , zaidejau. Spausk spawn.",vardas);
               SendClientMessage(playerid,-1,zini);
			}
	new exp;
  		if(exp == -1)
		return 1;
	}
	return 1;
	}
return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
new 			zinute[128];

format(zinute, 128, "{ffffff}Zaidejo kurio id: {ee5555}%d{ffffff} , serverio gautas numeris yra: {ee5555}%i", clickedplayerid, zaid);
ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"ZAIDEJO ID",zinute,"Gerai","");
SendClientMessage(clickedplayerid, 0xFFFFFFFF, zinute);
return 1;
}


stock CheckPass(file[],password[])
{
  if(!strcmp(dini_Get(file,"slaptazodis"), password, true )) return true;
  return false;
}

public Saugojimas(playerid,bool:simple)
{
new file[100];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(file,sizeof(file),"vartotojai/%s.ini",name);
new Float:coo[3],weps[2][12];
GetPlayerPos(playerid,coo[0],coo[1],coo[2]);
if(!fexist(file)){dini_Create(file);}
dini_IntSet(file,"Patirtis",GetPlayerScore(playerid));
dini_IntSet(file,"Admin",aDB[playerid][admin]);
for (new tmp=0; tmp<12; tmp++) GetPlayerWeaponData(playerid,tmp,weps[0][tmp],weps[1][tmp]);
dini_IntSet(file,"Ginklas0",weps[0][0]); dini_IntSet(file,"Ammo0",weps[1][0]);
dini_IntSet(file,"Ginklas1",weps[0][1]); dini_IntSet(file,"Ammo1",weps[1][1]);
dini_IntSet(file,"Ginklas2",weps[0][2]); dini_IntSet(file,"Ammo2",weps[1][2]);
dini_IntSet(file,"Ginklas3",weps[0][3]); dini_IntSet(file,"Ammo3",weps[1][3]);
dini_IntSet(file,"Ginklas4",weps[0][4]); dini_IntSet(file,"Ammo4",weps[1][4]);
dini_IntSet(file,"Ginklas5",weps[0][5]); dini_IntSet(file,"Ammo5",weps[1][5]);
dini_IntSet(file,"Ginklas6",weps[0][6]); dini_IntSet(file,"Ammo6",weps[1][6]);
dini_IntSet(file,"Ginklas7",weps[0][7]); dini_IntSet(file,"Ammo7",weps[1][7]);
dini_IntSet(file,"Ginklas8",weps[0][8]); dini_IntSet(file,"Ammo8",weps[1][8]);
dini_IntSet(file,"Ginklas9",weps[0][9]); dini_IntSet(file,"Ammo9",weps[1][9]);
dini_IntSet(file,"Ginklas10",weps[0][10]); dini_IntSet(file,"Ammo10",weps[1][10]);
dini_IntSet(file,"Ginklas11",weps[0][11]); dini_IntSet(file,"Ammo11",weps[1][11]);
dini_FloatSet(file,"pos_X",coo[0]);	dini_FloatSet(file,"pos_Y",coo[1]);	dini_FloatSet(file,"pos_Z",coo[2]);
return 1;
}

public Uzkraunam(playerid)
{
   new name[MAX_PLAYER_NAME],file[128];
GetPlayerName(playerid,name,sizeof(name));
format(file,sizeof(file),"vartotojai/%s.ini",name);
if(!fexist(file)) return;
   new tmpxp = dini_Int(file,"Xp");

SetPlayerScore(playerid,tmpxp);
SetPlayerPos(playerid,dini_Float(file,"pos_X"),dini_Float(file,"pos_Y"),dini_Float(file,"pos_Z"));
aDB[playerid][admin] = dini_Int(file,"Admin");
GivePlayerWeapon(playerid,dini_Int(file,"Ginklas0"),dini_Int(file,"Ammo0"));
GivePlayerWeapon(playerid,dini_Int(file,"Ginklas1"),dini_Int(file,"Ammo1"));
GivePlayerWeapon(playerid,dini_Int(file,"Ginklas2"),dini_Int(file,"Ammo2"));
GivePlayerWeapon(playerid,dini_Int(file,"Ginklas3"),dini_Int(file,"Ammo3"));
GivePlayerWeapon(playerid,dini_Int(file,"Ginklas4"),dini_Int(file,"Ammo4"));
GivePlayerWeapon(playerid,dini_Int(file,"Ginklas5"),dini_Int(file,"Ammo5"));
GivePlayerWeapon(playerid,dini_Int(file,"Ginklas6"),dini_Int(file,"Ammo6"));
GivePlayerWeapon(playerid,dini_Int(file,"Ginklas7"),dini_Int(file,"Ammo7"));
GivePlayerWeapon(playerid,dini_Int(file,"Ginklas8"),dini_Int(file,"Ammo8"));
GivePlayerWeapon(playerid,dini_Int(file,"Ginklas9"),dini_Int(file,"Ammo9"));
GivePlayerWeapon(playerid,dini_Int(file,"Ginklas10"),dini_Int(file,"Ammo10"));
GivePlayerWeapon(playerid,dini_Int(file,"Ginklas11"),dini_Int(file,"Ammo11"));
return;
}

Dalintis šį pranešimą


Nuoroda iki šio pranešimo
Dalintis per kitą puslapį

new failas[128], vardas[128];

GetPlayerName(playerid, vardas, 128);

format(failas,128,"vartotojai/%s.ini",vardas);

if(!dini_Exists(failas))

{

ShowPlayerDialog(playerid,REGISTRACIJA,DIALOG_STYLE_INPUT,"Registracija","Iveskite slaptazodi","Registruotis","");

}

else if(dini_Exists(failas))

{

ShowPlayerDialog(playerid,PRISIJUNGIMAS,DIALOG_STYLE_INPUT,"Prisijungimas","Iveskite slaptazodi","Prisijungti","");

}

Pabandyk sita.. +R3p jei negaila

Dalintis šį pranešimą


Nuoroda iki šio pranešimo
Dalintis per kitą puslapį
new failas[128], vardas[128];

GetPlayerName(playerid, vardas, 128);

format(failas,128,"vartotojai/%s.ini",vardas);

if(!dini_Exists(failas))

{

ShowPlayerDialog(playerid,REGISTRACIJA,DIALOG_STYLE_INPUT,"Registracija","Iveskite slaptazodi","Registruotis","");

}

else if(dini_Exists(failas))

{

ShowPlayerDialog(playerid,PRISIJUNGIMAS,DIALOG_STYLE_INPUT,"Prisijungimas","Iveskite slaptazodi","Prisijungti","");

}

Pabandyk sita.. +R3p jei negaila

o gal gali scripta pasakyti normalu? kad galeciau i savo serva ideti

Dalintis šį pranešimą


Nuoroda iki šio pranešimo
Dalintis per kitą puslapį

Prisijungti prie diskusijos

Palikti atsakymą galite iš karto, o užsiregistruoti vėliau. Jeigu jau turite paskyrą mūsų forume, Prisijunkite.

Svečias
Atsakyti šioje temoje...

×   Įklijuotas tekstas turi teksto formatavimą.   Pašalinti teksto formatavimą

  Galimi tik 75 veidukai.

×   Nuoroda buvo automatiškai įterpta.   Įterpti nuorodą paprastai

×   Jūsų ankstesnis pranešimas buvo atkurtas.   Išvalyti redaktorių

×   You cannot paste images directly. Upload or insert images from URL.


  • Šiame puslapyje naršo:   0 nariai

    Nėra registruotų narių peržiūrinčių šį forumą.

  • eneba
  • eneba
  • eneba



  • SuperGames programele
  • SuperGames programele