Jump to content
  • 0

Problema spawn


DreiVian

Question

Problema intalnita (descriere): Am facut 4 echipe .. la fiecare echipa i-am setat un spawn. Dar de exemplu x se conecteaza pe server  si il da la spawn civil ... dupa y se conecteaza pe server primeste aceleasi date ca si x
Ero(area / rile) / warning-(ul / urile): nu am erorir
Liniile de cod / sursa / script-ul(obligatoriu):
Imagini / Video (optional):

public OnPlayerSpawn(playerid)
{
	if(P_Data[playerid][pMember] == 0)
	{
		SetPlayerPos(playerid, 1479.6548, -1725.2207, 13.5469);
		SetPlayerInterior(playerid,0);
		SetPlayerVirtualWorld(playerid, 0);
		SetPlayerHealth(playerid,Float:50.0);
		SetPlayerSkin(playerid,P_Data[playerid][pSkin]);
		SetPlayerColor(playerid,-1);//
	}
	if(P_Data[playerid][pMember] == 1)////GROVE
	{
		SetPlayerPos(playerid, 2498.6328,-1643.2736,13.7826);
		GivePlayerWeapon(playerid, 24,15);
		SetPlayerInterior(playerid,0);
		SetPlayerHealth(playerid,Float:80.0);
		SetPlayerVirtualWorld(playerid, 0);
		SetPlayerSkin(playerid,P_Data[playerid][pSkin]);
		SetPlayerColor(playerid,COLOR_GREEN);//
	}
	if(P_Data[playerid][pMember] == 2)//BALLAS
	{
		SetPlayerPos(playerid, 1939.1661,-1115.0671,27.4523);
		GivePlayerWeapon(playerid, 24,15);
		SetPlayerInterior(playerid,0);
		SetPlayerHealth(playerid,Float:80.0);
		SetPlayerVirtualWorld(playerid, 0);
		SetPlayerSkin(playerid,P_Data[playerid][pSkin]);
		SetPlayerColor(playerid,COLOR_DARKVIOLET);//
	}
	if(P_Data[playerid][pMember] == 3)//VAGOS
	{
		SetPlayerPos(playerid, 2460.3865,-1331.1915,24.0000);
		GivePlayerWeapon(playerid, 24,15);
		SetPlayerInterior(playerid,0);
		SetPlayerHealth(playerid,Float:80.0);
		SetPlayerVirtualWorld(playerid, 0);
		SetPlayerSkin(playerid,P_Data[playerid][pSkin]);
		SetPlayerColor(playerid,COLOR_YELLOW);//
	}
	if(P_Data[playerid][pMember] == 4)
	{
		SetPlayerPos(playerid, 1762.3025,-2102.9854,13.8570);
		GivePlayerWeapon(playerid, 24,15);
		SetPlayerInterior(playerid,0);
		SetPlayerHealth(playerid,Float:80.0);
		SetPlayerVirtualWorld(playerid, 0);
		SetPlayerSkin(playerid,P_Data[playerid][pSkin]);
		SetPlayerColor(playerid,COLOR_LIGHTBLUE);//
	}
	return 1;
}
if(rows)
    {
        P_Data[playerid][pParola] = cache_get_field_content(0, "Parola",temporar);
        P_Data[playerid][pID] = cache_get_field_content_int(0, "ID");
		P_Data[playerid][pAdmin] = cache_get_field_content_int(0, "Admin");
		P_Data[playerid][pHelper] = cache_get_field_content_int(0, "Helper");
		P_Data[playerid][pVip] = cache_get_field_content_int(0, "Vip");
		P_Data[playerid][pMember] = cache_get_field_content_int(0, "Member");
		P_Data[playerid][pRank] = cache_get_field_content_int(0, "Rank");
		P_Data[playerid][pBan] = cache_get_field_content_int(0, "Ban");
		P_Data[playerid][pBani] = cache_get_field_content_int(0,"Bani");
		P_Data[playerid][pKills] = cache_get_field_content_int(0,"Kills");
		P_Data[playerid][pLevel] = cache_get_field_content_int(0,"Level");
		P_Data[playerid][pSkin] = cache_get_field_content_int(0,"Skin");
		P_Data[playerid][pSk] = cache_get_field_content_int(0,"Sk");
		if(P_Data[playerid][pBan] == 1 )
		{
			Kick(playerid);
		}
		GivePlayerMoney(playerid,P_Data[playerid][pBani]);
		SetPlayerScore(playerid,P_Data[playerid][pLevel]);
        SpawnPlayer(playerid);
    }
case DIALOG_FACTIUNE:
		{
			new echipa;
			echipa = P_Data[playerid][pMember];
			if(!response)
					return SendClientMessage(playerid,-1,"Am inteles! Nu vrei sa intri in Gang");
			if(response)
			{
				if(IsPlayerInRangeOfPoint(playerid,2.0,2495.3435,-1690.6968,14.7656))////GROVE
				{
					if(P_Data[playerid][pMember] == 0)
					{
						format(query,sizeof(query),"De acum esti in Grove, de aici iesi doar cu picioarele inainte!");
						SendClientMessage(playerid,-1,query);
						P_Data[playerid][pMember] = 1;
						SetPlayerSkin(playerid,Grove[random(3)]);
						P_Data[playerid][pSkin] = GetPlayerSkin(playerid);
						SpawnPlayer(playerid);
						Update(playerid,SkinUpdate);
						Update(playerid,MemberUpdate);
					}
					else 
					{
						format(query,sizeof(query),"Faci parte deja din TEAM[%i]",echipa);
						SendClientMessage(playerid,-1,query);
					}
				}
				else if(IsPlayerInRangeOfPoint(playerid,2.0,1939.1661,-1115.0671,27.4523))////Ballas
				{
					if(P_Data[playerid][pMember] == 0)
					{
						format(query,sizeof(query),"De acum esti in Ballas, de aici iesi doar cu picioarele inainte!");
						SendClientMessage(playerid,-1,query);
						P_Data[playerid][pMember] = 2;
						SetPlayerSkin(playerid,Ballas[random(3)]);
						P_Data[playerid][pSkin] = GetPlayerSkin(playerid);
						SpawnPlayer(playerid);
						Update(playerid,SkinUpdate);
						Update(playerid,MemberUpdate);
					}
					else 
					{
						format(query,sizeof(query),"Faci parte deja din TEAM[%i]",echipa);
						SendClientMessage(playerid,-1,query);
					}
				}
				else if(IsPlayerInRangeOfPoint(playerid,2.0,2460.3865,-1331.1915,24.0000))////Vagos
				{
					if(P_Data[playerid][pMember] == 0)
					{
						format(query,sizeof(query),"De acum esti in Vagos, de aici iesi doar cu picioarele inainte!");
						SendClientMessage(playerid,-1,query);
						P_Data[playerid][pMember] = 3;
						SetPlayerSkin(playerid,Vagos[random(3)]);
						P_Data[playerid][pSkin] = GetPlayerSkin(playerid);
						SpawnPlayer(playerid);
						Update(playerid,SkinUpdate);
						Update(playerid,MemberUpdate);
					}
					else 
					{
						format(query,sizeof(query),"Faci parte deja din TEAM[%i]",echipa);
						SendClientMessage(playerid,-1,query);
					}
				}
				else if(IsPlayerInRangeOfPoint(playerid,2.0,1762.3025,-2102.9854,13.8570))////Aztecas
				{
					if(P_Data[playerid][pMember] == 0)
					{
						format(query,sizeof(query),"De acum esti in Aztecas, de aici iesi doar cu picioarele inainte!");
						SendClientMessage(playerid,-1,query);
						P_Data[playerid][pMember] = 4;
						SetPlayerSkin(playerid,Aztecas[random(3)]);
						P_Data[playerid][pSkin] = GetPlayerSkin(playerid);
						SpawnPlayer(playerid);
						Update(playerid,SkinUpdate);
						Update(playerid,MemberUpdate);
					}
					else 
					{
						format(query,sizeof(query),"Faci parte deja din TEAM[%i]",echipa);
						SendClientMessage(playerid,-1,query);
					}
				}
			}
		}
if(P_Data[playerid][pMember] == 0 )
	{
		if(pickupid == PickupGR)
		{
			ShowPlayerDialog(playerid,DIALOG_FACTIUNE,DIALOG_STYLE_MSGBOX,"GROVE STREET","Vrei bani?\n Gabori care sa te scape cand o faci lata ?\nFemei?\nMasini?\nDoar intrand in Grove le poti obtine.Insa o afacere e totusi o afacere.","Intra","NU!");
			return 1;
		}
		if(pickupid == PickupBA)
		{
			ShowPlayerDialog(playerid,DIALOG_FACTIUNE,DIALOG_STYLE_MSGBOX,"BALLAS","Vrei bani?\n Gabori care sa te scape cand o faci lata ?\nFemei?\nMasini?\nDoar intrand in Grove le poti obtine.Insa o afacere e totusi o afacere.","Intra","NU!");
			return 1;
		}
		if(pickupid == PickupVA)
		{
			ShowPlayerDialog(playerid,DIALOG_FACTIUNE,DIALOG_STYLE_MSGBOX,"VAGOS","Vrei bani?\n Gabori care sa te scape cand o faci lata ?\nFemei?\nMasini?\nDoar intrand in Grove le poti obtine.Insa o afacere e totusi o afacere.","Intra","NU!");
			return 1;
		}
		if(pickupid == PickupAZ)
		{
			ShowPlayerDialog(playerid,DIALOG_FACTIUNE,DIALOG_STYLE_MSGBOX,"AZTECAS","Vrei bani?\n Gabori care sa te scape cand o faci lata ?\nFemei?\nMasini?\nDoar intrand in Grove le poti obtine.Insa o afacere e totusi o afacere.","Intra","NU!");
			return 1;
		}
	}

 Cam astea sunt codurile care au legatura cu factiunile. Daca sunteti dispusi sa aruncati un ochi si sa imi dati un sfat va raman vesnic recunascator.

Daca mai doriti si alte lini le pot posta... Ma refer la Update Mysql .. problema e ca imi face update corect in baza de date dar ... :(
Ati incercat sa rezolvati singur?:  Da inca ma chinui, si nu imi dau seama unde e fals

 

 

 

SARTV01.pwn

Edited by DreiVian
ADD GM.. Daca doriti mai multe detalii
Link to comment
Share on other sites

17 answers to this question

Recommended Posts

  • 0
33 minutes ago, Alberto. said:

vreau sa imi arati "SpawnPlayer"

Am postat codurile de la onplayerspawn si daca te uiti atent am postat si asta 

if(rows)
    {
        P_Data[playerid][pParola] = cache_get_field_content(0, "Parola",temporar);
        P_Data[playerid][pID] = cache_get_field_content_int(0, "ID");
		P_Data[playerid][pAdmin] = cache_get_field_content_int(0, "Admin");
		P_Data[playerid][pHelper] = cache_get_field_content_int(0, "Helper");
		P_Data[playerid][pVip] = cache_get_field_content_int(0, "Vip");
		P_Data[playerid][pMember] = cache_get_field_content_int(0, "Member");
		P_Data[playerid][pRank] = cache_get_field_content_int(0, "Rank");
		P_Data[playerid][pBan] = cache_get_field_content_int(0, "Ban");
		P_Data[playerid][pBani] = cache_get_field_content_int(0,"Bani");
		P_Data[playerid][pKills] = cache_get_field_content_int(0,"Kills");
		P_Data[playerid][pLevel] = cache_get_field_content_int(0,"Level");
		P_Data[playerid][pSkin] = cache_get_field_content_int(0,"Skin");
		P_Data[playerid][pSk] = cache_get_field_content_int(0,"Sk");
		if(P_Data[playerid][pBan] == 1 )
		{
			Kick(playerid);
		}
		GivePlayerMoney(playerid,P_Data[playerid][pBani]);
		SetPlayerScore(playerid,P_Data[playerid][pLevel]);
        SpawnPlayer(playerid);
    }
Link to comment
Share on other sites

  • 0
3 hours ago, DreiVian said:

Am postat codurile de la onplayerspawn si daca te uiti atent am postat si asta 


if(rows)
    {
        P_Data[playerid][pParola] = cache_get_field_content(0, "Parola",temporar);
        P_Data[playerid][pID] = cache_get_field_content_int(0, "ID");
		P_Data[playerid][pAdmin] = cache_get_field_content_int(0, "Admin");
		P_Data[playerid][pHelper] = cache_get_field_content_int(0, "Helper");
		P_Data[playerid][pVip] = cache_get_field_content_int(0, "Vip");
		P_Data[playerid][pMember] = cache_get_field_content_int(0, "Member");
		P_Data[playerid][pRank] = cache_get_field_content_int(0, "Rank");
		P_Data[playerid][pBan] = cache_get_field_content_int(0, "Ban");
		P_Data[playerid][pBani] = cache_get_field_content_int(0,"Bani");
		P_Data[playerid][pKills] = cache_get_field_content_int(0,"Kills");
		P_Data[playerid][pLevel] = cache_get_field_content_int(0,"Level");
		P_Data[playerid][pSkin] = cache_get_field_content_int(0,"Skin");
		P_Data[playerid][pSk] = cache_get_field_content_int(0,"Sk");
		if(P_Data[playerid][pBan] == 1 )
		{
			Kick(playerid);
		}
		GivePlayerMoney(playerid,P_Data[playerid][pBani]);
		SetPlayerScore(playerid,P_Data[playerid][pLevel]);
        SpawnPlayer(playerid);
    }

Mane, a zis sa-i arati SpawnPlayer

Trebuie sa fie ceva gen public SpawnPlayer daca nu ma insel

Acum astept sa te lauzi ca tu ai facut gm-ul

                                                                                                 

Link to comment
Share on other sites

  • 0

Ba nu ma laud ca eu l'am facut. Gm e a lui @WiDuAlK e gm in care a integrat sistemul de register. In rest ce se gaseste in el eu le'am facut is niste conditi nimic special. 

14 minutes ago, Ainox said:

Mane, a zis sa-i arati SpawnPlayer

Trebuie sa fie ceva gen public SpawnPlayer daca nu ma insel

Acum astept sa te lauzi ca tu ai facut gm-ul

SpawnPlayer nu exista in acest gm,doar OnPlayerSpawn. App dc te'ai bagat in seama daca nu ai oferit un ajutor sau staft ? Ai nevoie de topic plus. Sau ai un orgoliu de mare scula pe bascula ?

Edited by DreiVian
Link to comment
Share on other sites

  • 0
22 minutes ago, DreiVian said:

Ba nu ma laud ca eu l'am facut. Gm e a lui @WiDuAlK e gm in care a integrat sistemul de register. In rest ce se gaseste in el eu le'am facut is niste conditi nimic special. 

SpawnPlayer nu exista in acest gm,doar OnPlayerSpawn. App dc te'ai bagat in seama daca nu ai oferit un ajutor sau staft ? Ai nevoie de topic plus. Sau ai un orgoliu de mare scula pe bascula ?

Copile, daca nu exista public SpawnPlayer nu exista nici SpawnPlayer(playerid);

Daca esti habarnist taci din gura, daca nu iti convine ca primesti ajutor data viitoare nu mai cere.

                                                                                                 

Link to comment
Share on other sites

  • 0
1 hour ago, Ainox said:

Copile, daca nu exista public SpawnPlayer nu exista nici SpawnPlayer(playerid);

Daca esti habarnist taci din gura, daca nu iti convine ca primesti ajutor data viitoare nu mai cere.

Sincer te'as injura,dar nu vreau sa imi iau warn pt un prunc.

1.SpawnPlayer e functie oferita de sa-mp.

2.Am postat mai sus tot gm 

3.Daca găsești public SpawnPlayer in gm'ul pe care lucrez. Iti dau 5€.

4.Uitate la poza care am încărcat'o acum

5. Sa imi iei tastatura de 20cm in mana si sa inveti sa te joci cu ea. Ai grija sa nu o ranesti ca e o tastatura magica :*

 

Aștept un răspuns care merită citit.

IMG_20160510_171257.jpg

Link to comment
Share on other sites

  • 0
4 minutes ago, DreiVian said:

Sincer te'as injura,dar nu vreau sa imi iau warn pt un prunc.

1.SpawnPlayer e functie oferita de sa-mp.

2.Am postat mai sus tot gm 

3.Daca găsești public SpawnPlayer in gm'ul pe care lucrez. Iti dau 5€.

4.Uitate la poza care am încărcat'o acum

5. Sa imi iei tastatura de 20cm in mana si sa inveti sa te joci cu ea. Ai grija sa nu o ranesti ca e o tastatura magica :*

 

Aștept un răspuns care merită citit.

IMG_20160510_171257.jpg

1. S-a inventat tasta PrintScreen, sau Snipping Tool daca ai windows 7

2. SpawnPlayer nu e o functie oferita de 'sa-mp', poate te referi la OnPlayerSpawn, in fine, esti cam paralel, refuz sa-ti mai raspund

 

                                                                                                 

Link to comment
Share on other sites

  • 0
22 hours ago, DreiVian said:

Problema intalnita (descriere): Am facut 4 echipe .. la fiecare echipa i-am setat un spawn. Dar de exemplu x se conecteaza pe server  si il da la spawn civil ... dupa y se conecteaza pe server primeste aceleasi date ca si x
Ero(area / rile) / warning-(ul / urile): nu am erorir
Liniile de cod / sursa / script-ul(obligatoriu):
Imagini / Video (optional):


public OnPlayerSpawn(playerid)
{
	if(P_Data[playerid][pMember] == 0)
	{
		SetPlayerPos(playerid, 1479.6548, -1725.2207, 13.5469);
		SetPlayerInterior(playerid,0);
		SetPlayerVirtualWorld(playerid, 0);
		SetPlayerHealth(playerid,Float:50.0);
		SetPlayerSkin(playerid,P_Data[playerid][pSkin]);
		SetPlayerColor(playerid,-1);//
	}
	if(P_Data[playerid][pMember] == 1)////GROVE
	{
		SetPlayerPos(playerid, 2498.6328,-1643.2736,13.7826);
		GivePlayerWeapon(playerid, 24,15);
		SetPlayerInterior(playerid,0);
		SetPlayerHealth(playerid,Float:80.0);
		SetPlayerVirtualWorld(playerid, 0);
		SetPlayerSkin(playerid,P_Data[playerid][pSkin]);
		SetPlayerColor(playerid,COLOR_GREEN);//
	}
	if(P_Data[playerid][pMember] == 2)//BALLAS
	{
		SetPlayerPos(playerid, 1939.1661,-1115.0671,27.4523);
		GivePlayerWeapon(playerid, 24,15);
		SetPlayerInterior(playerid,0);
		SetPlayerHealth(playerid,Float:80.0);
		SetPlayerVirtualWorld(playerid, 0);
		SetPlayerSkin(playerid,P_Data[playerid][pSkin]);
		SetPlayerColor(playerid,COLOR_DARKVIOLET);//
	}
	if(P_Data[playerid][pMember] == 3)//VAGOS
	{
		SetPlayerPos(playerid, 2460.3865,-1331.1915,24.0000);
		GivePlayerWeapon(playerid, 24,15);
		SetPlayerInterior(playerid,0);
		SetPlayerHealth(playerid,Float:80.0);
		SetPlayerVirtualWorld(playerid, 0);
		SetPlayerSkin(playerid,P_Data[playerid][pSkin]);
		SetPlayerColor(playerid,COLOR_YELLOW);//
	}
	if(P_Data[playerid][pMember] == 4)
	{
		SetPlayerPos(playerid, 1762.3025,-2102.9854,13.8570);
		GivePlayerWeapon(playerid, 24,15);
		SetPlayerInterior(playerid,0);
		SetPlayerHealth(playerid,Float:80.0);
		SetPlayerVirtualWorld(playerid, 0);
		SetPlayerSkin(playerid,P_Data[playerid][pSkin]);
		SetPlayerColor(playerid,COLOR_LIGHTBLUE);//
	}
	return 1;
}

if(rows)
    {
        P_Data[playerid][pParola] = cache_get_field_content(0, "Parola",temporar);
        P_Data[playerid][pID] = cache_get_field_content_int(0, "ID");
		P_Data[playerid][pAdmin] = cache_get_field_content_int(0, "Admin");
		P_Data[playerid][pHelper] = cache_get_field_content_int(0, "Helper");
		P_Data[playerid][pVip] = cache_get_field_content_int(0, "Vip");
		P_Data[playerid][pMember] = cache_get_field_content_int(0, "Member");
		P_Data[playerid][pRank] = cache_get_field_content_int(0, "Rank");
		P_Data[playerid][pBan] = cache_get_field_content_int(0, "Ban");
		P_Data[playerid][pBani] = cache_get_field_content_int(0,"Bani");
		P_Data[playerid][pKills] = cache_get_field_content_int(0,"Kills");
		P_Data[playerid][pLevel] = cache_get_field_content_int(0,"Level");
		P_Data[playerid][pSkin] = cache_get_field_content_int(0,"Skin");
		P_Data[playerid][pSk] = cache_get_field_content_int(0,"Sk");
		if(P_Data[playerid][pBan] == 1 )
		{
			Kick(playerid);
		}
		GivePlayerMoney(playerid,P_Data[playerid][pBani]);
		SetPlayerScore(playerid,P_Data[playerid][pLevel]);
        SpawnPlayer(playerid);
    }

case DIALOG_FACTIUNE:
		{
			new echipa;
			echipa = P_Data[playerid][pMember];
			if(!response)
					return SendClientMessage(playerid,-1,"Am inteles! Nu vrei sa intri in Gang");
			if(response)
			{
				if(IsPlayerInRangeOfPoint(playerid,2.0,2495.3435,-1690.6968,14.7656))////GROVE
				{
					if(P_Data[playerid][pMember] == 0)
					{
						format(query,sizeof(query),"De acum esti in Grove, de aici iesi doar cu picioarele inainte!");
						SendClientMessage(playerid,-1,query);
						P_Data[playerid][pMember] = 1;
						SetPlayerSkin(playerid,Grove[random(3)]);
						P_Data[playerid][pSkin] = GetPlayerSkin(playerid);
						SpawnPlayer(playerid);
						Update(playerid,SkinUpdate);
						Update(playerid,MemberUpdate);
					}
					else 
					{
						format(query,sizeof(query),"Faci parte deja din TEAM[%i]",echipa);
						SendClientMessage(playerid,-1,query);
					}
				}
				else if(IsPlayerInRangeOfPoint(playerid,2.0,1939.1661,-1115.0671,27.4523))////Ballas
				{
					if(P_Data[playerid][pMember] == 0)
					{
						format(query,sizeof(query),"De acum esti in Ballas, de aici iesi doar cu picioarele inainte!");
						SendClientMessage(playerid,-1,query);
						P_Data[playerid][pMember] = 2;
						SetPlayerSkin(playerid,Ballas[random(3)]);
						P_Data[playerid][pSkin] = GetPlayerSkin(playerid);
						SpawnPlayer(playerid);
						Update(playerid,SkinUpdate);
						Update(playerid,MemberUpdate);
					}
					else 
					{
						format(query,sizeof(query),"Faci parte deja din TEAM[%i]",echipa);
						SendClientMessage(playerid,-1,query);
					}
				}
				else if(IsPlayerInRangeOfPoint(playerid,2.0,2460.3865,-1331.1915,24.0000))////Vagos
				{
					if(P_Data[playerid][pMember] == 0)
					{
						format(query,sizeof(query),"De acum esti in Vagos, de aici iesi doar cu picioarele inainte!");
						SendClientMessage(playerid,-1,query);
						P_Data[playerid][pMember] = 3;
						SetPlayerSkin(playerid,Vagos[random(3)]);
						P_Data[playerid][pSkin] = GetPlayerSkin(playerid);
						SpawnPlayer(playerid);
						Update(playerid,SkinUpdate);
						Update(playerid,MemberUpdate);
					}
					else 
					{
						format(query,sizeof(query),"Faci parte deja din TEAM[%i]",echipa);
						SendClientMessage(playerid,-1,query);
					}
				}
				else if(IsPlayerInRangeOfPoint(playerid,2.0,1762.3025,-2102.9854,13.8570))////Aztecas
				{
					if(P_Data[playerid][pMember] == 0)
					{
						format(query,sizeof(query),"De acum esti in Aztecas, de aici iesi doar cu picioarele inainte!");
						SendClientMessage(playerid,-1,query);
						P_Data[playerid][pMember] = 4;
						SetPlayerSkin(playerid,Aztecas[random(3)]);
						P_Data[playerid][pSkin] = GetPlayerSkin(playerid);
						SpawnPlayer(playerid);
						Update(playerid,SkinUpdate);
						Update(playerid,MemberUpdate);
					}
					else 
					{
						format(query,sizeof(query),"Faci parte deja din TEAM[%i]",echipa);
						SendClientMessage(playerid,-1,query);
					}
				}
			}
		}

if(P_Data[playerid][pMember] == 0 )
	{
		if(pickupid == PickupGR)
		{
			ShowPlayerDialog(playerid,DIALOG_FACTIUNE,DIALOG_STYLE_MSGBOX,"GROVE STREET","Vrei bani?\n Gabori care sa te scape cand o faci lata ?\nFemei?\nMasini?\nDoar intrand in Grove le poti obtine.Insa o afacere e totusi o afacere.","Intra","NU!");
			return 1;
		}
		if(pickupid == PickupBA)
		{
			ShowPlayerDialog(playerid,DIALOG_FACTIUNE,DIALOG_STYLE_MSGBOX,"BALLAS","Vrei bani?\n Gabori care sa te scape cand o faci lata ?\nFemei?\nMasini?\nDoar intrand in Grove le poti obtine.Insa o afacere e totusi o afacere.","Intra","NU!");
			return 1;
		}
		if(pickupid == PickupVA)
		{
			ShowPlayerDialog(playerid,DIALOG_FACTIUNE,DIALOG_STYLE_MSGBOX,"VAGOS","Vrei bani?\n Gabori care sa te scape cand o faci lata ?\nFemei?\nMasini?\nDoar intrand in Grove le poti obtine.Insa o afacere e totusi o afacere.","Intra","NU!");
			return 1;
		}
		if(pickupid == PickupAZ)
		{
			ShowPlayerDialog(playerid,DIALOG_FACTIUNE,DIALOG_STYLE_MSGBOX,"AZTECAS","Vrei bani?\n Gabori care sa te scape cand o faci lata ?\nFemei?\nMasini?\nDoar intrand in Grove le poti obtine.Insa o afacere e totusi o afacere.","Intra","NU!");
			return 1;
		}
	}

 Cam astea sunt codurile care au legatura cu factiunile. Daca sunteti dispusi sa aruncati un ochi si sa imi dati un sfat va raman vesnic recunascator.

Daca mai doriti si alte lini le pot posta... Ma refer la Update Mysql .. problema e ca imi face update corect in baza de date dar ... :(
Ati incercat sa rezolvati singur?:  Da inca ma chinui, si nu imi dau seama unde e fals

 

 

 

SARTV01.pwn

ai incercat sa scoti din public OnPlayerSpawn(playerid)

SetPlayerPos

 

public OnPlayerSpawn(playerid)
{
    SetPlayerPos(playerid, 1479.6548, -1725.2207, 13.5469);
    SetPlayerInterior(playerid,0);
    SetPlayerVirtualWorld(playerid, 0);
    return 1;
}

 

 

default.png

 

Link to comment
Share on other sites

  • 0

NU,dar am sa incerc.. dar daca scot SetPlayerPos(playerid,x,y,z);
 nu vor mai avea spawn cand se conecteaza pe server.

As putea sa scot si sa fac un stock cu cordonatele pentru fiecare factiune ? :)  si sa apelez in onplayerspawn stock-ul ?

Link to comment
Share on other sites

  • 0

arata toate codurile ce tin de verificare contului in baza de date. acolo trebuie sa fie problema. inca o chestie, toate variabilele care sunt atribuite fiecarui jucator trebuie resetate cand acesta paraseste serverul sau cand se conecteaza. 

Cea mai sigura sursa de facut bani de buzunar in mediul virtual. Inregistreaza-te si pune-te pe treaba !!!

http://www.viespar.ro/?reff=ab8e9d8086304d6136eac03c710238d7

Link to comment
Share on other sites

  • 0
11 hours ago, Jamal Alin said:

arata toate codurile ce tin de verificare contului in baza de date. acolo trebuie sa fie problema. inca o chestie, toate variabilele care sunt atribuite fiecarui jucator trebuie resetate cand acesta paraseste serverul sau cand se conecteaza. 

public OnPlayerConnect(playerid)
{
    new query[100];
    mysql_format(handle, query, sizeof(query), "SELECT * FROM conturi WHERE Nume = '%s'", GetName(playerid));
    mysql_tquery(handle, query, "OnPlayerLogin", "i", playerid);
    format(query,sizeof(query),"Bine ai revenit pe server %s",GetName(playerid));
    SendClientMessage(playerid,-1,query);
    format(query,sizeof(query),"Jucatorul %s s-a conectat!",GetName(playerid));
    SendClientMessageToAll(-1,query);
    return 1;
}
public OnPlayerLogin(playerid)
{
    new rows, fields;
    cache_get_data(rows, fields);
    if(rows)
    {
        if(P_Data[playerid][pBan] == 1)
        {
            SendClientMessage(playerid,-1,"Ai ban pe acest server. Iti recomand sa trimiti un Ticket");
            Kick(playerid);
        }
        else
        {
            ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Logheaza-te!", "Te rog sa-ti introduci parola contuului mai jos!", "Logare", "Exit");
        }
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Inregistrare", "Trebuie sa iti creezi un cont ca sa joci pe server. nTasteaza mai jos o parola, pentru a te inregistra!", "Inregistreaza", "Exit");
    }
    return 1;
}

public OnLogin(playerid)
{
    new rows, fields,temporar[200];
    cache_get_data(rows, fields);
    if(rows)
    {
        P_Data[playerid][pParola] = cache_get_field_content(0, "Parola",temporar);
        P_Data[playerid][pID] = cache_get_field_content_int(0, "ID");
        P_Data[playerid][pAdmin] = cache_get_field_content_int(0, "Admin");
        P_Data[playerid][pHelper] = cache_get_field_content_int(0, "Helper");
        P_Data[playerid][pVip] = cache_get_field_content_int(0, "Vip");
        P_Data[playerid][pMember] = cache_get_field_content_int(0, "Member");
        P_Data[playerid][pRank] = cache_get_field_content_int(0, "Rank");
        P_Data[playerid][pBan] = cache_get_field_content_int(0, "Ban");
        P_Data[playerid][pBani] = cache_get_field_content_int(0,"Bani");
        P_Data[playerid][pKills] = cache_get_field_content_int(0,"Kills");
        P_Data[playerid][pLevel] = cache_get_field_content_int(0,"Level");
        P_Data[playerid][pSkin] = cache_get_field_content_int(0,"Skin");
        P_Data[playerid][pSk] = cache_get_field_content_int(0,"Sk");
        if(P_Data[playerid][pBan] == 1 )
        {
            Kick(playerid);
        }
        GivePlayerMoney(playerid,P_Data[playerid][pBani]);
        SetPlayerScore(playerid,P_Data[playerid][pLevel]);
        SpawnPlayer(playerid);
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Parola incorecta!", "Te rog sa iti introduci parola corecta, pentru a te loga pe server.", "Logare", "Exit");
    }
    return 1;
}

 

Astea apartin de verificare + dialog register si login

case DIALOG_REGISTER:
        {
            if(!response)
                    return Kick(playerid);
                    
            if(response)
            {
                if(!strlen(inputtext))
                        return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Parola incorecta!", "Introdu-ti o parola pentru a te inregistra pe server! n", "Inregistreaza", "Exit");

                GetPlayerIp(playerid, ip, sizeof(ip));
                mysql_format(handle, query, sizeof(query), "INSERT INTO conturi (Nume, Parola, IP) VALUES ('%s', MD5('%e'), '%s')", GetName(playerid), inputtext, ip);
                mysql_query(handle, query);
                
                ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Logheaza-te!", "Te rog sa-ti introduci parola contuului mai jos!", "Logare", "Exit");
            }
            return 1;
        }
        case DIALOG_LOGIN:
        {
            if(!response)
                    return Kick(playerid);
                    
            if(response)
            {
                if(!strlen(inputtext))
                        return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Parola incorecta!", "Te rog sa iti introduci parola corecta, pentru a te loga pe server.", "Logare", "Exit");
                
                mysql_format(handle, query, sizeof(query), "SELECT * FROM conturi WHERE Parola = '%e' LIMIT 0,1", inputtext);
                mysql_tquery(handle, query, "OnLogin", "i", playerid);
            }
            return 1;
        }

Link to comment
Share on other sites

  • 0

La dialogul de logare este problema.

mysql_format(handle, query, sizeof(query), "SELECT * FROM conturi WHERE Parola = '%e' LIMIT 0,1", inputtext);

Trebuie verificat dupa nume si parola nu doar dupa parola, pentru ca daca ai o parola la mai multe conturi atunci se creaza bug.

  • Upvote 1

Cea mai sigura sursa de facut bani de buzunar in mediul virtual. Inregistreaza-te si pune-te pe treaba !!!

http://www.viespar.ro/?reff=ab8e9d8086304d6136eac03c710238d7

Link to comment
Share on other sites

  • 0

Deci sa fie asa 

mysql_format(handle, query, sizeof(query), "SELECT * FROM conturi WHERE  Nume ='%s' AND Parola = '%e' LIMIT 0,1",GetName(playerid), inputtext);
                mysql_tquery(handle, query, "OnLogin", "i", playerid);

 

 

MULTUMESC de raspuns cand am sa jung acasa am sa testez. Ori cum asta este cea mai plauzibilă cauză deoarece am verificat tot gm si nu nici o greseala la alte functi care sa provoace acest bug.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.