Jump to content
  • 0

checkpoint cand intra pe turf


adv1337

Question

12 answers to this question

Recommended Posts

  • 0

Foloseste-te de GetPlayerPos.

De exemplu:
 

new Float: x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerCheckpoint(playerid, x, y, z, 7);

Asta pui daca playerul e in turf sau unde doresti tu sa o pui. Sper ca ai inteles si ca te-am ajutat.

La setplayercheckpoint in loc de playerid poti face un loop pentru playerii care se afla in turful respectiv. Nu mai lucrez pe rpg, dar iti dau un exemplu orientativ.
 

foreach(new i: Player)
{
	if(IsInTurf[i] == 1)
	{
		SetPlayerCheckpoint(i, x, y, z, 7);
	}
}

 

Edited by BaFFyJunior
Link to comment
Share on other sites

  • 0
Acum 2 ore, adv1337 a spus:

Cum ati vazut din titlu, cum as putea sa creez un checkpoint unde se afla playerul   intra pe turf?

Nu cred ca te referi la checkpoint in sine si ca te referi ca jucatori sa fie vazuti pe teritoriu.

Acum 1 oră, BaFFyJunior a spus:

Foloseste-te de GetPlayerPos.

De exemplu:
 


new Float: x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerCheckpoint(playerid, x, y, z, 7);

Asta pui daca playerul e in turf sau unde doresti tu sa o pui. Sper ca ai inteles si ca te-am ajutat.

La setplayercheckpoint in loc de playerid poti face un loop pentru playerii care se afla in turful respectiv. Nu mai lucrez pe rpg, dar iti dau un exemplu orientativ.
 


foreach(new i: Player)
{
	if(IsInTurf[i] == 1)
	{
		SetPlayerCheckpoint(i, x, y, z, 7);
	}
}

 

Este ok ce ai facut doar ca el poate nu are 'IsInTurf', si mai mult ca sigur cauta sa arate jucatori in teritoriu nu sa faca un checkpoint.

Ce inseamna cuvantul "Unic" este atunci cand Chestia / Obiectul / Idea / etc... nu exista in alta parte.

Copii, nu mai veniti cu vorbe de "Am gamemode unic", nu exista asa ceva, la ora actuala totul este pe net.

Aveti grija pe cine ajutati, majoritatea sunt caini.

Link to comment
Share on other sites

  • 0
Acum 11 minute, StR_Marian a spus:

Nu cred ca te referi la checkpoint in sine si ca te referi ca jucatori sa fie vazuti pe teritoriu.

Este ok ce ai facut doar ca el poate nu are 'IsInTurf', si mai mult ca sigur cauta sa arate jucatori in teritoriu nu sa faca un checkpoint.

Eu i-am facut ce a cerut. De asemenea, poate folosi un timer si cu o variabila care sa verifice daca jucatorii sunt in turf sa afiseze playerii pe mapa cu orice culoare cu ajutorul functiei SetPlayerMarkerForPlayer.

Link to comment
Share on other sites

  • 0
1 hour ago, StR_Marian said:

Nu cred ca te referi la checkpoint in sine si ca te referi ca jucatori sa fie vazuti pe teritoriu.

Este ok ce ai facut doar ca el poate nu are 'IsInTurf', si mai mult ca sigur cauta sa arate jucatori in teritoriu nu sa faca un checkpoint.

Sa arate jucătorii pe turf, asta ma intereseaza

Link to comment
Share on other sites

  • 0
Acum 2 minute, adv1337 a spus:

Sa arate jucătorii pe turf, asta ma intereseaza

Cauta variabila care este setata jucatorului care este in turf si fa cu foreach si cu ajutorul functiei SetPlayerMarkerForPlayer sa ti-i arate. E ceva foarte basic la baza... daca nu te descurci posteaza aici variabila care este setata la turf unui jucator si te ajut.

Link to comment
Share on other sites

  • 0

function GetPlayersInZone(zoneid, teamid, vw)
{
    new count;
    foreach(new i : Player)
    {
        new faction = PlayerInfo[pMember] + PlayerInfo[pLeader];
        if(IsPlayerConnected(i) && faction == teamid && IsPlayerInZone(i, zoneid) && GetPlayerVirtualWorld(i) == vw)
        {
            if(IsAfk == 0 || (IsAfk == 1 && AFKMins < 2))
            {
                count++;
                
            }
        }
    }
    return count;
}

Link to comment
Share on other sites

  • 0

Jucatorii sunt afisati pe harta prin "SetPlayerMarkerForPlayer" doar daca "ShowPlayerMarkers" este setat pe 2, in caz contrar nu v-a functiona tocmai din cauza functiei precedente. N-ai nevoie de niciun timer care sa-ti consume degeaba resurse cand ai "OnPlayerStreamIn". Verifica in accest callback daca jucatorul este intr-un war si afiseaza-l pe harta prin "SetPlayerMarkerForPlayer", in caz ca nu este fa-l tot prin aceasta functie invizibil pe harta.

Edited by Eyser

The best of the best!

Awesome !!!

Link to comment
Share on other sites

  • 0

   la onplayerstreamin

 if(IsInWar1(playerid) && IsInWar1(forplayerid) || IsInWar2(playerid) && IsInWar2(forplayerid))
    {
        new zone = GetPlayerZone(playerid);
        if(zone == -1 || TakeON[zone] == 0 || !IsPlayerInZone(forplayerid, zone))
        {
            SetPlayerMarkerForPlayer( playerid, forplayerid, ( GetPlayerColor( forplayerid ) & 0xFFFFFF00 ) );
            SetPlayerMarkerForPlayer( forplayerid, playerid, ( GetPlayerColor( playerid ) & 0xFFFFFF00 ) );
        }
    }

Edited by adv1337
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

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

×
×
  • 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.