Jump to content

návod Užitečné funkce


Recommended Posts

PlayAudioStreamForAll(url[])
{
for(new i = 0;i < MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
PlayAudioStreamForPlayer(i,url);
}
}
}

je to bez souřadnic protože nwm jak udělat aby to fungoval bez souřadnic i se souřadnicema

přemýšlim jestly by to nešlo nacpat do definice

 

S i bez:

 

PlayAudioStreamForAll(url[],Float:posX = 0.0, Float:posY = 0.0, Float:posZ = 0.0, Float:distance = 50.0, usepos = 0))
{
for(new i = 0;i < MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
PlayAudioStreamForPlayer(i,url,posX,posY,posZ,distance,usepos);
}
}
}

nebudou vadit ty čarky?

Link to comment
Share on other sites

  • Replies 61
  • Created
  • Last Reply

Top Posters In This Topic

  • 4 weeks later...

stock SetPlayerPosEx(playerid, Float:x, Float:y, Float:z) // By Wroxx
{
if(!IsPlayerInAnyVehicle(playerid))
{
       SetPlayerInterior(playerid, 0);
       SetPlayerPos(playerid, x, y, z);
       }else{
       SetPlayerInterior(playerid, 0);
       SetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
 	}
}

Použitie:

SetPlayerPosEx(playerid, X, Y, Z)

Warp s autom (ušetríte 8 riadkov)

Link to comment
Share on other sites

Vylepšený SetPlayerPosEx

 

SetPlayerPosEx(playerid, Float:X, Float:Y, Float:Z, Float:A, AlsoWithTheCar = 0, interior = 0, virtualworld = 0)
{
    new vid;
    if(IsPlayerInAnyVehicle(playerid)) vid = GetPlayerVehicleID(playerid);
    
    SetPlayerPos(playerid, X, Y, Z);
    SetPlayerFacingAngle(playerid, A);
    SetCameraBehindPlayer(playerid);
    SetPlayerInterior(playerid, interior);
    SetPlayerVirtualWorld(playerid, virtualworld);
    
    if(AlsoWithTheCar)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            SetVehiclePos(vid, X,Y,Z);
            SetVehicleZAngle(vid, Z);
            PutPlayerInVehicle(playerid, vid, 0);
            LinkVehicleToInterior(vid, interior);
            SetVehicleVirtualWorld(vid,virtualworld);
            SetCameraBehindPlayer(playerid);
        }
    }
    return true;
}

 

Použití:

SetPlayerPosEx(playerid, Float:X, Float:Y, Float:Z, Float:A, AlsoWithTheCar = 0, interior = 0, virtualworld = 0)

X,Y,Z = souřadnice
Z = facingangle
AlsoWithTheCar = port s autem či ne (0 = bez auta, 1 = s autem)
interior = interér do jakého budete portnut
virtualworld = virtual world do kterého budete teleportován

Link to comment
Share on other sites

  • Administrátor
stock PlayStream(playerid, url[], Float:posX = 0.0, Float:posY = 0.0, Float:posZ = 0.0, Float:distance = 50.0, usepos = 0)

{

    StopAudioStreamForPlayer(playerid);

   

Link to comment
Share on other sites

stock PlayStream(playerid, url[], Float:posX = 0.0, Float:posY = 0.0, Float:posZ = 0.0, Float:distance = 50.0, usepos = 0)
{
    StopAudioStreamForPlayer(playerid);
    PlayAudioStreamForPlayer(playerid, url,posX,posY,posZ,distance, usepos);
}

neměl by tam být return ?

Link to comment
Share on other sites

stock PlayStream(playerid, url[], Float:posX = 0.0, Float:posY = 0.0, Float:posZ = 0.0, Float:distance = 50.0, usepos = 0)

{

    StopAudioStreamForPlayer(playerid);

    PlayAudioStreamForPlayer(playerid, url,posX,posY,posZ,distance, usepos);

}

Link to comment
Share on other sites

stock PlayStream(playerid, url[], Float:posX = 0.0, Float:posY = 0.0, Float:posZ = 0.0, Float:distance = 50.0, usepos = 0)
{
    StopAudioStreamForPlayer(playerid);
    PlayAudioStreamForPlayer(playerid, url,posX,posY,posZ,distance, usepos);
}

StopAudioStreamForPlayer tam byt taky nemusí ja mam radio a nemam to tam a funguje to :d

Link to comment
Share on other sites

  • Administrátor
stock PlayStream(playerid, url[], Float:posX = 0.0, Float:posY = 0.0, Float:posZ = 0.0, Float:distance = 50.0, usepos = 0)

{

    StopAudioStreamForPlayer(playerid);

    PlayAudioStreamForPlayer(playerid, url,posX,posY,posZ,distance, usepos);

}

Link to comment
Share on other sites

ted mně něco napadlo :d taka zbytečnost ale hodí se jak komu :d

stock AttachObject(bool:op,objid,Float:ofx,Float:ofy,Float:ofz,vehicleid = 0,aplayerid = 0,Float:rotx = 0.0,Float:roty = 0.0,Float:rotz = 0.0)
{
if(op == true)
{
AttachObjectToPlayer(objid,aplayerid,ofx,ofy,ofz,rotx,roty,rotz);
} else if(op == false)
{
AttachObjectToVehicle(objid,vehicleid,ofx,ofy,ofz,rotx,roty,rotz);
}
}

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