Jump to content
  • 0

pomoc Nefunguje -_-


Deejva

Dotaz

OnGamemodeInit:

CreatePickup(1274,0,2499,-1687,13.5);
CreatePickup(1274,0,1975.1,-1235.8,20.1);
CreatePickup(1274,0,1792.7,-2105.3,13.5);
CreatePickup(1274,0,2808.2,-1177.1,25.4);

OnPlayerPickUpPickup:

 

    if(IsPlayerInSphere(playerid,2499,-1687,13.5,5))
    {
        ShowPlayerInfoBox(playerid,"Pro pripojeni k gangu stisknete L.ALT",3000);
    }
    if(IsPlayerInSphere(playerid,1975.1,-1235.8,20.1,5))
    {
        ShowPlayerInfoBox(playerid,"Pro pripojeni k gangu stisknete L.ALT",3000);
    }
    if(IsPlayerInSphere(playerid,1792.7,-2105.3,13.5,5))
    {
        ShowPlayerInfoBox(playerid,"Pro pripojeni k gangu stisknete L.ALT",3000);
    }
    if(IsPlayerInSphere(playerid,2808.2,-1177.1,25.4,5))
    {
        ShowPlayerInfoBox(playerid,"Pro pripojeni k gangu stisknete L.ALT",3000);
    }

Publicy:

 

public IsPlayerInSphere(playerid,Float:x,Float:y,Float:z,radius)
{
if(GetPlayerDistanceToPointEx(playerid,x,y,z) < radius) return 1;
return 0;
}


public GetPlayerDistanceToPointEx(playerid,Float:x,Float:y,Float:z)
{
new Float:x1,Float:y1,Float:z12,Float:tmpdis;
GetPlayerPos(playerid,x1,y1,z12);
tmpdis = floatsqroot(floatpower(floatabs(floatsub(x,x1)),2)
+floatpower(floatabs(floatsub(y,y1)),2)+floatpower(floatabs(floatsub(z,z12)),2));
return floatround(tmpdis);
}

Text se nezobrazí, díky za pomoc

 

 

Link to comment
Share on other sites

16 odpovědí na tuto otázku

Recommended Posts

  • 0

zkus misto

public IsPlayerInSphere(playerid,Float:x,Float:y,Float:z,radius)
{
if(GetPlayerDistanceToPointEx(playerid,x,y,z) < radius) return 1;
return 0;
}

dat jednoduse

#define IsPlayerInSphere(%0,%1,%2,%3,%4) IsPlayerInRangeOfPoint(%0,%4,%1,%2,%3)
Link to comment
Share on other sites

  • 0

C:\Users\David\Desktop\Samp\gamemodes\Mod.pwn(64) : error 021: symbol already defined: "IsPlayerInRangeOfPoint"

posli radek 64, pokud to neni ta definice...

vymaz svoji definici IsPlayerInRangeOfPoint a pouzij originalni native IsPlayerInRangeOfPoint ze souboru a_samp

Link to comment
Share on other sites

  • 0

a napsals tu definici dobre a ne naopak? nebo pokud nechces poslat kod tak prepis vse z IsPlayerInSphere(playerid,x,y,z,float:rarge) na  IsPlayerInRangeOfPoint(playerid,float:rarge,x,y,z), protoze bez kodu se blbe hleda chyba

Link to comment
Share on other sites

  • 0

Takhle jsem to měl a nešlo to, proto jsem zkusil Sphere .. nejde to

public OnPlayerPickUpPickup(playerid, pickupid)
{
    for(new i=0; i<7; i++)
    {
        if(pickupid == Srdce[i])
        {
            SetPlayerHealth(playerid,100);
            break;
        }
    }
    if(IsPlayerInSphere(playerid,2499,-1687,13.5,5))
    {
        ShowPlayerInfoBox(playerid,"Pro pripojeni k gangu stisknete L.ALT",3000);
    }
    if(IsPlayerInSphere(playerid,1975.1,-1235.8,20.1,5))
    {
        ShowPlayerInfoBox(playerid,"Pro pripojeni k gangu stisknete L.ALT",3000);
    }
    if(IsPlayerInSphere(playerid,1792.7,-2105.3,13.5,5))
    {
        ShowPlayerInfoBox(playerid,"Pro pripojeni k gangu stisknete L.ALT",3000);
    }
    if(IsPlayerInSphere(playerid,2808.2,-1177.1,25.4,5))
    {
        ShowPlayerInfoBox(playerid,"Pro pripojeni k gangu stisknete L.ALT",3000);
    }
return 1;
}
Link to comment
Share on other sites

  • 0

a co ten kod tady?

for(new i=0; i<7; i++)
    {
        if(pickupid == Srdce[i])
        {
            SetPlayerHealth(playerid,100);
            break;
        }
    }

nejsem si jisty zda ti pujde kombinace pickupid zaroven s isplayerinsphere.... osobne jsem to nezkousel, zkusil bych misto if(pickupid == tam vypsat tech 7 pozici

 if(IsPlayerInRangeOfPoint(playerid,2,x,y,z) ||IsPlayerInRangeOfPoint(playerid,2,x,y,z) ||IsPlayerInRangeOfPoint(playerid,2,x,y,z) ||IsPlayerInRangeOfPoint(playerid,2,x,y,z) ||IsPlayerInRangeOfPoint(playerid,2,x,y,z) ||IsPlayerInRangeOfPoint(playerid,2,x,y,z) ||IsPlayerInRangeOfPoint(playerid,2,x,y,z))
{
    SetPlayerHealth(playerid,100);
    return 1;
}
  
Link to comment
Share on other sites

  • 0

Já tam DestroyPickup nemam .. pokud mam 

CreatePickup(1274,0,2499,-1687,13.5);

, nejde to, pokud to ale změním na 

CreatePickup(1274,2,2499,-1687,13.5);

, je vše ok


http://wiki.sa-mp.com/wiki/PickupTypes

http://wiki.sa-mp.com/wiki/PickupTypes

měl jsem type 0 :d 

Problem Solved :d

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...