text
stringlengths
1
2.83M
id
stringlengths
16
152
metadata
dict
__index_level_0__
int64
0
949
--- title: OnVehicleDamageStatusUpdate description: Ovaj callback je pozvan kada dio vozila kao npr vrata, gume, paneli, ili svjetla promijene svoj status oštećenja. tags: ["vehicle"] --- :::tip Za neke korisne funkcije za raditi sa vozilima sa vrijednostima oštećenja vozila, pogledajte [ovdje](../resources/damagestatus.md). ::: ## Deskripcija Ovaj callback je pozvan kada dio vozila kao npr vrata, gume, paneli, ili svjetla promijene svoj status oštećenja. | Ime | Deskripcija | | --------- | -------------------------------------------------------------------------------------------------------- | | vehicleid | ID vozila kojem je promijenjen status oštećenja. | | playerid | ID igrača koji je sinhronizovao promjenu u statusu oštećenja (onaj koji je vozilo oštetio ili popravio). | ## Returns 1 - Spriječiti će da ostale filterskripte primaju ovaj callback. 0 - Ukazuje da će ovaj callback biti proslijeđen do naredne filterskripte. Uvijek je pozvan prvo u filterskriptama. ## Primjeri ```c public OnVehicleDamageStatusUpdate(vehicleid, playerid) { // Doznajte status oštećenja svih ovih dijelova new panels, doors, lights, tires; GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires); // postavimo gume na 0, što znači da su probušene tires = 0; // Ažuriraj status oštećenja vozila sa probušenim gumama UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires); return 1; } ``` ## Zabilješke :::tip Ovo ne uključuje promjene u healthu/zdravlju vozila. ::: ## Srodne Funkcije - [GetVehicleDamageStatus](../functions/GetVehicleDamageStatus.md): Doznajte stanje oštećenja vozila za svaki dio pojedinačno. - [UpdateVehicleDamageStatus](../functions/UpdateVehicleDamageStatus.md): Ažuriraj oštećenost vozila.
openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnVehicleDamageStatusUpdate.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnVehicleDamageStatusUpdate.md", "repo_id": "openmultiplayer", "token_count": 855 }
360
--- title: AddStaticVehicle description: Dodaje 'statično' vozilo (modeli su unaprijed učitani za igrač) u gamemode-u. tags: ["vehicle"] --- ## Deskripcija Dodaje 'statično' vozilo (modeli su unaprijed učitani za igrač) u gamemode-u. | Ime | Deskripcija | | ---------------------------------------- | --------------------------------- | | modelid | ID modela za vozilo. | | Float:spawn_X | X kordinata za vozilo. | | Float:spawn_Y | Y kordinata za vozilo. | | Float:spawn_Z | Z kordinata za vozilo. | | Float:z_angle | Pravac vozila - angle. | | [color1](../resources/vehiclecolorid.md) | ID primarne boje. -1 za random. | | [color2](../resources/vehiclecolorid.md) | ID sekundarne boje. -1 za random. | ## Returns ID vozila koje je kreirano (između 1 i MAX_VEHICLES). INVALID_VEHICLE_ID (65535) je vozilo koje nije kreirano (limit vozila je dostignut ili je proslijeđen nevažeći model ID vozila). ## Primjeri ```c public OnGameModeInit() { // Dodaj Hydru u igru AddStaticVehicle(520, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1); return 1; } ``` ## Srodne Funkcije - [AddStaticVehicleEx](AddStaticVehicleEx.md): Dodaj statično vozilo na server sa proizvoljnim respawn vremenom. - [CreateVehicle](CreateVehicle.md): Kreiraj vozilo. - [DestroyVehicle](DestroyVehicle.md): Uništi vozilo.
openmultiplayer/web/docs/translations/bs/scripting/functions/AddStaticVehicle.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/AddStaticVehicle.md", "repo_id": "openmultiplayer", "token_count": 809 }
361
--- title: AttachPlayerObjectToVehicle description: Prikvači player objekat za vozilo. tags: ["player", "vehicle"] --- ## Deskripcija Attach a player object to a vehicle. | Ime | Deskripcija | | ------------- | ------------------------------------------------ | | playerid | ID igrača za kojeg je kreiran objekat. | | objectid | ID objekta kojeg želite prikvačiti za vozilo. | | vehicleid | ID vozila za kojeg želite prikvačiti objekat. | | Float:OffsetX | Pomak položaja X za pričvršćivanje. | | Float:OffsetY | Pomak položaja Y za pričvršćivanje. | | Float:OffsetZ | Pomak položaja Z za pričvršćivanje. | | Float:RotX | Pomak rotacije X za pričvršćivanje. | | Float:RotY | Pomak rotacije Y za pričvršćivanje. | | Float:RotZ | Pomak rotacije Z za pričvršćivanje. | ## Returns Ova funkcija ne returna(vraća) nikakve posebne vrijednosti. ## Primjeri ```c public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstate) { if (newstate == PLAYER_STATE_DRIVER) // Ako igrač uđe u vozilo { // Prikvači veliku kravu new cow_object = CreatePlayerObject(playerid, 16442, 0, 0, 0, 0, 0, 0); AttachPlayerObjectToVehicle(playerid, cow_object, GetPlayerVehicleID(playerid), 0.0, 0.0, 1.0, 0.0, 0.0, 0.0); } } ``` ## Zabilješke :::tip Morate da kreirate objekat prije nego pokušate da ga privkačite za vozilo. ::: ## Srodne Funkcije - [CreatePlayerObject](CreatePlayerObject): Napravi objekat samo za jednog igrača. - [DestroyPlayerObject](DestroyPlayerObject): Uništi player objekat. - [IsValidPlayerObject](IsValidPlayerObject): Provjeri da li je određeni player objekat validan. - [MovePlayerObject](MovePlayerObject): Pomjeri player objekat. - [StopPlayerObject](StopPlayerObject): Zaustavi player objekat od kretanja. - [SetPlayerObjectRot](SetPlayerObjectRot): Postavi rotaciju player objekta. - [GetPlayerObjectPos](GetPlayerObjectPos): Lociraj player objekat. - [SetPlayerObjectPos](SetPlayerObjectPos): Postavi poziciju player objekta. - [GetPlayerObjectRot](GetPlayerObjectRot): Provjeri rotaciju player objekta. - [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): Prikvači player objekat za igrača. - [CreateObject](CreateObject): Kreiraj objekat. - [DestroyObject](DestroyObject): Uništi objekat. - [IsValidObject](IsValidObject): Provjerava da li je određeni objekat validan. - [MoveObject](MoveObject): Pomjeri objekat. - [StopObject](StopObject): Zaustavi objekat od kretanja. - [SetObjectPos](SetObjectPos): Postavi poziciju objekta. - [SetObjectRot](SetObjectRot): Postavi rotaciju objekta. - [GetObjectPos](GetObjectPos): Lociraj objekat. - [GetObjectRot](GetObjectRot): Provjeri rotaciju objekta. - [AttachObjectToPlayer](AttachObjectToPlayer): Prikvači objekat za igrača.
openmultiplayer/web/docs/translations/bs/scripting/functions/AttachPlayerObjectToVehicle.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/AttachPlayerObjectToVehicle.md", "repo_id": "openmultiplayer", "token_count": 1222 }
362
--- title: CreateExplosion description: Kreiraj eksploziju na određenim kordinatama. tags: [] --- ## Deskripcija Kreiraj eksploziju na određenim kordinatama. | Ime | Deskripcija | | ------------ | ----------------------- | | Float:X | X kordinata eksplozije. | | Float:Y | Y kordinata eksplozije. | | Float:Z | Z kordinata eksplozije. | | type | Tip eksplozije. | | Float:radius | Radijus eksplozije. | ## Returns Ova funkcija uvijek returna (vraća) 1, bilo da je tip eksplozije i/ili vrijednost radijusa nevažeća. ## Primjeri ```c public OnPlayerEnterCheckpoint(playerid) { // Dobij poziciju igrača new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); // Kreiraj eksploziju na kordinatama igrača CreateExplosion(x, y, z, 12, 10.0); return 1; } ``` ## Zabilješke :::tip Postoji ograničenje koliko igrač može odjednom vidjeti eksplozije. Ovo je otprilike 10. ::: ## Srodne Funkcije - [CreateExplosionForPlayer](CreateExplosionForPlayer): Kreiraj eksploziju koja je vidljiva samo jednom igraču.
openmultiplayer/web/docs/translations/bs/scripting/functions/CreateExplosion.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/CreateExplosion.md", "repo_id": "openmultiplayer", "token_count": 532 }
363
--- title: DestroyPickup description: Uništava pickup kreiran sa CreatePickup. tags: [] --- ## Deskripcija Uništava pickup kreiran sa CreatePickup. | Ime | Deskripcija | | ------ | ----------------------------------------------------- | | pickup | ID pickup-a koji se unišava (kreiran sa CreatePickup) | ## Returns Ova funkcija ne returna (vraća) nikakve posebne vrijednosti. ## Primjeri ```c // Kreira pickup za pancir. pickup_armour = CreatePickup ( 1242, 2, 1503.3359, 1432.3585, 10.1191 ); //nekoliko trenutaka kasnije... DestroyPickup(pickup_armour); ``` ## Srodne Funkcije - [CreatePickup](CreatePickup): Kreiraj pickup. - [OnPlayerPickUpPickup](../callbacks/OnPlayerPickUpPickup): Pozvano kada igrač pokupi pickup.
openmultiplayer/web/docs/translations/bs/scripting/functions/DestroyPickup.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/DestroyPickup.md", "repo_id": "openmultiplayer", "token_count": 327 }
364
--- title: EnableStuntBonusForPlayer description: Omogućuje ili onemogućava stunt bonuse za igrača. tags: ["player"] --- ## Deskripcija Omogućuje ili onemogućava stunt bonuse za igrača. Omogućeno po zadanim postavkama. | Ime | Deskripcija | | -------- | -------------------------------------------------------- | | playerid | ID igrača za kojeg se uključuju/isključuju stunt bonusi. | | enable | 1 da uključite stunt bonuse i 0 da ih isključite. | ## Returns 1: Funkcija uspješno izvršena. 0: Funkcija neuspješno izvršena. Igrač nije konektovan. ## Primjeri ```c public OnPlayerConnect(playerid) { EnableStuntBonusForPlayer(playerid, 0); // Onemogućite stunt bonuse kad se igrač konektuje na server. } ``` ## Srodne Funkcije - [EnableStuntBonusForAll](EnableStuntBonusForAll): Omogućuje ili onemogućava stunt bonuse za sve igrače.
openmultiplayer/web/docs/translations/bs/scripting/functions/EnableStuntBonusForPlayer.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/EnableStuntBonusForPlayer.md", "repo_id": "openmultiplayer", "token_count": 401 }
365
--- title: GangZoneShowForAll description: Prikazuje gangzonu sa željenom bojom svim igračima. tags: ["gangzone"] --- ## Deskripcija Prikazuje gangzonu sa željenom bojom svim igračima. | Ime | Deskripcija | | ----- | -------------------------------------------------------------------------------------------------------- | | zone | ID gangzone za prikazati (returnovana/vraćena od GangZoneCreate). | | color | Boja za bljeskanje gangzone, kao cijeli broj ili hex u RGBA formatu boja. Podržana alfa transparentnost. | ## Returns 1: Funkcija uspješno izvršena. Gangzona je prikazana svim igračima. 0: Funkcija neuspješno izvršena. Gangzona ne postoji. ## Primjeri ```c new gGangZoneId; public OnGameModeInit() { gGangZoneId = GangZoneCreate(1248.011, 2072.804, 1439.348, 2204.319); return 1; } public OnPlayerSpawn(playerid) { if (IsPlayerAdmin(playerid)) { GangZoneShowForAll(gGangZoneId, COLOR_RED); } return 1; } ``` ## Srodne Funkcije - [GangZoneCreate](GangZoneCreate): Kreiraj gangzonu. - [GangZoneDestroy](GangZoneDestroy): Uništi gang zonu. - [GangZoneShowForPlayer](GangZoneShowForPlayer): Prikaži gang zonu za igrača. - [GangZoneHideForPlayer](GangZoneHideForPlayer): Sakrij gangzonu za igrača. - [GangZoneHideForAll](GangZoneHideForAll): Sakrij gangzonu za sve igrače. - [GangZoneFlashForPlayer](GangZoneFlashForPlayer): Kreiraj bljeskalicu gang zone za igrača. - [GangZoneFlashForAll](GangZoneFlashForAll): Kreiraj bljeskalicu gang zone za sve igrače. - [GangZoneStopFlashForPlayer](GangZoneStopFlashForPlayer): Zaustavi gang zonu da bljeska za igrača. - [GangZoneStopFlashForAll](GangZoneStopFlashForAll): Zaustavi gang zonu da bljeska za sve igrače.
openmultiplayer/web/docs/translations/bs/scripting/functions/GangZoneShowForAll.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/GangZoneShowForAll.md", "repo_id": "openmultiplayer", "token_count": 809 }
366
--- title: GetMyPos description: Dobij poziciju NPC-a tags: ["npc"] --- ## Deskripcija Dobij poziciju NPC-a | Ime | Deskripcija | | --------- | --------------------------------------------------------- | | &Float:x | Float za spremanje X koordinate, proslijeđen referencom. | | &Float:y | Float za spremanje Y koordinate, proslijeđen referencom. | | &Float:z | Float za spremanje Z koordinate, proslijeđen referencom. | ## Returns Ova funkcija ne returna (ne vraća) nikakve specifične vrijednosti. ## Primjer ```c new Float:x, Float:y, Float:z; GetMyPos(x,y,z); printf("Trenutno sam na %f, %f, %f!",x,y,z); ``` ## Srodne Funkcije - [SetMyPos](SetMyPos): Postavite poziciju NPC-u.
openmultiplayer/web/docs/translations/bs/scripting/functions/GetMyPos.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/GetMyPos.md", "repo_id": "openmultiplayer", "token_count": 346 }
367
--- title: GetPlayerTargetActor description: Dobij id aktora koji je naciljan od strane nekog igrača. tags: ["player"] --- :::warning Ova funkcija je dodana u SA-MP 0.3.7 i ne radi u nižim verzijama! ::: ## Deskripcija Dobij id aktora koji je naciljan od strane nekog igrača. | Ime | Deskripcija | | -------- | -------------------------------------- | | playerid | ID igrača za dobiti naciljanog aktora. | ## Returns ID naciljanog aktora, ili INVALID_ACTOR_ID ako ga nema. ## Primjeri ```c public OnPlayerUpdate(playerid) { new targetActorId = GetPlayerTargetActor(playerid), string[32]; format(string, sizeof(string), "Ti ciljaš na aktora ID %d", targetActorId); SendClientMessage(playerid, -1, string); return 1; } ``` ## Zabilješke :::warning Ne radi za joypad/kontrolere i nakon određene udaljenosti. Ne radi za snajpersku pušku, jer se ništa ne zaključava i kao takva ne može i neće vratiti igrača. ::: ## Srodne Funkcije - [GetPlayerCameraTargetActor](GetPlayerCameraTargetActor): Dobij ID aktora (ako ima) u kojeg igrač gleda. - [GetPlayerCameraFrontVector](GetPlayerCameraFrontVector): Dobij prednji vektor kamere igrača. - [OnPlayerGiveDamageActor](../callbacks/OnPlayerGiveDamageActor): Ovaj callback je pozvan kada igrač ozlijedi aktora.
openmultiplayer/web/docs/translations/bs/scripting/functions/GetPlayerTargetActor.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/GetPlayerTargetActor.md", "repo_id": "openmultiplayer", "token_count": 552 }
368
--- title: GetSVarString description: Dobija string vrijednost server varijable. tags: [] --- :::warning Ova funkcija je dodana u SA-MP 0.3.7 R2 i ne radi u nižim verzijama! ::: ## Deskripcija Dobija string vrijednost server varijable. | Ime | Deskripcija | | ------------- | -------------------------------------------------------------------------------------- | | varname | Ime server varijable (osjetljivo na mala i velika slova). Dodijeljeno u SetSVarString. | | string_return | Niz za pohraniti vrijednost stringa, proslijeđeno referencom. | | len | Maksimalna dužina returnovanog/vraćenog stringa. | ## Returns Dužina stringa. ## Primjeri ```c // postavi "Version" SetSVarString("Version", "0.3.7"); // ispisati će verziju koju server ima new string[5 + 1]; GetSVarString("Version", string, sizeof(string)); printf("Version: %s", string); ``` ## Srodne Funkcije - [SetSVarInt](SetSVarInt): Postavite cijeli broj za varijablu servera. - [GetSVarInt](GetSVarInt): Dobij cjelobrojnu vrijednost server varijable. - [SetSVarString](SetSVarString): Postavite string za server varijablu. - [SetSVarFloat](SetSVarFloat): Postavi float za server varijablu. - [GetSVarFloat](GetSVarFloat): Dobij prethodno postavljeni float iz server varijable. - [DeleteSVar](DeleteSVar): Obriši server varijablu.
openmultiplayer/web/docs/translations/bs/scripting/functions/GetSVarString.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/GetSVarString.md", "repo_id": "openmultiplayer", "token_count": 654 }
369
--- title: GetVehicleParamsCarWindows description: Omogućava vam da doznate trenutno stanje prozora vozila. tags: ["vehicle"] --- :::warning Ova funkcija je dodana u SA-MP 0.3.7 i ne radi u nižim verzijama! ::: ## Deskripcija Omogućava vam da doznate trenutno stanje prozora vozila. | Ime | Deskripcija | | ---------- | --------------------------------------------------------------------- | | vehicleid | ID Vozila | | &driver | Cijeli broj za pohraniti stanje vozačevog prozora. | | &passenger | Cijeli broj za pohraniti stanje suvozačevog prozora. | | &backleft | Cijeli broj za pohraniti stanje lijevog pozadi prozora (ako postoji). | | &backright | Cijeli broj za pohraniti stanje desnog pozadi prozora (ako postoji). | ## Returns Stanje prozora vozila pohranjeno je u navedenim varijablama. ## Zabilješke :::tip Vrijednosti vraćene u svakoj varijabli su kao: -1: Stanje prozora nije postavljeno (općenito zatvoreno, osim ako nije izričito postavljeno na -1) 0: Otvoren 1: Zatvoren ::: ## Srodne Funkcije - [SetVehicleParamsCarWindows](SetVehicleParamsCarWindows): Otvori i zatvori prozore vozila. - [GetVehicleParamsCarDoors](GetVehicleParamsCarDoors): Doznaj trenutno stanje vrata od vozila - [SetVehicleParamsCarDoors](SetVehicleParamsCarDoors): Otvori i zatvori vrata vozila.
openmultiplayer/web/docs/translations/bs/scripting/functions/GetVehicleParamsCarWindows.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/GetVehicleParamsCarWindows.md", "repo_id": "openmultiplayer", "token_count": 697 }
370
--- title: InterpolateCameraPos description: Pomjerite kameru igrača od jedne pozicije do druge, unutar postavljenog vremena. tags: [] --- ## Deskripcija Pomjerite kameru igrača od jedne pozicije do druge, unutar postavljenog vremena. Korisno za scenarije cut scnea | Ime | Deskripcija | | ----------- | --------------------------------------------------------------------------------------------------------------------------------------- | | playerid | ID igrača čija će se kamera pomjerati. | | Float:FromX | X pozicija kamere gdje bi se trebala početi pomicati. | | Float:FromY | Y pozicija kamere gdje bi se trebala početi pomicati. | | Float:FromZ | Z pozicija kamere gdje bi se trebala početi pomicati. | | Float:ToX | X pozicija kamere gdje bi se trebala pomaketi. | | Float:ToY | Y pozicija kamere gdje bi se trebala pomaketi. | | Float:ToZ | Z pozicija kamere gdje bi se trebala pomaketi. | | time | Vrijeme u milisekundama. | | cut | ['Jumpcut'](../resources/cameracutstyles) za koristiti. Zadano na CAMERA_CUT (besmisleno). Postavi na CAMERA_MOVE za glatko pomjeranje. | ## Returns Ova funkcija ne returna (vraća) nikakve posebne vrijednosti. ## Primjeri ```c public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/moveme", true)) { TogglePlayerSpectating(playerid, 1); InterpolateCameraPos(playerid, 0.0, 0.0, 10.0, 1000.0, 1000.0, 30.0, 10000, CAMERA_MOVE); //pomjeraj kameru igrača od tačke A do tačke B u 10000 milieskundi (10 sekundi). return 1; } return 0; } ``` ## Zabilješke :::tip Upotrijebite TogglePlayerSpectating da se objekti prikažu igraču/klijentu tokom reprodukcije kamere. Pomoću SetCameraBehindPlayer možete resetovati kameru iza igrača/klijenta. ::: ## Srodne Funkcije - [InterpolateCameraLookAt](InterpolateCameraLookAt): Premjestite prikaz kamere igrača s jedne lokacije na drugu. - [SetPlayerCameraPos](SetPlayerCameraPos): Postavi poziciju kamere igrača. - [SetPlayerCameraLookAt](SetPlayerCameraLookAt): Postavite gdje će igračeva kamera gledati.
openmultiplayer/web/docs/translations/bs/scripting/functions/InterpolateCameraPos.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/InterpolateCameraPos.md", "repo_id": "openmultiplayer", "token_count": 1722 }
371
--- title: IsPlayerObjectMoving description: Provjerava ako se dati player objectid pomjera. tags: ["player"] --- ## Deskripcija Provjerava ako se dati player objectid pomjera. | Ime | Deskripcija | | -------- | ---------------------------------------------------------- | | playerid | ID igrača čiji je player-objekat provjeren. | | objectid | ID player objectid kojeg želite provjeriti da li se kreće. | ## Returns 1 ako se player obejkat kreće, 0 ako ne. ## Primjeri ```c if (IsPlayerObjectMoving(playerid, objectid)) { StopPlayerObject(playerid, objectid); } ``` ## Srodne Funkcije - [CreatePlayerObject](CreatePlayerObject): Kreiraj objekat za samo jednog igrača. - [DestroyPlayerObject](DestroyPlayerObject): Uništi player objekat. - [IsValidPlayerObject](IsValidPlayerObject): Provjeri da li je određeni player objekat validan. - [MovePlayerObject](MovePlayerObject): Pomjeri player objekat. - [StopPlayerObject](StopPlayerObject): Zaustavi player objekat od kretanja. - [SetPlayerObjectPos](SetPlayerObjectPos): Postavi poziciju player objekta. - [SetPlayerObjectRot](SetPlayerObjectRot): Postavi rotaciju player objekta. - [GetPlayerObjectPos](GetPlayerObjectPos): Lociraj player objekat. - [GetPlayerObjectRot](GetPlayerObjectRot): Provjeri rotaciju player objekta. - [AttachPlayerObjectToPlayer](AttachObjectToPlayer): Prikvači player objekat za igrača. - [CreateObject](CreateObject): Kreiraj objekat. - [DestroyObject](DestroyObject): Uništi objekat. - [IsValidObject](IsValidObject): Provjeri da li je određeni objekat validan. - [MoveObject](MoveObject): Pomjeri objekat. - [IsObjectMoving](IsObjectMoving): Check if the object is moving. - [StopObject](StopObject): Zaustavi objekat od kretanja. - [SetObjectPos](SetObjectPos): Postavi poziciju objekta. - [SetObjectRot](SetObjectRot): Postavi rotaciju objekta. - [GetObjectPos](GetObjectPos): Lociraj objekat. - [GetObjectRot](GetObjectRot): Provjeri rotaciju objekta. - [AttachObjectToPlayer](AttachObjectToPlayer): Prikvači objekat za igrača. - [OnPlayerObjectMoved](../callbacks/OnPlayerObjectMoved): Pozvano kada se player-objekat prestane kretati.
openmultiplayer/web/docs/translations/bs/scripting/functions/IsPlayerObjectMoving.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/IsPlayerObjectMoving.md", "repo_id": "openmultiplayer", "token_count": 790 }
372
--- title: MovePlayerObject description: Premjestite player objekat na novi položaj zadanom brzinom. tags: ["player"] --- ## Deskripcija Premjestite player objekat na novi položaj zadanom brzinom. Također podržava rotaciju. Also supports rotation. Igrači/vozila će 'surfati' objektom dok se kreće. | Ime | Deskripcija | | ----------- | ------------------------------------------------------ | | playerid | ID igrača čiji se player objekat pomjera. | | objectid | ID objekta za pomjeriti. | | Float:X | X kordinata za pomjeriti objekat. | | Float:Y | Y kordinata za pomjeriti objekat. | | Float:Z | Z kordinata za pomjeriti objekat. | | Float:Speed | Brzina kojom se objekt premješta (jedinice u sekundi). | | Float:RotX | FINALNA X rotacija (neobavezna). | | Float:RotY | FINALNA Y rotacija (neobavezna). | | Float:RotZ | FINALNA Z rotacija (neobavezna). | | playerid | Igrač kojeg si povezao sa ovim objektom. | | objectid | ID objekta kojeg želiš pomjeriti. | | Float:X | Nova X kordinata. | | Float:Y | Nova Y kordinata. | | Float:Z | Nova Z kordinata. | | Float:Speed | Brzina kojom se objekt premješta. | ## Returns Vrijeme koje će biti potrebno da se objekt pomakne u milisekundama. ## Primjeri ```c MovePlayerObject(playerid, objectid, 2001.195679, 1547.113892, 10); ``` ## Zabilješke :::tip Ako koristite parametre rotacije, objekt se mora premjestiti (X / Y / Z). Objekt će interpolirati rotaciju od trenutka kada se objekti počnu kretati i kada se zaustavi. Dolje navedeni parametri su za 0.3d R2 i starije verzije i trebali bi se zanemariti ako pokrenete najnoviju verziju SA-MP. ::: ## Srodne Funkcije - [CreatePlayerObject](CreatePlayerObject): Kreiraj objekat za samo jednog igrača. - [DestroyPlayerObject](DestroyPlayerObject): Uništi player objekat. - [IsValidPlayerObject](IsValidPlayerObject): Provjeri da li je određeni player objekat validan. - [StopPlayerObject](StopPlayerObject): Zaustavi player objekat od kretanja. - [IsObjectMoving](IsObjectMoving): Provjeri da li se objekat kreće. - [SetPlayerObjectPos](SetPlayerObjectPos): Postavi poziciju player objekta. - [SetPlayerObjectRot](SetPlayerObjectRot): Postavi rotaciju player objekta. - [GetPlayerObjectPos](GetPlayerObjectPos): Lociraj player objekat. - [GetPlayerObjectRot](GetPlayerObjectRot): Provjeri rotaciju player objekta. - [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): Prikvači player objekat za igrača. - [CreateObject](CreateObject): Kreiraj objekat. - [DestroyObject](DestroyObject): Uništi objekat. - [IsValidObject](IsValidObject): Provjeri da li je određeni objekat validan. - [MoveObject](MoveObject): Pomjeri objekat. - [StopObject](StopObject): Zaustavi objekat od kretanja. - [IsPlayerObjectMoving](IsPlayerObjectMoving): Provjeri da li se player objekat kreće. - [SetObjectPos](SetObjectPos): Postavi poziciju objekta. - [SetObjectRot](SetObjectRot): Postavi rotaciju objekta. - [GetObjectPos](GetObjectPos): Lociraj objekat. - [GetObjectRot](GetObjectRot): Provjeri rotaciju objekta. - [AttachObjectToPlayer](AttachObjectToPlayer): Prikvači objekat za igrača.
openmultiplayer/web/docs/translations/bs/scripting/functions/MovePlayerObject.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/MovePlayerObject.md", "repo_id": "openmultiplayer", "token_count": 1598 }
373
--- title: PlayerTextDrawBackgroundColor description: Podesite boju pozadine player-textdrawa. tags: ["player", "textdraw", "playertextdraw"] --- ## Deskripcija Podesite boju pozadine player-textdrawa. | Ime | Deskripcija | | -------- | -------------------------------------------------------------- | | playerid | ID igrača čijem će se player-textdraw postaviti boja pozadine. | | text | ID player-textdrawa za postaviti boju pozadine. | | color | Boja koja će biti postavljena. | ## Returns Note Ako se PlayerTextDrawSetOutline koristi s veličinom> 0, boja obrisa odgovarat će boji koja se koristi u PlayerTextDrawBackgroundColor. Čini se da promjena vrijednosti boje mijenja boju koja se koristi u PlayerTextDrawColor ## Primjeri ```c new PlayerText:gMyTextdraw; public OnPlayerConnect(playerid) { gMyTextdraw = CreatePlayerTextDraw(playerid, 320.0, 425.0, "Ovo je primjer textdrawa"); PlayerTextDrawUseBox(playerid, gMyTextdraw, 1); PlayerTextDrawBackgroundColor(playerid, gMyTextdraw, 0xFFFFFFFF); // Postavi mu boju pozadine na bijelu return 1; } ``` ## Zabilješke :::tip Ako se PlayerTextDrawSetOutline koristi s veličinom> 0, boja obrisa odgovarat će boji koja se koristi u PlayerTextDrawBackgroundColor. Čini se da promjena vrijednosti boje mijenja boju koja se koristi u PlayerTextDrawColor ::: ## Srodne Funkcije - [CreatePlayerTextDraw](CreatePlayerTextDraw): Kreiraj player-textdraw. - [PlayerTextDrawDestroy](PlayerTextDrawDestroy): Uništi player-textdraw. - [PlayerTextDrawColor](PlayerTextDrawColor): Postavi boju teksta u player-textdrawu. - [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): Postavi boju box-a od player-textdrawa. - [PlayerTextDrawAlignment](PlayerTextDrawAlignment): Postavi poravnanje player-textdrawa. - [PlayerTextDrawFont](PlayerTextDrawFont): Postavi font player-textdrawa. - [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): Postavi veličinu slova u tekstu player-textdrawa. - [PlayerTextDrawTextSize](PlayerTextDrawTextSize): Postavi veličinu box-a player-textdrawa (ili dijela koji reaguje na klik za PlayerTextDrawSetSelectable). - [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): Omogući/onemogući korišćenje outline-a za player-textdraw. - [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): Postavi sjenu na player-textdraw. - [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): Razmjeri razmak teksta u player-textdrawu na proporcionalni omjer. - [PlayerTextDrawUseBox](PlayerTextDrawUseBox): Omogući/onemogući korišćenje box-a za player-textdraw. - [PlayerTextDrawSetString](PlayerTextDrawSetString): Postavi tekst player-textdrawa. - [PlayerTextDrawShow](PlayerTextDrawShow): Prikaži player-textdraw. - [PlayerTextDrawHide](PlayerTextDrawHide): Sakrij player-textdraw.
openmultiplayer/web/docs/translations/bs/scripting/functions/PlayerTextDrawBackgroundColor.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/PlayerTextDrawBackgroundColor.md", "repo_id": "openmultiplayer", "token_count": 1081 }
374
--- title: PlayerTextDrawTextSize description: Promijeni veličinu player-textdrawa (box ako je PlayerTextDrawUseBox omogućen i/ili klikljivo područje za koristiti sa PlayerTextDrawSetSelectable). tags: ["player", "textdraw", "playertextdraw"] --- ## Deskripcija Promijeni veličinu player-textdrawa (box ako je PlayerTextDrawUseBox omogućen i/ili klikljivo područje za koristiti sa PlayerTextDrawSetSelectable). | Ime | Deskripcija | | -------- | ----------------------------------------------------------------------------------- | | playerid | ID igrača čijem se player-textdrawu mijenja veličina. | | text | ID player-textdrawa za postaviti veličinu. | | Float:x | Veličina na X osi (lijevo/desno) slijedeći istu mrežu 640x480 kao i TextDrawCreate. | | Float:y | Veličina na Y osi (gore/dole) slijedeći istu mrežu 640x480 kao i TextDrawCreate. | ## Returns X i y imaju različita značenja s različitim vrijednostima PlayerTextDrawAlignment: 1 (lijevo): oni su krajnji desni ugao box-a, apsolutna kordinatama. 2 (sredina): trebaju se okrenuti (prebaciti dva), a X vrijednost je ukupna širina box-a. 3 (desno): x i y su kordinate krajnjeg lijevog ugla box-a 1 (left): oni su krajnji desni ugao kutije, apsolutna kordinata. 2 (center): trebaju ih okrenuti (prebaciti dva), a X vrijednost je ukupna širina boxa. 3 (right): x i y su kordinate krajnjeg lijevog ugla kutije Upotrebom fonta tipa 4 (sprite) i 5 (pregled modela) pretvara se X i Y ove funkcije iz kordinatama ugla u WIDTH i HEIGHT (offseti). Box TextDraw-a započinje 10.0 jedinica gore i 5.0 lijevo kao ishodište (TextDrawCreate kordinata). Ova funkcija definira područje na koje je moguće kliknuti za upotrebu s PlayerTextDrawSetSelectable, bilo da je box prikazan ili ne. ## Primjeri ```c MyTextDraw[playerid] = CreatePlayerTextDraw(playerid, 100.0, 33.0, "Primjer Textdrawa"); PlayerTextDrawTextSize(playerid, MyTextDraw[playerid], 2.0, 3.6); ``` ## Zabilješke :::tip X i y imaju različita značenja s različitim vrijednostima PlayerTextDrawAlignment: 1 (lijevo): oni su krajnji desni ugao box-a, apsolutna kordinatama. 2 (sredina): trebaju se okrenuti (prebaciti dva), a X vrijednost je ukupna širina box-a. 3 (desno): x i y su kordinate krajnjeg lijevog ugla box-a Upotrebom fonta tipa 4 (sprite) i 5 (pregled modela) pretvara se X i Y ove funkcije iz kordinatama ugla u WIDTH i HEIGHT (offseti). The TextDraw box počinje sa 10.0 jedinica gore i 5.0 ulijevo po zadanom (TextDrawCreate kordinata). Ova funkcija definira područje na koje je moguće kliknuti za upotrebu s PlayerTextDrawSetSelectable, bilo da je box prikazan ili ne. ::: ## Srodne Funkcije - [CreatePlayerTextDraw](CreatePlayerTextDraw): Kreiraj player-textdraw. - [PlayerTextDrawDestroy](PlayerTextDrawDestroy): Uništi player-textdraw. - [PlayerTextDrawColor](PlayerTextDrawColor): Postavi boju teksta u player-textdrawu. - [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): Postavi boju box-a od player-textdrawa. - [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): Postavi boju pozadine player-textdrawa. - [PlayerTextDrawAlignment](PlayerTextDrawAlignment): Postavi poravnanje player-textdrawa. - [PlayerTextDrawFont](PlayerTextDrawFont): Postavi font player-textdrawa. - [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): Postavi veličinu slova u tekstu player-textdrawa. - [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): Omogući/onemogući korišćenje outline-a za player-textdraw. - [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): Postavi sjenu na player-textdraw. - [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): Razmjeri razmak teksta u player-textdrawu na proporcionalni omjer. - [PlayerTextDrawUseBox](PlayerTextDrawUseBox): Omogući/onemogući korišćenje box-a za player-textdraw. - [PlayerTextDrawSetString](PlayerTextDrawSetString): Postavi tekst player-textdrawa. - [PlayerTextDrawShow](PlayerTextDrawShow): Prikaži player-textdraw. - [PlayerTextDrawHide](PlayerTextDrawHide): Sakrij player-textdraw.
openmultiplayer/web/docs/translations/bs/scripting/functions/PlayerTextDrawTextSize.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/PlayerTextDrawTextSize.md", "repo_id": "openmultiplayer", "token_count": 1695 }
375
--- title: SendClientMessageToAll description: Prikazuje poruku u chatu za sve igrače. tags: [] --- ## Deskripcija Prikazuje poruku u chatu za sve igrače. Ovo je ekvivalent SendClientMessage za više igrača. | Ime | Deskripcija | | --------------- | ---------------------------------------- | | color | Boja poruke (0xRRGGBBAA Hex format). | | const message[] | Poruka za prikazati (max 144 karaktera). | ## Returns Ova funkcija ubijek vraća true/uspješno (1). ## Primjeri ```c public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/helloworld", true) == 0) { // Pošalji poruku svima SendClientMessageToAll(-1, "Zdravo!"); return 1; } return 0; } ``` ## Zabilješke :::warning Izbjegavajte koristiti specifikatore formata u svojim porukama bez formatiranja poslanog stringa. U suprotnom će rezultirati padovima. ::: ## Srodne Funkcije - [SendClientMessage](SendClientMessage): Pošalji poruku određenom igraču. - [SendPlayerMessageToAll](SendPlayerMessageToAll): Prisilite igrača da pošalje tekst za sve igrače.
openmultiplayer/web/docs/translations/bs/scripting/functions/SendClientMessageToAll.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/SendClientMessageToAll.md", "repo_id": "openmultiplayer", "token_count": 502 }
376
--- title: SetNameTagDrawDistance description: Postavi maksimalnu distancu sa koje se prikazuju imena igrača. tags: [] --- ## Deskripcija Postavi maksimalnu distancu sa koje se prikazuju imena igrača. | Ime | Deskripcija | | -------------- | ---------------------- | | Float:distance | Distanca za postaviti. | ## Returns Ova funkcija ne returna (vraća) nikakve posebne vrijednosti. ## Primjeri ```c SetNameTagDrawDistance(20.0); ``` ## Zabilješke :::tip Zadana distanca je 70 SA jedinica. ::: ## Srodne Funkcije - [LimitGlobalChatRadius](LimitGlobalChatRadius): Ograničite udaljenost između igrača potrebnih da biste vidjeli njihov chat. - [ShowNameTags](ShowNameTags): Postavi nametagove uključeno ili isključeno. - [ShowPlayerNameTagForPlayer](ShowPlayerNameTagForPlayer): Prikaži ili sakrij nametag za određenog igrača.
openmultiplayer/web/docs/translations/bs/scripting/functions/SetNameTagDrawDistance.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/SetNameTagDrawDistance.md", "repo_id": "openmultiplayer", "token_count": 364 }
377
--- title: SetPlayerCameraPos description: Postavlja kameru u određenu poziciju za igrača. tags: ["player"] --- ## Deskripcija Postavlja kameru u određenu poziciju za igrača. | Ime | Deskripcija | | -------- | -------------------------------- | | playerid | ID igrača. | | Float:x | X kordinata za postaviti kameru. | | Float:y | Y kordinata za postaviti kameru. | | Float:z | Z kordinata za postaviti kameru. | ## Returns 1: Funkcija uspješno izvršena. 0: Funkcija neuspješno izvršena. Navedeni igrač ne postoji. ## Primjeri ```c SetPlayerCameraPos(playerid, 652.23, 457.21, 10.84); ``` ## Zabilješke :::tip Možda ćete morati koristiti SetPlayerCameraLookAt s ovom funkcijom da bis ispravno radila. Koristite SetCameraBehindPlayer da vratite kameru iza uređaja. ::: :::warning Korištenje funkcija kamere izravno nakon omogućavanja režima spectatora ne radi. ::: ## Srodne Funkcije - [SetPlayerCameraLookAt](SetPlayerCameraLookAt): Postavite gdje će igračeva kamera gledati. - [SetCameraBehindPlayer](SetCameraBehindPlayer): Postavi kameru igrača iza njega.
openmultiplayer/web/docs/translations/bs/scripting/functions/SetPlayerCameraPos.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/SetPlayerCameraPos.md", "repo_id": "openmultiplayer", "token_count": 501 }
378
--- title: SetPlayerObjectNoCameraCol description: Uključuje / isključuje sudar kamere predmeta igrača. tags: ["player"] --- :::warning Ova funkcija je dodana u SA-MP 0.3.7 i ne radi u nižim verzijama! ::: ## Deskripcija Uključuje/isključuje sudar kamere predmeta igrača. | Ime | Deskripcija | | -------- | --------------------------------------------------------------- | | playerid | ID igrača kojem objekat pripada. | | objectid | ID objekta kojem želite uključiti/isključiti collision (sudar). | ## Returns 1: Funkcija uspješno izvršena. 0: Funkcija neuspješno izvršena. Navedeni objekat ne postoji. ## Primjeri ```c public OnPlayerObjectMoved(playerid, objectid) { new Float:objX, Float:objY, Float:objZ; GetPlayerObjectPos(playerid, objectid, objX, objY, objZ); if (objX >= 3000.0 && objY >= 3000.0) { SetPlayerObjectNoCameraCol(playerid, objectid); } return 1; } ``` ## Zabilješke :::tip Ovo ne radi unutar normalnih granica SA mape. ::: ## Srodne Funkcije - [SetObjectNoCameraCol](SetObjectNoCameraCol): Onemogućava sudare između kamere i objekta.
openmultiplayer/web/docs/translations/bs/scripting/functions/SetPlayerObjectNoCameraCol.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/SetPlayerObjectNoCameraCol.md", "repo_id": "openmultiplayer", "token_count": 550 }
379
--- title: SetPlayerWeather description: Postavite vrijeme (weather) igrača. tags: ["player"] --- ## Deskripcija Postavite vrijeme (weather) igrača. | Ime | Deskripcija | | -------- | ------------------------------- | | playerid | ID igrača za postaviti vrijeme. | | weather | Vrijeme (weather) za postaviti. | ## Returns Ova funkcija ne returna (vraća) nikakve posebne vrijednosti. ## Primjeri ```c public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/storm", true)) { SetPlayerWeather(playerid, 8); return 1; } return 0; } ``` ## Zabilješke :::tip Ako je omogućen TogglePlayerClock, vrijeme će se polako mijenjati s vremenom, umjesto da se promijeni trenutno. U igri postoje samo važeći 21 vremenski ID (0 - 20), ali igra nema bilo kakav oblik provjere dometa. ::: ## Srodne Funkcije - [SetWeather](SetWeather): Postavite globalno vrijeme (weather). - [SetGravity](SetGravity): Postavite globalnu gravitaciju.
openmultiplayer/web/docs/translations/bs/scripting/functions/SetPlayerWeather.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/SetPlayerWeather.md", "repo_id": "openmultiplayer", "token_count": 433 }
380
--- title: SetVehiclePos description: Postavlja poziciju vozila. tags: ["vehicle"] --- ## Deskripcija Postavlja poziciju vozila. | Ime | Deskripcija | | --------- | ----------------------------------------------- | | vehicleid | ID vozila kojem želite postaviti novu poziciju. | | Float:x | X kordinata na koju treba pozicirati vozilo. | | Float:y | Y kordinata na koju treba pozicirati vozilo. | | Float:z | Z kordinata na koju treba pozicirati vozilo. | ## Returns 1: Funkcija uspješno izvršena. 0: Funkcija neuspješno izvršena. Navedeno vozilo ne postoji. ## Primjeri ```c // Postavi vozilo igrača na kordinatama 0, 0, 3 (centar SA) new vehicleid = GetPlayerVehicleID(playerid); SetVehiclePos(vehicleid, 0, 0, 3); ``` ## Zabilješke :::warning Prazno vozilo neće padati nakon što se bude teleportovalo u zrak. ::: ## Srodne Funkcije - [SetPlayerPos](SetPlayerPos): Postavite poziciju igrača. - [GetVehiclePos](GetVehiclePos): Doznajte položaj vozila. - [SetVehicleZAngle](SetVehicleZAngle): Postavi smjer vozila.
openmultiplayer/web/docs/translations/bs/scripting/functions/SetVehiclePos.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/SetVehiclePos.md", "repo_id": "openmultiplayer", "token_count": 492 }
381
--- title: StopObject description: Zaustavi objekat koji se kreće nakon što se MoveObject koristio. tags: [] --- ## Deskripcija Zaustavi objekat koji se kreće nakon što se MoveObject koristio. | Ime | Deskripcija | | -------- | ------------------------- | | objectid | ID objekta za zaustaviti. | ## Returns Ova funkcija ne returna (vraća) nikakve posebne vrijednosti. ## Primjeri ```c public OnGameModeInit() { new obj; obj = CreateObject(...); return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmd, "/stopobject", true) == 0) { StopObject(obj); return 1; } return 0; } ``` ## Srodne Funkcije - [CreateObject](CreateObject): Kreiraj objekat. - [DestroyObject](DestroyObject): Uništi objekat. - [IsValidObject](IsValidObject): Provjeri da li je određeni objekat validan. - [MoveObject](MoveObject): Pomjeri objekat. - [SetObjectPos](SetObjectPos): Postavi poziciju objekta. - [SetObjectRot](SetObjectRot): Postavi rotaciju objekta. - [GetObjectPos](GetObjectPos): Lociraj objekat. - [GetObjectRot](GetObjectRot): Provjeri rotaciju objekta. - [AttachObjectToPlayer](AttachObjectToPlayer): Prikvači objekat za igrača. - [CreatePlayerObject](CreatePlayerObject): Kreiraj objekat za samo jednog igrača. - [DestroyPlayerObject](DestroyPlayerObject): Uništi player objekat. - [IsValidPlayerObject](IsValidPlayerObject): Provjeri da li je određeni player objekat validan. - [MovePlayerObject](MovePlayerObject): Pomjeri player objekat. - [StopPlayerObject](StopPlayerObject): Zaustavi player objekat od kretanja. - [SetPlayerObjectPos](SetPlayerObjectPos): Postavi poziciju player objekta. - [SetPlayerObjectRot](SetPlayerObjectRot): Postavi rotaciju player objekta. - [GetPlayerObjectPos](GetPlayerObjectPos): Lociraj player objekat. - [GetPlayerObjectRot](GetPlayerObjectRot): Provjeri rotaciju player objekta. - [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): Prikvači player objekat za igrača. - [OnObjectMoved](../callbacks/OnObjectMoved): Pozvano kada se objekat prestane kretati.
openmultiplayer/web/docs/translations/bs/scripting/functions/StopObject.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/StopObject.md", "repo_id": "openmultiplayer", "token_count": 779 }
382
--- title: TextDrawSetPreviewRot description: Postavlja rotaciju i zumiranje 3D pregleda modela (3D model preview) textdrawa. tags: ["textdraw"] --- ## Deskripcija Postavlja rotaciju i zumiranje 3D pregleda modela (3D model preview) textdrawa. | Ime | Deskripcija | | ----------- | ---------------------------------------------------------------------------------------------------------------------------------- | | Float:fRotX | X vrijednost rotacije. | | Float:fRotY | Y vrijednost rotacije. | | Float:fRotZ | Z vrijednost rotacije. | | Float:fZoom | Vrijednost zumiranja, zadana vrijednost 1.0, manje vrijednosti će činiti kameru bližom a veće vrijednosti će činiti kameru daljom. | ## Returns Ova funkcija ne returna (vraća) nikakve posebne vrijednosti. ## Primjeri ```c new Text: gMyTextdraw public OnGameModeInit() { gMyTextdraw = TextDrawCreate(320.0, 240.0, "_"); TextDrawFont(gMyTextdraw, TEXT_DRAW_FONT_MODEL_PREVIEW); TextDrawUseBox(gMyTextdraw, 1); TextDrawBoxColor(gMyTextdraw, 0x000000FF); TextDrawTextSize(gMyTextdraw, 40.0, 40.0); TextDrawSetPreviewModel(gMyTextdraw, 411); TextDrawSetPreviewRot(gMyTextdraw, -10.0, 0.0, -20.0, 1.0); //Još uvijek moraš da koristiš TextDrawShowForAll/TextDrawShowForPlayer kako bi textdraw bio vidljiv. return 1; } ``` ## Zabilješke :::warning Textdraw MORA koristiti tip fonta TEXT_DRAW_FONT_MODEL_PREVIEW kako bi ova funkcija imala efekta. ::: ## Srodne Funkcije - [PlayerTextDrawSetPreviewRot](PlayerTextDrawSetPreviewRot): Postavlja rotaciju 3D prikaza u player-textdrawu. - [TextDrawSetPreviewModel](TextDrawSetPreviewModel): Postavi 3D pregled modela textdrawa. - [TextDrawSetPreviewVehCol](TextDrawSetPreviewVehCol): Postavi boju vozila u 3D pregledu modela textdrawa. - [TextDrawFont](TextDrawFont): Postavi font textdrawa. - [OnPlayerClickTextDraw](../callbacks/OnPlayerClickTextDraw): Pozvano kada igrač klikne na textdraw.
openmultiplayer/web/docs/translations/bs/scripting/functions/TextDrawSetPreviewRot.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/TextDrawSetPreviewRot.md", "repo_id": "openmultiplayer", "token_count": 1212 }
383
--- title: UpdatePlayer3DTextLabelText description: Ažurira igračevom 3D Text Labelu text i boju. tags: ["player", "3dtextlabel"] --- ## Deskripcija Ažurira igračevom 3D Text Labelu text i boju. | Ime | Deskripcija | | --------------- | ----------------------------------------------- | | playerid | ID igrača za kojeg je 3D Text Label kreiran. | | PlayerText3D:textid | 3D Text Label kojeg želite ažurirati. | | color | Boja 3D Text Labela kojeg će od sada imati. | | text[] | Novi text kojeg će 3D Text Label od sada imati. | ## Returns Ova funkcija ne returna (vraća) nikakve posebne vrijednosti. ## Zabilješke :::warning Ako je text[] prazan, server/client-i pored texta će možda crashovati. ::: ## Srodne Funkcije - [Create3DTextLabel](Create3DTextLabel): Kreiraj 3D text label. - [Delete3DTextLabel](Delete3DTextLabel): Obriši 3D text label. - [Attach3DTextLabelToPlayer](Attach3DTextLabelToPlayer): Prikvači 3D text label za igrača. - [Attach3DTextLabelToVehicle](Attach3DTextLabelToVehicle): Prikvači 3D text label za vozilo. - [Update3DTextLabelText](Update3DTextLabelText): Promijeni tekst 3D text labela. - [CreatePlayer3DTextLabel](CreatePlayer3DTextLabel): Kreiraj 3D text label za jednog igrača. - [DeletePlayer3DTextLabel](DeletePlayer3DTextLabel): Obriši igračev 3D text label.
openmultiplayer/web/docs/translations/bs/scripting/functions/UpdatePlayer3DTextLabelText.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/UpdatePlayer3DTextLabelText.md", "repo_id": "openmultiplayer", "token_count": 597 }
384
--- title: fexist description: Provjerava postoji li određena datoteka u direktoriju skripti datoteka. tags: [] --- :::warning Ova funkcija započinje malim slovom. ::: ## Deskripcija Provjerava postoji li određena datoteka u direktoriju skripti datoteka. | Ime | Deskripcija | | ----------- | ----------------------------------------------------- | | pattern[] | Ime datoteke, koja po izboru sadrži zamjenske znakove | | characters. | ## Returns Broj datoteka koje odgovaraju obrascu. ## Primjeri ```c // Provjeri da li "file.txt" postoji if (fexist("file.txt")) { // Uspješno // Ispiši uspješno print("\"file.txt\" postoji."); } else { // Error print("\"file.txt\" ne postoji."); } ``` ## Srodne Funkcije - [fopen](fopen): Otvori fajl/datoteku. - [fclose](fclose): Zatvori fajl/datoteku. - [ftemp](ftemp): Stvorite privremeni tok fajlova/datoteka. - [fremove](fremove): Uklonite fajl/datoteku. - [fwrite](fwrite): Piši u fajl/datoteku. - [fread](fread): Čitaj fajl/datoteku. - [fputchar](fputchar): Stavite znak u fajl/datoteku. - [fgetchar](fgetchar): Dobijte znak iz fajla/datoteke. - [fblockwrite](fblockwrite): Zapišite blokove podataka u fajl/datoteku. - [fblockread](fblockread): Očitavanje blokova podataka iz fajla/datoteke. - [fseek](fseek): Skoči na određeni znak u fajlu/datoteci. - [flength](flength): Nabavite dužinu fajla/datoteke. - [fexist](fexist): Provjeri da li datoteka postoji. - [fmatch](fmatch): Provjeri podudaraju li se uzorci s nazivom datoteke.
openmultiplayer/web/docs/translations/bs/scripting/functions/fexist.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/fexist.md", "repo_id": "openmultiplayer", "token_count": 718 }
385
--- title: floatstr description: Konvertuje string u float. tags: [] --- :::warning Ova funkcija započinje malim slovom. ::: ## Deskripcija Konvertuje string u float. | Ime | Deskripcija | | ------ | ------------------------------- | | string | String za konvertovati u float. | ## Returns Zatraženu float vrijednost. ## Primjeri ```c new before[4] = "6.9"; // STRING koji sadrži FLOAT. SetPlayerPos(playerid, 0, 0, floatstr(before)); ``` ## Srodne Funkcije - [floatround](floatround): Pretvori float u cijeli broj (zaokruživanje). - [float](float): Pretvorite cjelobrojni broj u float.
openmultiplayer/web/docs/translations/bs/scripting/functions/floatstr.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/floatstr.md", "repo_id": "openmultiplayer", "token_count": 263 }
386
--- title: gettime description: Dobij trenutno vrijeme servera koje će biti pohranjeno u varijablama &hour, &minute and &second. tags: [] --- :::warning Ova funkcija započinje malim slovom. ::: ## Deskripcija Dobij trenutno vrijeme servera koje će biti pohranjeno u varijablama &hour, &minute and &second. | Ime | Deskripcija | | --------- | -------------------------------------------------------- | | &hour=0 | Varijabla za pohraniti sate, proslijeđeno referencom. | | &minute=0 | Varijabla za pohraniti minute, proslijeđeno referencom. | | &second=0 | Varijabla za pohraniti sekunde, proslijeđeno referencom. | ## Returns Sama funkcija vraća Unix vremensku oznaku. ## Primjeri ```c new hours, minutes, seconds, timestamp; timestamp = gettime(hours, minutes, seconds); printf("%02d:%02d:%02d", hours, minutes, seconds); printf("Sekunde od ponoći 1. januara 1970: %d", timestamp); ``` ## Zabilješke :::tip Ova je funkcija korisna za mjerenje vremenskih intervala pomoću karakteristika vremenskih žigova. Ovo može biti posebno korisno ako želite ograničiti neke funkcije na osnovu vremena (npr. Naredba koja se može izvršiti samo svakih 30 sekundi). Korištenjem ove metode ne morate se oslanjati na tajmere. ::: ## Srodne Funkcije - [getdate](getdate): Doznajte trenutni datum servera.
openmultiplayer/web/docs/translations/bs/scripting/functions/gettime.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/gettime.md", "repo_id": "openmultiplayer", "token_count": 598 }
387
--- title: setproperty description: Dodaj novu imovinu ili promijeni već postojeću. tags: [] --- :::warning Ova funkcija započinje malim slovom. ::: ## Deskripcija Dodaj novu imovinu ili promijeni već postojeću. | Ime | Deskripcija | | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | | id | Virtualna mašina za upotrebu, trebali biste zadržati ovu nulu. | | name[] | Koristi se u kombinaciji s vrijednošću prilikom pohrane cijelih brojeva; nemojte koristiti ovo ako želite pohraniti niz. | | value | Cjelobrojna vrijednost za pohraniti ili jedinstveni ID imovine ako pohranjujemo string. Upotrijebite hash-funkciju za izračunavanje iz stringa. | | string[] | Vrijednost svojstva, kao string. Ne koristite ovo ako želite pohraniti cijeli broj. | ## Returns Ova funkcija ne returna (vraća) nikakve posebne vrijednosti. ## Primjeri ```c setproperty(.name = "MyInteger", .value = 42); new value = getproperty(.name = "MyInteger"); printf("Vrijednost koja je sacuvana: %d", value); setproperty(0, "", 123984334, ":)"); new value[4]; getproperty(0, "", 123984334, value); strunpack(value, value, sizeof(value)); // Prvo moramo da otpakujemo string print(value); // Ispisati će :) setproperty(.value = 123984334, .string = ":)"); // Ostalo je isto kao i gore. ``` ## Zabilješke :::tip Preporučljivo je da koristite PVars/SVars ili GVar plugin umjesto ovih native-a zbog njihove brzine (spori su). ::: ## Srodne Funkcije - [getproperty](getproperty): Dobij vrijednost imovine. - [deleteproperty](deleteproperty): Obriši imovinu. - [existproperty](existproperty): Provjeri da li imovina postoji.
openmultiplayer/web/docs/translations/bs/scripting/functions/setproperty.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/setproperty.md", "repo_id": "openmultiplayer", "token_count": 990 }
388
--- title: valstr description: Pretvori cijeli broj u string. tags: [] --- :::warning Ova funkcija započinje malim slovom. ::: ## Deskripcija Pretvori cijeli broj u string. | Ime | Deskripcija | | --------------- | ---------------------------------------------------------------------- | | dest | Odredište stringa. | | value | Vrijednost koju treba pretvoriti u string. | | pack (optional) | Da li treba spakirati odredište (isključeno prema zadanim postavkama). | ## Returns Ova funkcija ne returna (vraća) nikakve posebne vrijednosti. ## Primjeri ```c new string[4]; new iValue = 250; valstr(string,iValue); // string je sada "250" // valstr fix by Slice stock FIX_valstr(dest[], value, bool:pack = false) { // format ne može pravilno obraditi cellmin static const cellmin_value[] = !"-2147483648"; if (value == cellmin) pack && strpack(dest, cellmin_value, 12) || strunpack(dest, cellmin_value, 12); else format(dest, 12, "%d", value), pack && strpack(dest, dest, 12); } #define valstr FIX_valstr ``` ## Zabilješke :::warning Prosljeđivanje velike vrijednosti ovoj funkciji može dovesti do zamrzavanja / pada sistema. Dostupni su popravci. Ispod je popravak koji se može staviti ravno u vašu skriptu (prije nego što se valstr koristi bilo gdje). fixes.inc uključuje ovaj popravak. ::: ## Srodne Funkcije - [strval](strval): Pretvori string u cijeli broj. - [strcmp](strcmp): Uporedi dva stringa kako bi provjerio da li su isti.
openmultiplayer/web/docs/translations/bs/scripting/functions/valstr.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/valstr.md", "repo_id": "openmultiplayer", "token_count": 768 }
389
--- title: Contributing description: Wie du bei der Dokumentation des SA-MP Wiki und open.mp mithelfen kannst. --- Jeder kann bei dieser Dokumentation mithelfen! Alles was du benötigst ist ein [GitHub](https://github.com) account und etwas Freizeit. Du musst dich nicht einmal mit Git auskennen. Alles lässt sich im Webinterface bearbeiten! Wenn du bei der Übersetzung in eine bestimmte Sprache helfen möchtest, öffne ein Pull-Request an die [`CODEOWNERS`](https://github.com/openmultiplayer/web/blob/master/CODEOWNERS) Datei schreibe eine Spalte mit deiner Sprache und deinem Username. ## Vorhandenen Content bearbeiten: Jede Seite hat einen Button, über den du die Seite bearbeitest kannst: ![Bearbeite diesen Link, der auf jeder Wiki-Seite zu finden ist](images/contributing/edit-this-page.png) Wenn du beispielsweise auf [SetVehicleAngularVelocity](../scripting/functions/SetVehicleAngularVelocity) klickst wirst du zum Beispiel auf [diese Seite](https://github.com/openmultiplayer/web/blob/master/docs/scripting/functions/SetVehicleAngularVelocity.md) weiterleitet, auf der du Änderungen vornehmen kannst, sofern du bei GitHub eingeloggt bist. Nehme deine Änderungen vor und erstelle ein "Pull Request", damit andere Wiki-Helfer sich diese ansehen können, über nötige Ergänzungen entscheiden und deine Änderungen letztendlich übernehmen können. ## Neuen Content hinzufügen Neuen Content hinzuzufügen ist etwas schwieriger. Hierzu gibt es zwei Möglichkeiten: ### GitHub Interface Beim Durchsuchen eines Verzeichnisses auf GitHub gibt es in der oberen rechten Ecke der Dateiliste eine Schaltfläche "Add File": ![Add file button](images/contributing/add-new-file.png) Du kannst so entweder eine bereits geschriebene Markdown-Datei(.md) hochladen oder direkt in den GitHub-Texteditor schreiben. Die Datei _muss_ eine `.md` Endung haben und Markdown enthalten. Für weitere Informationen zu Markdown, siehe [diese Seite](https://guides.github.com/features/mastering-markdown/). Wenn das getan ist, klicke "Propose new file" um ein Pull-Request zur Überprüfung zu erstellen. ### Git Wenn du Git nutzen möchtest, klone das Wiki Verzeichnis mit: ```sh git clone https://github.com/openmultiplayer/wiki.git ``` Öffne es mit einem bevorzugten Editor. Wir empfehlen Visual Studio Code(VSC) wegen den Tools zum editieren und formatieren von Markdown. Wie du sehen kannst wurde das hier auch in VSC geschrieben! ![Visual Studio Code markdown preview](images/contributing/vscode.png) Die folgenden Extensions können die Arbeit in VSC sehr erleichtern: - [markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint) by David Anson - diese Extension prüft, ob das geschriebene Markdown richtig formatiert ist. Es verhindert einige syntaktische und semantische Fehler. Nicht alle Warnungen sind wichtig, aber einige können die Lesbarkeit verbessern. Wenn du dir unsicher bist oder Fragen hast stelle diese im Zweifelsfall einfach einem Rezensenten! - [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) by the Prettier.js Team - dies ist ein Formatierer, der die Markdown-Dateien automatisch formatiert, sodass sie alle einen einheitlichen Stil verwenden. Das Wiki-Repository hat einige Einstellungen in seiner `package.json` die die Erweiterung automatisch anwenden sollte. Stellen sicher, dass „Format On Save“ in den Editor-Einstellungen aktiviert ist, damit die Markdown-Dateien bei jedem Speichern automatisch formatiert werden! ## Anmerkungen, Tipps und Konventionen ### Interne Links Nutze keine absoluten URLs für inter-site links. Nutze relative Pfade. - ❌ ```md To be used with [OnPlayerClickPlayer](https://www.open.mp/docs/scripting/callbacks/OnPlayerClickPlayer) ``` - ✔ ```md To be used with [OnPlayerClickPlayer](../callbacks/OnPlayerClickPlayer) ``` `../` heißt "ein verzeichnis hoch" also wenn du eine Datei innerhalb von `functions` bearbeitest und du es zu `callbacks` verlinksen willst, nutze `../` um ins `scripting/` Verzeichnis zu gelangen, dann `callbacks/`, um das "callbacks" Verzeichnis zu öffnen und dann den Dateinamen (ohne das `.md`) vom Callback das du verlinken möchtest. ### Bilder Bilder müssen in folgendes Unterverzeichnis hinein `/static/images`. Wenn du ein Bild in ein `![]()` verlinkst, nutze `/images/` als Basispfad (also ohne `static`, dies ist nur für die Directory). Falls du noch immer unsicher bist, schaue dir einfach eine andere Seite an, die Bilder nutzt und kopiere das Vorgehen von dort. ### Metadata Zu Anfang _jedes_ Dokuments sollten die Metadaten stehen: ```mdx --- title: Meine Dokumentation description: Hier steht die Beschreibung meiner Dokumentation! --- ``` Jede Seite sollte einen Titel und eine Beschreibung enthalten. Für eine vollständige Liste dessen, was zwischen `---` geschrieben werden kann, siehe [the Docusaurus documentation](https://v2.docusaurus.io/docs/markdown-features#markdown-headers). ### Überschriften Erstelle keine Level 1 (`<h1>`) Überschriften mit `#`, da dies automatisch geschieht. Die erste Überschrift sollte _immer_ `##` sein. - ❌ ```md # Meine Überschrift Das ist die Dokumentation für ... # Unter-Bereich ``` - ✔ ```md Das ist die Dokumentation für ... ## Unter-Bereich ``` ### Nutze `Code` Snippets für technische Referenzen Beim schreiben eines Absatzes, der Funktionsnamen, Zahlen, Ausdrücke oder irgendetwas anderes enthält, das nicht der Standardschreibsprache entspricht, sollten diese mit \`Backticks\` umgeben werden. So lääst sich die Sprache leichter von technischen Referenzen(beispielsweise Code-Snippets) oder Ähnlichem unterscheiden. - ❌ > Die Funktion fopen gibt einen Wert mit einem Tag vom Typ File: zurück, in dieser Zeile gibt es kein Problem, da der Rückgabewert in einer Variablen gespeichert wird, die auch das Tag File: enthält (beachte, dass die Fälle auch gleich sind). In der nächsten Zeile wird jedoch dem Dateihandle der Wert 4 hinzugefügt. 4 hat keinen Tag [...] - ✔ > Die `fopen` Funktion gibt einen Wert mit einem Tag vom Typ `File:` zurück, in dieser Zeile gibt es kein Problem, da der Rückgabewert in einer Variablen gespeichert wird, die auch das Tag `File:` (beachte, dass die Fälle auch gleich sind). In der nächsten Zeile wird jedoch dem Dateihandle der Wert `4` hinzugefügt. `4` hat keinen Tag. Im obrigen Beispiel ist `fopen` ein Funktionsname, kein Wort, also helfen `code snippet marker` dabei diesen vom restlichen Text zu unterscheiden. Wenn sich der Absatz auf einen Beispielcodeblock bezieht, hilft dies dem Leser, die Wörter mit dem Beispiel zu verknüpfen. ### Tabellen Wenn eine Tabelle Überschriften enthalten, gehören diese in die obere Spalte: - ❌ ```md | | | | ------- | ------------------------------------ | | Health | Engine Status | | 650 | Undamaged | | 650-550 | White Smoke | | 550-390 | Grey Smoke | | 390-250 | Black Smoke | | < 250 | On fire (will explode seconds later) | ``` - ✔ ```md | Health | Engine Status | | ------- | ------------------------------------ | | 650 | Undamaged | | 650-550 | White Smoke | | 550-390 | Grey Smoke | | 390-250 | Black Smoke | | < 250 | On fire (will explode seconds later) | ``` ## Migration vom SA-MP Wiki Ein Großteil vom Content wurde schon migriert, falls du dennoch eine Seite findest die fehlt, ist hier ein kurzer Guide über das Konvertieren von Content in Markdown. ### Den HTML Code bekommen 1. Klicke (Firefox) ![image](images/contributing/04f024579f8d.png) (Chrome) ![image](images/contributing/f62bb8112543.png) 2. Bewege den Mauszeiger oben links auf der Wiki-Hauptseite, am linken Rand oder in der Ecke, bis du `#content` siehst. ![image](images/contributing/65761ffbc429.png) Oder suche nach `<div id=content>` ![image](images/contributing/77befe2749fd.png) 3. Kopiere die inner HTML des Elements ![image](images/contributing/8c7c75cfabad.png) Jetzt hast du _nur_ den HTML Code von dem tatsächlichen _content_ der Seite, also genau das, was wir benötigen, und kannst es zu Markdown konvertieren. ### HTML zu Markdown konvertieren Um grundlegendes HTML (keine Tabellen) zu Markdown zu konvertieren nutze: https://domchristie.github.io/turndown/ ![image](images/contributing/77f4ea555bbb.png) ^^ Siehst du wie die Tabelle jetzt komplett im Eimer ist? ... ### HTML Tabellen zu Markdown Tabellen Da das obrige Tool keine Tabellen unterstützt, nutze für Tabellen dieses Tool: https://jmalarcon.github.io/markdowntables/ Und kopiere nur das `<table>` Element hinein: ![image](images/contributing/57f171ae0da7.png) ### Clean Up Meistens sind die Konvertierungen nicht perfekt, also liegt es an dir den Rest auszubessern. Die oben aufgeführten Formatierungserweiterungen sollten dabei helfen, aber möglicherweise ist noch etwas Handarbeit nötig. Wenn du dafür keine Zeit hast ist das auch kein Problem! Gebe einfach ein `unfinished draft` ab und jemand anderes kann dort weiterarbeiten, wo du aufgehört hast. ## Lizenzvereinbarung Alle open.mp Projekte haben ein [Contributor License Agreement](https://cla-assistant.io/openmultiplayer/homepage). Dadurch erlaubst du uns durch deine Arbeit am Projekt zu nutzen und auch als Open-Source bereitzustellen. Bei deinem ersten Pull Request wird der CLA-Assistant bot einen Link schicken, über den du dieser Lizenzvereinbarung zustimmen kannst.
openmultiplayer/web/docs/translations/de/meta/Contributing.md/0
{ "file_path": "openmultiplayer/web/docs/translations/de/meta/Contributing.md", "repo_id": "openmultiplayer", "token_count": 3853 }
390
--- título: OnNPCConnect descripción: This callback is called when a NPC successfully connects to the server. tags: ["npc"] --- ## Descripción Este callback se llama cuando un NPC se conecta con éxito al servidor. | Nombre | Descripción | | -------------- | -------------------------------------------------- | | myplayerid | El ID de jugador que se le ha dado al NPC | ## Ejemplos ```c public OnNPCConnect(myplayerid) { printf("Me conecté correctamente al servidor con la ID %i!", myplayerid); } ``` ## Funciones Relacionadas Los siguientes callbacks pueden ser útiles, ya que están relacionadas con esta devolución de llamada de una forma u otra. - [OnNPCDisconnect](OnNPCDisconnect): Este callback se llama cuando el NPC se desconecta del servidor. - [OnPlayerConnect](OnPlayerConnect): Este callback se llama cuando un jugador se conecta al servidor. - [OnPlayerDisconnect](OnPlayerDisconnect): Este callback se llama cuando un jugador abandona el servidor.
openmultiplayer/web/docs/translations/es/scripting/callbacks/OnNPCConnect.md/0
{ "file_path": "openmultiplayer/web/docs/translations/es/scripting/callbacks/OnNPCConnect.md", "repo_id": "openmultiplayer", "token_count": 384 }
391
--- título: OnPlayerExitedMenu descripción: Se llama cuando un jugador sale de un menú. tags: ["player", "menu"] --- ## Descripción Se llama cuando un jugador sale de un menú. | Nombre | Descripción | | -------- | ----------------------------------------- | | playerid | El ID del jugador que salió del menú. | ## Devoluciones Siempre se llama primero en filterscripts. ## Ejemplos ```c public OnPlayerExitedMenu(playerid) { TogglePlayerControllable(playerid,1); // descongela al jugador cuando este sale de un menú return 1; } ``` ## Funciones Relacionadas - [CreateMenu](../functions/CreateMenu): Crea un menú. - [DestroyMenu](../functions/DestroyMenu): Destruye un menú.
openmultiplayer/web/docs/translations/es/scripting/callbacks/OnPlayerExitedMenu.md/0
{ "file_path": "openmultiplayer/web/docs/translations/es/scripting/callbacks/OnPlayerExitedMenu.md", "repo_id": "openmultiplayer", "token_count": 281 }
392
--- título: OnPlayerStateChange descripción: Este callback se llama cuando un jugador cambia de estado. tags: ["player"] --- ## Description Este callback se llama cuando un jugador cambia de estado. Por ejemplo, cuando pasa de ser conductor a estár a pie (bajándose de vehículo). | Nombre | Descripción | | -------- | ---------------------------------------- | | playerid | El ID del jugador que cambió de estado. | | newstate | El nuevo estado del jugador. | | oldstate | El estado anterior del jugador. | Vea [Player States](../resources/playerstates) para ver una lista de todos los estados de jugador disponibles. ## Devoluciones Siempre se llama primero en filterscripts. ## Ejemplos ```c public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstate) { if (oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) // El jugador entró a un vehículo como conductor { new vehicleid = GetPlayerVehicleID(playerid); AddVehicleComponent(vehicleid, 1010); //Añadir nitro al vehículo } return 1; } ``` ## Notas <TipNPCCallbacksES /> ## Funciones Relacionadas - [GetPlayerState](../functions/GetPlayerState): Obtener el estado actual de un jugador. - [GetPlayerSpecialAction](../functions/GetPlayerSpecialAction): Obtener la acción especial actual de un jugador. - [SetPlayerSpecialAction](../functions/SetPlayerSpecialAction): Establecer una acción especial a un jugador.
openmultiplayer/web/docs/translations/es/scripting/callbacks/OnPlayerStateChange.md/0
{ "file_path": "openmultiplayer/web/docs/translations/es/scripting/callbacks/OnPlayerStateChange.md", "repo_id": "openmultiplayer", "token_count": 555 }
393
--- título: OnVehicleRespray descripción: Este callback se llama cuando un jugador sale de un taller de modificación, sin importar si los colores no fueron cambiados. tags: ["vehicle"] --- ## Descripción Este callback se llama cuando un jugador sale de un taller de modificación, sin importar si los colores no fueron cambiados. Cuidado, el nombre es ambiguo, los Pay 'n' Spray no llamarán este callback. | Nombre | Descripción | | --------- | ------------------------------------------------------------ | | playerid | El ID del jugador que está conduciendo el vehículo. | | vehicleid | El ID del vehículo repintado. | | color1 | El color al que se cambió el color primario del vehículo. | | color2 | El color al que se cambió el color secundario del vehículo. | ## Devoluciones 0 - Prevendrá a filterscripts de recibir este callback. Siempre se llama primero en el gamemode. ## Ejemplos ```c public OnVehicleRespray(playerid, vehicleid, color1, color2) { new string[48]; format(string, sizeof(string), "Repintaste el vehículo %d a los colores %d y %d!", vehicleid, color1, color2); SendClientMessage(playerid, COLOR_GREEN, string); return 1; } ``` ## Notas :::tip Este callback no es llamado por ChangeVehicleColor. Engañosamente, este callback no se llama por pay 'n' spray (solo tiendas de modificación). Solución acá: http://pastebin.com/G81da7N1 ::: :::warning Bugs Conocidos: La vista previa de un componente dentro de una tienda de modificación podría llamar a este callback. ::: ## Funciones Relaciones - [ChangeVehicleColor](../functions/ChangeVehicleColor): Establecer el color de un vehículo. - [ChangeVehiclePaintjob](../functions/ChangeVehiclePaintjob): Cambiar la capa de pintura de un vehículo. - [OnVehiclePaintjob](OnVehiclePaintjob): Se llama cuando la capa de pintura de un vehículo es modificada. - [OnVehicleMod](OnVehicleMod): Se llama cuando un vehículo es modificado. - [OnEnterExitModShop](OnEnterExitModShop): Se llama cuando un jugador sale de un taller de modificación.
openmultiplayer/web/docs/translations/es/scripting/callbacks/OnVehicleRespray.md/0
{ "file_path": "openmultiplayer/web/docs/translations/es/scripting/callbacks/OnVehicleRespray.md", "repo_id": "openmultiplayer", "token_count": 815 }
394
--- title: OnPlayerCommandText description: این کالبک زمانی فرا خوانده می شود که یک بازیکن یک دستور را در پنجره کلاینت وارد کند. tags: ["player"] --- <div dir="rtl" style={{ textAlign: "right" }}> ## توضیحات این کالبک زمانی فرا خوانده می شود که یک بازیکن یک دستور را در پنجره کلاینت وارد کند. دستورات چیز هایی هستند که با اسلش شروع می شوند، به عنوان مثال help/. | اسم | توضیح | | --------- | ----------------------------------------------------------- | | playerid | شناسه بازیکنی که دستور را وارد میکند. | | cmdtext[] | دستور وارد شده (از جمله اسلش). | ## مقادیر برگشتی این همیشه ابتدا در فیلتر اسکریپت ها فرا خوانده می شود بنابراین برگداندن 1 جلوی دیدن اسکریپت های دیگر را میگیرد. ## مثال ها </div> ```c public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/help", true)) { SendClientMessage(playerid, -1, "SERVER: In dastoore /help ast"); return 1; // Bargardandan 1 be server etela midahad ke dastoor pardazesh shode. // OnPlayerCommandText dar script haye digar farakhani nemishavad. } return 0; // Bargardandane 0 be server etela midahad ke dastoor tavasote in script pardazesh nashode. // OnPlayerCommandText dar script haye digar farakhani mishavad ta zamani ke 1 ra bargaranad. // Agar hich scripti 1 ra barnagardanad, payame 'SERVER: Unknown Command' baraye bazikon namayesh dade mishavad. } ``` <div dir="rtl" style={{ textAlign: "right" }}> ## نکته ها :::tip این کالبک توسط NPC نیز قابل فرا خوانی است. ::: ## تابع های مرتبط - [SendRconCommand](../functions/SendRconCommand.md): یک دستور RCON را از طریق اسکریپت ارسال میکند. </div>
openmultiplayer/web/docs/translations/fa/scripting/callbacks/OnPlayerCommandText.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fa/scripting/callbacks/OnPlayerCommandText.md", "repo_id": "openmultiplayer", "token_count": 1122 }
395
--- title: OnActorStreamIn description: This callback is called when an actor is streamed in by a player's client. tags: [] --- <VersionWarn name='callback' version='SA-MP 0.3.7' /> ## Deskripsyon Ang callback na ito ay natatawag kapag ang actor ay na stream na sa client ng player. | Pangalan | Deskripsyon | | ----------- | ------------------------------------------------------------- | | actorid | Ang ID ng actor na na stream para sa player. | | forplayerid | Ang ID ng player kung kanino na stream ang actor | ## Returns Lagi itong na tatawag una sa mga filterscript. ## Mga Halimbawa ```c public OnActorStreamIn(actorid, forplayerid) { new string[40]; format(string, sizeof(string), "Ang actor %d ay naka stream na para sa iyo.", actorid); SendClientMessage(forplayerid, 0xFFFFFFFF, string); return 1; } ``` ## Mga Dapat Unawain <TipNPCCallbacks /> ## Mga Related na Callbacks
openmultiplayer/web/docs/translations/fil/scripting/callbacks/OnActorStreamIn.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fil/scripting/callbacks/OnActorStreamIn.md", "repo_id": "openmultiplayer", "token_count": 384 }
396
--- title: OnNPCModeInit. description: Tinatawag ang callback na ito kapag na-load ang isang NPC script. tags: ["npc"] --- ## Description Tinatawag ang callback na ito kapag na-load ang isang NPC script. ## Examples ```c public OnNPCModeInit() { print("NPC script loaded."); return 1; } ``` ## Related Callbacks Maaaring maging kapaki-pakinabang ang mga sumusunod na callback, dahil nauugnay ang mga ito sa callback na ito sa isang paraan o iba pa. - [OnNPCModeExit](OnNPCModeExit): Tinatawag ang callback na ito kapag nag-unload ang isang NPC script.
openmultiplayer/web/docs/translations/fil/scripting/callbacks/OnNPCModeInit.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fil/scripting/callbacks/OnNPCModeInit.md", "repo_id": "openmultiplayer", "token_count": 212 }
397
--- title: OnPlayerUpdate description: This callback is called every time a client/player updates the server with their status. tags: ["player"] --- ## Paglalarawan Ang callback na ito ay tinatawag sa tuwing ina-update ng isang kliyente/manlalaro ang server sa kanilang katayuan. Madalas itong ginagamit para gumawa ng mga custom na callback para sa mga update ng kliyente na hindi aktibong sinusubaybayan ng server, gaya ng mga update sa kalusugan o armor o mga manlalaro na nagpapalit ng armas. | Name | Description | | -------- | ------------------------------------------ | | playerid | ID ng player na nagpapadala ng update packet. | ## Returns 0 - Ang pag-update mula sa player na ito ay hindi mai-replicate sa ibang mga kliyente. 1 - Isinasaad na ang update na ito ay maaaring maproseso nang normal at maipadala sa iba pang mga manlalaro. Lagi itong na tatawag una sa mga filterscript. ## Halimbawa ng Paggamit ```c public OnPlayerUpdate(playerid) { new iCurWeap = GetPlayerWeapon(playerid); // Ibalik ang kasalukuyang sandata ng manlalaro if (iCurWeap != GetPVarInt(playerid, "iCurrentWeapon")) // Kung nagpalit siya ng armas simula noong huling update { // Tawagan natin ang isang callback na pinangalanang OnPlayerChangeWeapon OnPlayerChangeWeapon(playerid, GetPVarInt(playerid, "iCurrentWeapon"), iCurWeap); SetPVarInt(playerid, "iCurrentWeapon", iCurWeap);// I-update ang variable ng armas } return 1; // Ipadala ang update na ito sa ibang mga manlalaro. } stock OnPlayerChangeWeapon(playerid, oldweapon, newweapon) { new s[128], oWeapon[24], nWeapon[24]; GetWeaponName(oldweapon, oWeapon, sizeof(oWeapon)); GetWeaponName(newweapon, nWeapon, sizeof(nWeapon)); format(s, sizeof(s), "Iniba mo ang iyong sandata mula sa %s patungong %s!", oWeapon, nWeapon); SendClientMessage(playerid, 0xFFFFFFFF, s); } public OnPlayerUpdate(playerid) { new Float:fHealth; GetPlayerHealth(playerid, fHealth); if (fHealth != GetPVarFloat(playerid, "faPlayerHealth")) { // Ang kalusugan ng manlalaro ay nagbago mula noong huling pag-update -> server, kaya malinaw na na-update ang bagay. // Suriin natin kung mawawalan o makakakuha ng buhay ang manlalaro, anti-health cheat? ;) if (fHealth > GetPVarFloat(playerid, "faPlayerHealth")) { /* Siya ay nakakuha ng kalusugan! Pandaraya? Sumulat ng iyong sariling mga script dito upang malaman kung paano ang isang manlalaro nakakuha ng kalusugan! */ } else { /* Nawalan siya ng buhay! */ } SetPVarFloat(playerid, "faPlayerHealth", fHealth); } } ``` ## Mga Dapat Unawain <TipNPCCallbacks /> :::warning - Ang callback na ito ay tinatawag, sa karaniwan, 30 beses bawat segundo, bawat manlalaro; gamitin lamang ito kapag alam mo kung para saan ito (o mas mahalaga kung ano ang HINDI para sa). Ang dalas ng pagtawag sa callback na ito para sa bawat manlalaro ay nag-iiba, depende sa kung ano ang ginagawa ng manlalaro. Ang pagmamaneho o pagbaril ay magti-trigger ng mas maraming update kaysa sa idling. :::
openmultiplayer/web/docs/translations/fil/scripting/callbacks/OnPlayerUpdate.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fil/scripting/callbacks/OnPlayerUpdate.md", "repo_id": "openmultiplayer", "token_count": 1266 }
398
--- title: AllowPlayerTeleport description: Paganahin/Huwag paganahin ang kakayahang mag-teleport para sa isang manlalaro sa pamamagitan ng pag-right-click sa mapa. tags: ["player"] --- :::warning Ang function na ito, mula sa 0.3d, ay hindi na ginagamit. Tignan ang [OnPlayerClickMap](../callbacks/OnPlayerClickMap). ::: ## Description Paganahin/Huwag paganahin ang kakayahang mag-teleport para sa isang manlalaro sa pamamagitan ng pag-right-click sa mapa | Name | Description | | -------- | -------------------------------------------- | | playerid | Ang ID ng player upang payagan ang teleport. | | allow | 1-payagan, 0-hindi payagan | ## Returns Ang function na ito ay hindi nagbabalik ng anumang partikular na halaga. ## Examples ```c public OnPlayerConnect( playerid ) { // Pinapayagan ang Manlalaro na mag-teleport sa pamamagitan ng pag-right-click sa mapa // dahil nasa OnPlayerConnect ito, gagawin ito para sa BAWAT manlalaro AllowPlayerTeleport( playerid, 1 ); } ``` ## Notes :::warning Ang function na ito ay gagana lamang kung [AllowAdminTeleport](AllowAdminTeleport) ay pinagana, at kailangan mong maging isang admin. ::: ## Related Functions - [AllowAdminTeleport](AllowAdminTeleport): I-toggle ang waypoint teleporting para sa mga admin ng RCON.
openmultiplayer/web/docs/translations/fil/scripting/functions/AllowPlayerTeleport.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fil/scripting/functions/AllowPlayerTeleport.md", "repo_id": "openmultiplayer", "token_count": 496 }
399
--- title: DestroyMenu description: Sinisira ang tinukoy na menu. tags: ["menu"] --- ## Description Sinisira ang tinukoy na menu. | Name | Description | | ------ | ---------------------- | | menuid | Ang menu ID ng sisirain| ## Returns True kung matagumpay ang pagsira, kung hindi man ay False ## Examples ```c new Menu:examplemenu; examplemenu = CreateMenu("Your Menu", 2, 200.0, 100.0, 150.0, 150.0); // ... DestroyMenu(examplemenu); ``` ## Related Functions - [CreateMenu](CreateMenu): Gumawa ng menu. - [SetMenuColumnHeader](SetMenuColumnHeader): Itakda ang header para sa isa sa mga column sa isang menu. - [AddMenuItem](AddMenuItem): Magdagdag ng item sa isang menu. - [OnPlayerSelectedMenuRow](../callbacks/OnPlayerSelectedMenuRow): Tinatawag kapag pumili ang isang manlalaro ng row sa isang menu. - [OnPlayerExitedMenu](../callbacks/OnPlayerExitedMenu): Tinatawag kapag lumabas ang isang player sa isang menu.
openmultiplayer/web/docs/translations/fil/scripting/functions/DestroyMenu.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fil/scripting/functions/DestroyMenu.md", "repo_id": "openmultiplayer", "token_count": 324 }
400
--- title: GetPlayerState description: Kunin ang kasalukuyang estado ng isang manlalaro. tags: ["player"] --- ## Description Kunin ang kasalukuyang estado ng isang manlalaro. | Name | Description | | -------- | ------------------------------------------------- | | playerid | Ang ID ng player para makuha ang kasalukuyang estado. | ## Returns Ang kasalukuyang estado ng manlalaro bilang isang integer (tingnan ang: [Player States](../resources/playerstates)). ## Examples ```c public OnPlayerDeath(playerid, killerid, WEAPON:reason) { new playerState = GetPlayerState(killerid); // Kunin ang estado ng pumatay if (playerState == PLAYER_STATE_DRIVER) // Kung ang pumatay ay nasa sasakyan { // Ito ay isang driver drive-by, kumuha ng pera GivePlayerMoney(killerid, -10000); } return 1; } ``` ## Related Functions - [GetPlayerSpecialAction](GetPlayerSpecialAction): Kunin ang kasalukuyang special action ng manlalaro. - [SetPlayerSpecialAction](SetPlayerSpecialAction): Magtakda ng special action ng manlalaro. - [OnPlayerStateChange](../callbacks/OnPlayerStateChange): Tinatawag kapag binago ng player ang estado.
openmultiplayer/web/docs/translations/fil/scripting/functions/GetPlayerState.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fil/scripting/functions/GetPlayerState.md", "repo_id": "openmultiplayer", "token_count": 427 }
401
--- title: SetPlayerWeather description: Magtakda ng panahon ng manlalaro. tags: ["player"] --- ## Description Magtakda ng panahon ng manlalaro. | Name | Description | | -------- | ---------------------------------------------- | | playerid | Ang ID ng player na ang panahon ay itatakda. | | weather | Ang [weather](../resources/weatherid) na itatakda.| ## Returns Ang function na ito ay hindi nagbabalik ng anumang value. ## Examples ```c public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/storm", true)) { SetPlayerWeather(playerid, 8); return 1; } return 0; } ``` ## Notes :::tip Kung pinagana ang TogglePlayerClock, dahan-dahang magbabago ang panahon sa paglipas ng panahon, sa halip na agad na magbago. Mayroon lamang valid na 21 weather ID sa laro (0 - 20), gayunpaman ang laro ay walang anumang anyo ng range check. ::: ## Related Functions - [SetWeather](SetWeather): Itakda ang pandaigdigang panahon. - [SetGravity](SetGravity): Itakda ang global gravity.
openmultiplayer/web/docs/translations/fil/scripting/functions/SetPlayerWeather.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fil/scripting/functions/SetPlayerWeather.md", "repo_id": "openmultiplayer", "token_count": 403 }
402
--- title: floatdiv description: Hatiin ang isang float sa isa pa. tags: ["math", "floating-point"] --- <LowercaseNote /> ## Description Hatiin ang isang float sa isa pa. Redundant bilang ang operator ng dibisyon (/) ay gumagawa ng parehong bagay. | Name | Description | | -------------- | ----------------------------------------- | | Float:dividend | Unang float. | | Float:divisor | Pangalawang float (hinahati ang unang float.) | ## Returns Ang quotient ng dalawang binigay na floats. ## Examples ```c public OnGameModeInit() { new Float:Number1 = 8.05, Float:Number2 = 3.5; //Nagdedeklara ng dalawang float, Number1 (8.05) at Number2 (3.5) new Float:Quotient; Quotient = floatdiv(Number1, Number2); //Sine-save ang quotient(=8.05/3.5 = 2.3) ng Number1 at Number2 sa float na "Quotient" return 1; } ``` ## Related Functions - [floatadd](floatadd): Mag add ng dalawang float nang magkasama. - [floatsub](floatsub): Mag subtract ng float mula sa isa pang float. - [floatmul](floatmul): Mag multiply ang dalawang float.
openmultiplayer/web/docs/translations/fil/scripting/functions/floatdiv.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fil/scripting/functions/floatdiv.md", "repo_id": "openmultiplayer", "token_count": 453 }
403
--- title: AddCharModel description: Ajoute un nouveau skin de joueur à télécharger tags: [] --- <VersionWarn version='SA-MP 0.3.DL R1' /> ## Description Ajoute un nouveau skin de joueur à télécharger. The fichier modèle va être sauvegardé dans le dossier Documents\GTA San Andreas User Files\SAMP\cache du joueur, dans un dossier contenant l'IP et le port du serveur, et avec un nom de fichier correspondant au CRC du fichier. | Name | Description | | ------- | -------------------------------------------------------------------------------------------------------------- | | baseid | L'ID de base du skin à utiliser (Utilisé pour récupérer le skin et le comportement du personnage si le téléchargement vient à echouer). | | newid | Le nouvel ID de skin, de 20000 à 30000 (10000 slots) à utiliser dans SetPlayerSkin | | dffname | Nom du fichier .dff de collision, situé dans le dossier models par défaut (peut être modifié avec le paramètre artpath de server.cfg). | | txdname | Nom du fichier .tdx de texture, situé dans le dossier models par défaut (peut être modifié avec le paramètre artpath de server.cfg). | ## Retourne 1: La fonction s'est correctement exécutée. 0: L'exécution ne s'est pas correctement déroulé. ## Exemples ```c public OnGameModeInit() { AddCharModel(305, 20001, "lvpdpc2.dff", "lvpdpc2.txd"); AddCharModel(305, 20002, "lapdpd2.dff", "lapdpd2.txd"); return 1; } ``` ```c AddCharModel(305, 20001, "lvpdpc2.dff", "lvpdpc2.txd"); AddCharModel(305, 20002, "lapdpd2.dff", "lapdpd2.txd"); ``` ## Notes :::tip Le paramètre useartwork doit être activé dans les paramètres du serveur pour que cette fonction soit utilisable ::: :::warning Il n'y a actuellement aucune restriction sur le moment où cette fonction est appelée, prenez donc en compte qu'il est possible, si vous appelez cette fonction en dehors de OnFilterScriptInit/OnGameModeInit, les modèles de personnages ne soit pas téléchargés chez le joueur. ::: ## Fonction connexes - [SetPlayerSkin](SetPlayerSkin): Applique un skin au joueur.
openmultiplayer/web/docs/translations/fr/scripting/AddCharModel.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fr/scripting/AddCharModel.md", "repo_id": "openmultiplayer", "token_count": 858 }
404
--- title: OnNPCExitVehicle description: Ce rappel est appelé lorsqu'un PNJ quitte un véhicule. tags: ["npc"] --- ## Description Ce rappel est appelé lorsqu'un PNJ quitte un véhicule. ## Exemples ```c public OnNPCExitVehicle() { print("Le PNJ a quitté le véhicule"); return 1; } ``` ## Rappels Relatives Les rappels suivants peuvent être utiles, car ils sont liés à ce rappel d'une manière ou d'une autre. - [OnNPCEnterVehicle](OnNPCEnterVehicle): Ce rappel est appelé lorsqu'un PNJ entre dans un véhicule.
openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnNPCExitVehicle.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnNPCExitVehicle.md", "repo_id": "openmultiplayer", "token_count": 222 }
405
--- title: OnPlayerEditAttachedObject description: Cette callback est appelée quand un joueur en a fini avec le mode édition des attach objects. tags: ["player"] --- ## Paramètres Cette callback est appelée quand un joueur en a fini avec le mode édition des attach objects. | Name | Description | |------------------------------|-----------------------------------------------------------------------------------| | `int` playerid | ID du joueur en mode édition | | `int` EDIT_RESPONSE:response | **0** si annulé (ECHAP) ou **1** si le joueur a cliqué sur l'icône de sauvegarde. | | `int` index | The index of the attached object (0-9) | | `int` modelid | Model de l'attach object qui a été édité | | `int` boneid | Bone de l'attach object qui a été édité | | `float` Float:fOffsetX | Offset X de l'attach object qui a été édité | | `float` Float:fOffsetY | Offset Y de l'attach object qui a été édité | | `float` Float:fOffsetZ | Offset Z de l'attach object qui a été édité | | `float` Float:fRotX | Rotation X de l'attach object qui a été édité | | `float` Float:fRotY | Rotation Y de l'attach object qui a été édité | | `float` Float:fRotZ | Rotation Z de l'attach object qui a été édité | | `float` Float:fScaleX | Scale _(taille)_ X de l'attach object qui a été édité | | `float` Float:fScaleY | Scale _(taille)_ X de l'attach object qui a été édité | | `float` Float:fScaleZ | Scale _(taille)_ X de l'attach object qui a été édité | ## Valeur de retour **1** - Autorise la callback à être appelée par un autre script. **0** - Refuser que la callback soit appelée ailleurs. ## Exemple ```c enum attached_object_data { Float:ao_x, Float:ao_y, Float:ao_z, Float:ao_rx, Float:ao_ry, Float:ao_rz, Float:ao_sx, Float:ao_sy, Float:ao_sz } new ao[MAX_PLAYERS][MAX_PLAYER_ATTACHED_OBJECTS][attached_object_data]; // Les données doivent être stockées dans les array ci-dessus quand les attach objects sont ... attachés. public OnPlayerEditAttachedObject(playerid, EDIT_RESPONSE:response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ) { if (response) { SendClientMessage(playerid, COLOR_GREEN, "Édition sauvegardée."); ao[playerid][index][ao_x] = fOffsetX; ao[playerid][index][ao_y] = fOffsetY; ao[playerid][index][ao_z] = fOffsetZ; ao[playerid][index][ao_rx] = fRotX; ao[playerid][index][ao_ry] = fRotY; ao[playerid][index][ao_rz] = fRotZ; ao[playerid][index][ao_sx] = fScaleX; ao[playerid][index][ao_sy] = fScaleY; ao[playerid][index][ao_sz] = fScaleZ; } else { SendClientMessage(playerid, COLOR_RED, "Édition abandonnée."); new i = index; SetPlayerAttachedObject(playerid, index, modelid, boneid, ao[playerid][i][ao_x], ao[playerid][i][ao_y], ao[playerid][i][ao_z], ao[playerid][i][ao_rx], ao[playerid][i][ao_ry], ao[playerid][i][ao_rz], ao[playerid][i][ao_sx], ao[playerid][i][ao_sy], ao[playerid][i][ao_sz]); } return 1; } ``` ## Astuces :::warning L'édition doit être abandonnée si la réponse est '0' (cancelled). Cela doit être fait par le stockage des offsets au préalable dans un array. ::: ## Fonctions connexes - [EditAttachedObject](../functions/EditAttachedObject): Édition d'un attach object. - [SetPlayerAttachedObject](../functions/SetPlayerAttachedObject): Attache un objet à un joueur.
openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnPlayerEditAttachedObject.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnPlayerEditAttachedObject.md", "repo_id": "openmultiplayer", "token_count": 2151 }
406
--- title: OnPlayerObjectMoved description: Cette callback est appelée quand l'objet d'un joueur a été déplacé après un MovePlayerObject (quand l'objet s'arrête de bouger). tags: ["player"] --- ## Paramètres Cette callback est appelée quand l'objet d'un joueur a été déplacé après un MovePlayerObject _(quand l'objet s'arrête de bouger)_. | Nom | Description | | -------------- | -------------------------------------------- | | `int` playerid | L'ID du joueur auquel l'objet est assigné | | `int` objectid | L'ID de l'objet du joueur qui a été déplacé | ## Valeur de retour Cette callback ne retourne pas de valeur spécifique, mais doit retourner quelque chose. Autrement dit, `return callback();` ne fonctionnera pas car la callback ne retourne rien, mais un return _(`return 1;` ou `return 0;`)_ doit être effectué dans la callback. ## Exemple ```c public OnPlayerObjectMoved(playerid, objectid) { printf("Objet d'un joueur déplacé : objectid: %d playerid: %d", objectid, playerid); return 1; } ``` ## Astuces :::tip Cette callback peut aussi être utilisée pour les NPC. ::: ## Fonctions connexes - [MovePlayerObject](../functions/MovePlayerObject): Déplace l'objet d'un joueur. - [IsPlayerObjectMoving](../functions/IsPlayerObjectMoving): Vérfiie si l'objet d'un joueur se déplace. - [StopPlayerObject](../functions/StopPlayerObject): Arrête le mouvement de l'objet d'un joueur. - [CreatePlayerObject](../functions/CreatePlayerObject): Créer un objet seulement pour un joueur. - [DestroyPlayerObject](../functions/DestroyPlayerObject): Détruit l'objet d'un joueur.
openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnPlayerObjectMoved.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnPlayerObjectMoved.md", "repo_id": "openmultiplayer", "token_count": 630 }
407
--- title: OnPlayerUpdate description: Cette callback est appelée à chaque fois qu'un client/joueur modifie son status auprès du serveur. tags: ["player"] --- ## Paramètres Cette callback est appelée à chaque fois qu'un client/joueur modifie son status auprès du serveur. Elle est souvent utilisée pour créer des callbacks personnalisées qui ne sont pas présentes nativement, telle que le changement de vie, d'armure ou le changement d'arme. | Nom | Description | | -------------- | --------------------------------------------- | | `int` playerid |ID du joueur ayant envoyé un paquet au serveur | ## Valeur de retour **0** - La mise à jour du joueur ne sera pas appliquée aux autres joueurs. **1** - Indique que la mise à jour peut être traité de façon normale et envoyé aux autres joueurs. ## Exemples ```c public OnPlayerUpdate(playerid) { new iCurWeap = GetPlayerWeapon(playerid); // Retourne l'arme actuelle du joueur if(iCurWeap != GetPVarInt(playerid, "iCurrentWeapon")) // S'il l'arme à changer depuis la dernière mise à jour { // Appelons une callback nommée OnPlayerChangeWeapon OnPlayerChangeWeapon(playerid, GetPVarInt(playerid, "iCurrentWeapon"), iCurWeap); SetPVarInt(playerid, "iCurrentWeapon", iCurWeap);//Met à jour la variable arme du joueur } return 1; // Envoi de la mise à jour à tous les joueurs. } stock OnPlayerChangeWeapon(playerid, oldweapon, newweapon) { new s[128], oWeapon[24], nWeapon[24]; GetWeaponName(oldweapon, oWeapon, sizeof(oWeapon)); GetWeaponName(newweapon, nWeapon, sizeof(nWeapon)); format(s, sizeof(s), "Vous avez changé votre arme de %s à %s!", oWeapon, nWeapon); SendClientMessage(playerid, 0xFFFFFFFF, s); } ``` ```c public OnPlayerUpdate(playerid) { new Float:fHealth; GetPlayerHealth(playerid, fHealth); if(fHealth != GetPVarFloat(playerid, "faPlayerHealth")) { // La vie du joueur a changé depuis la dernière mise à jour, c'est donc bien la mise à jour qui a été envoyée. // Vérifions s'il a perdu ou gagné de la vie (anti-cheat vie ? ;)) if(fHealth > GetPVarFloat(playerid, "faPlayerHealth")) { /* Il a gagné de la vie! Triche? */ } else { /* Il a perdu de la vie! */ } SetPVarFloat(playerid, "faPlayerHealth", fHealth); } } ``` ## Astuces <TipNPCCallbacks /> :::warning Cette callback est appelée environ 30 fois par secondes, par joueur; à utiliser seulement quand vous savez exactement pourquoi. La fréquence à laquelle est appelée cette callback varie en fonction des joueurs, dépendant de ce que fait le joueur. La fréquence d'appel sera plus élevé quand le joueur conduira, tirera alors qu'elle sera plus basse quand le joueur sera statique. ::: ## Fonctions connexes
openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnPlayerUpdate.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnPlayerUpdate.md", "repo_id": "openmultiplayer", "token_count": 1129 }
408
--- title: OnVehicleStreamOut description: Cette callback est appelé quand un véhicule disparait du champs de stream du joueur (le véhicule est tellement loin qu'il ne peut plus le voir). tags: ["vehicle"] --- ## Paramètres Cette callback est appelé quand un véhicule disparait du champs de stream du joueur (le véhicule est tellement loin qu'il ne peut plus le voir). | Nom | Description | | ----------------- | --------------------------------------------------------------- | | `int` vehicleid | L'ID du véhicule qui n'est plus stream pour le joueur concerné. | | `int` forplayerid | Le joueur dont le véhicule n'est plus stream. | ## Valeur de retour Cette callback ne retourne rien, mais doit retourner quelque chose. Autrement dit, `return callback();` ne fonctionnera pas car la callback ne retourne rien, mais un return _(`return 1;` ou `return 0;`)_ doit être effectué dans la callback. ## Exemple ```c public OnVehicleStreamOut(vehicleid, forplayerid) { new string[48]; format(string, sizeof(string), "Vous ne voyez plus le véhicule %d car celui-ci est trop loin.", vehicleid); SendClientMessage(forplayerid, 0xFFFFFFFF, string); return 1; } ``` ## Astuces <TipNPCCallbacks /> ## Fonctions connexes
openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnVehicleStreamOut.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnVehicleStreamOut.md", "repo_id": "openmultiplayer", "token_count": 515 }
409
--- title: OnGameModeInit description: Ez a visszahívás akkor indul el, amikor a játékmód elindul. tags: [] --- ## Leírás Ez a visszahívás akkor indul el, amikor a játékmód elindul. ## Példák ```c public OnGameModeInit() { print("Játékmód elindítva!"); return 1; } ``` ## Megjegyzések :::tip Ezt a funkciót egy filterszkriptben is fel lehet használni, hogy érzékelje, ha a gamemode változik az RCON parancsokkal, például a changemode vagy a gmx, mivel a gamemode megváltoztatása nem tölti be újra a filtercriptet. ::: ## Kapcsolodó visszhívások Ezek a visszahívások hasznosak lehetnek mivel valamilyen módon kapcsolódik ehhez a visszahíváshoz. - [OnGameModeExit](OnGameModeExit): Ezt a visszahívást akkor hívja meg amikor egy játékmód leáll. - [OnFilterScriptInit](OnFilterScriptInit): Ezt a visszahívást akkor hívja meg amikor egy filterszkript elindul. - [OnFilterSciptExit](OnFilterScriptExit): Ezt a visszahívást akkor hívja meg amikor egy filterszkript leáll.
openmultiplayer/web/docs/translations/hu/scripting/callbacks/OnGameModeInit.md/0
{ "file_path": "openmultiplayer/web/docs/translations/hu/scripting/callbacks/OnGameModeInit.md", "repo_id": "openmultiplayer", "token_count": 471 }
410
--- title: OnEnterExitModShop description: Callback ini akan terpanggil ketika pemain memasuki atau keluar dari mod shop. tags: [] --- ## Deskripsi Callback ini akan terpanggil ketika pemain memasuki atau keluar dari mod shop. | Nama | Deskripsi | | ---------- | ---------------------------------------------------------------- | | playerid | ID dari pemain yang masuk atau keluar dari modshop | | enterexit | 1 jika pemain masuk 0 jika player keluar | | interiorid | ID Interior dari modshop yang pemain masuki (atau 0 jika keluar) | ## Returns Ini akan selalu terpanggil pertama di filterscripts ## Contoh ```c public OnEnterExitModShop(playerid, enterexit, interiorid) { if(enterexit == 0) // Jika enterexit bernilai 0, tandanya mereka sudah keluar { SendClientMessage(playerid, COLOR_WHITE, "Keren abiez kendaraannya! tapi kena pajak $100 jiahahaha."); GivePlayerMoney(playerid, -100); } return 1; } ``` ## Catatan :::warning Bug yang dikenal: Pemain akan menyatu ketika berada di dalam mod shop yang sama. ::: ## Fungsi Terkait - [AddVehicleComponent](../functions/AddVehicleComponent.md): Menambahkan komponen ke kendaraan.
openmultiplayer/web/docs/translations/id/scripting/callbacks/OnEnterExitModShop.md/0
{ "file_path": "openmultiplayer/web/docs/translations/id/scripting/callbacks/OnEnterExitModShop.md", "repo_id": "openmultiplayer", "token_count": 543 }
411
--- title: OnPlayerEnterCheckpoint description: Callback ini terpanggil ketika seorang pemain memasuki checkpoint untuk pemain itu. tags: ["player", "checkpoint"] --- ## Deskripsi Callback ini terpanggil ketika seorang pemain memasuki checkpoint untuk pemain itu. | Nama | Deskripsi | | -------- | ---------------------------------- | | playerid | ID pemain yang memasuki checkpoint | ## Returns Selalu terpanggil pertama di filterscript. ## Contoh ```c // Dalam contoh ini, sebuah checkpoint dibuat untuk pemain saat spawn, // yang membuat kendaraan dan menonaktifkan checkpoint. public OnPlayerSpawn(playerid) { SetPlayerCheckpoint(playerid, 1982.6150, -220.6680, -0.2432, 3.0); return 1; } public OnPlayerEnterCheckpoint(playerid) { CreateVehicle(520, 1982.6150, -221.0145, -0.2432, 82.2873, -1, -1, 60000); DisablePlayerCheckpoint(playerid); return 1; } ``` ## Catatan <TipNPCCallbacks /> ## Fungsi Terkait - [SetPlayerCheckpoint](../functions/SetPlayerCheckpoint): Membuat sebuah checkpoint untuk pemain. - [DisablePlayerCheckpoint](../functions/DisablePlayerCheckpoint): Menonaktifkan checkpoint pemain saat ini. - [IsPlayerInCheckpoint](../functions/IsPlayerInRaceCheckpoint): Memeriksa apakah pemain berada di dalam checkpoint. - [SetPlayerRaceCheckpoint](../functions/SetPlayerRaceCheckpoint): Membuat sebuah checkpoint balapan untuk pemain. - [DisablePlayerRaceCheckpoint](../functions/DisablePlayerRaceCheckpoint): Menonaktifkan checkpoint balapan pemain saat ini. - [IsPlayerInRaceCheckpoint](../functions/IsPlayerInRaceCheckpoint): Memeriksa apakah pemain berada di dalam checkpoint balapan.
openmultiplayer/web/docs/translations/id/scripting/callbacks/OnPlayerEnterCheckpoint.md/0
{ "file_path": "openmultiplayer/web/docs/translations/id/scripting/callbacks/OnPlayerEnterCheckpoint.md", "repo_id": "openmultiplayer", "token_count": 588 }
412
--- title: AddSimpleModel description: Menambahkan sebuah simpel objek model untuk diunggah. tags: [] --- <VersionWarn version='SA-MP 0.3.DL R1' /> ## Description Menambahkan model simpel kustom objek diunggah. Model file bawaanya terletak pada folder Documents\GTA San Andreas User Files\SAMP\cache milik player bernama IP dan PORT dalam bentuk nama CRC. | Name | Description | | ------------ | --------------------------------------------------------------------------------------------------------------------------- | | virtualworld | Virtual world ID untuk membuat model tersedia. Gunakan -1 untuk semua world. | | baseid | Basis object model ID untuk digunakan (object original akan digunakan jika download gagal). | | newid | Object model ID baru berkisar dari -1000 ke -30000 (29000 slots) digunakan nanti dengan CreateObject atau Create PlayerObject| | dffname | Nama dari .dff model file collision berlokasi di models server folder secara bawaan (artpath setting). | | txdname | Nama dari .txd model tekstur file berlokasi di models server secara bawaan (artpath setting. | ## Returns 1: Function berhasil dijalankan. 0: Function gagal dijalankan ## Examples ```c public OnGameModeInit() { AddSimpleModel(-1, 19379, -2000, "wallzzz.dff", "wallzzz.txd"); return 1; } ``` ```c AddSimpleModel(-1, 19379, -2000, "wallzzz.dff", "wallzzz.txd"); ``` ## Notes :::tip `useartwork` harus diaktifkan terlebih dahulu dalam pengaturan server agar dapat berfungsi ketika virtualworld diatur, model akan didownload setelah player memasuki world tertentu ::: :::warning Saat ini tidak ada batasan kapan Anda dapat memanggil fungsi ini, tetapi perhatikan bahwa jika Anda tidak memanggilnya di dalam OnFilterScriptInit/OnGameModeInit, Anda berisiko bahwa beberapa player, yang sudah ada di server, mungkin belum mendownload modelnya. ::: ## Related Functions - [OnPlayerFinishedDownloading](../callbacks/OnPlayerFinishedDownloading): Dipanggil jika player sudah mendownload custom models.
openmultiplayer/web/docs/translations/id/scripting/functions/AddSimpleModel.md/0
{ "file_path": "openmultiplayer/web/docs/translations/id/scripting/functions/AddSimpleModel.md", "repo_id": "openmultiplayer", "token_count": 935 }
413
--- title: SetVehicleNumberPlate description: Set plat nomor kendaraan. tags: ["vehicle"] --- ## Deskripsi Set plat nomor kendaraan. | Nama | Deskripsi | | ----------- | ------------------------------------------------------ | | vehicleid | ID kendaraan yang ingin di ubah plat nomornya | | numberplate | Teks yang harus ditampilkan pada plat nomor. | ## Returns 1: Fungsi berhasil dijalankan. 0: Fungsi gagal dijalankan. Ini berarti kendaraan tidak ada. ## Contoh ```c new vehicleid = CreateVehicle(542, 2074.73, 1089.89, 10.51, 0.0, -1, -1, -1); SetVehicleNumberPlate(vehicleid, "ABCD 123"); ``` ## Catatan :::tip Fungsi ini tidak memiliki pemeriksaan kesalahan internal. Jangan menetapkan plat nomor khusus untuk kendaraan tanpa plat (kapal, pesawat, dll) karena ini akan menghasilkan beberapa waktu pemrosesan yang tidak perlu pada client. Kendaraan harus spawn kembali atau stream ulang agar perubahan berlaku. Ada batas 32 karakter pada setiap plat nomor (termasuk warna tertanam). Panjang teks yang dapat dilihat pada plat nomor adalah sekitar 9 hingga 10 karakter, lebih banyak karakter akan menyebabkan teks terpotong. Beberapa model kendaraan memiliki plat nomor mundur, misalnya Boxville (498) (sebagai alternatif untuk kendaraan ini Anda dapat menggunakan model kendaraan ID 609, yang merupakan Boxville duplikat (alias Boxburg), tetapi dengan plat nomor biasa). ::: :::tip kamu dapat memberikan warna pada plat nomor. ::: ## Fungsi terkait - [SetVehicleToRespawn](SetVehicleToRespawn): Respawn kendaraan. - [ChangeVehicleColor](ChangeVehicleColor): Set warna pada kendaraan. - [ChangeVehiclePaintjob](ChangeVehiclePaintjob): Merubah paintjob pada kendaraan.
openmultiplayer/web/docs/translations/id/scripting/functions/SetVehicleNumberPlate.md/0
{ "file_path": "openmultiplayer/web/docs/translations/id/scripting/functions/SetVehicleNumberPlate.md", "repo_id": "openmultiplayer", "token_count": 697 }
414
--- id: damagestatus title: Status Kerusakan description: Informasi tentang status kerusakan pada kendaraan dan contoh kodenya. --- :::note ID ini untuk digunakan dengan [GetVehicleDamageStatus](../functions/GetVehicleDamageStatus) dan [UpdateVehicleDamageStatus](../functions/UpdateVehicleDamageStatus). ::: Kerusakan kendaraan disimpan dalam 4 nilai: **Panel**, **Pintu**, **Lampu**, dan **Ban**. Setiap nilai disimpan dalam bentuk bit dari keadaan semua panel, pintu, lampu, dan ban. Artinya, Anda memerlukan operator bitwise untuk mengoperasikannya (setiap waktu). Sebagai contohnya, status ban menyimpan 4 bit untuk 4 ban. Nilainya bernilai 1 jika bannya pecah (kempes), dan 0 jika bannya tidak pecah (kempes). Jadi, sebagai contohnya, arti nilai dari `1010` adalah kedua ban depan pecah (kempes), sedangkan kedua ban belakangnya tidak pecah (kempes). :::note Untuk informasi selebihnya mengenai keadaan panel, lihat [Keadaan Panel](../resources/panelstates). Untuk informasi selebihnya mengenai keadaan pintu, lihat [Keadaan Pintu](../resources/doorstates). Untuk informasi selebihnya mengenai keadaan lampu, lihat [Keadaan Lampu](../resources/lightstates). Untuk informasi selebihnya mengenai keadaan ban, lihat [Keadaan Ban](../resources/tirestates). ::: Untuk membuatnya jadi lebih mudah, ada beberapa fungsi untuk _encode_ dan _decode_ di bawah ini. ```c // Panel decode_panels(panels, &front_left_panel, &front_right_panel, &rear_left_panel, &rear_right_panel, &windshield, &front_bumper, &rear_bumper) { front_left_panel = panels & 15; front_right_panel = panels >> 4 & 15; rear_left_panel = panels >> 8 & 15; rear_right_panel = panels >> 12 & 15; windshield = panels >> 16 & 15; front_bumper = panels >> 20 & 15; rear_bumper = panels >> 24 & 15; } encode_panels(front_left_panel, front_right_panel, rear_left_panel, rear_right_panel, windshield, front_bumper, rear_bumper) { return front_left_panel | (front_right_panel << 4) | (rear_left_panel << 8) | (rear_right_panel << 12) | (windshield << 16) | (front_bumper << 20) | (rear_bumper << 24); } // Pintu decode_doors(doors, &bonnet, &boot, &driver_door, &passenger_door) { bonnet = doors & 7; boot = doors >> 8 & 7; driver_door = doors >> 16 & 7; passenger_door = doors >> 24 & 7; } encode_doors(bonnet, boot, driver_door, passenger_door) { return bonnet | (boot << 8) | (driver_door << 16) | (passenger_door << 24); } // Lampu decode_lights(lights, &front_left_light, &front_right_light, &back_lights) { front_left_light = lights & 1; front_right_light = lights >> 2 & 1; back_lights = lights >> 6 & 1; } encode_lights(front_left_light, front_right_light, back_lights) { return front_left_light | (front_right_light << 2) | (back_lights << 6); } // Ban decode_tires(tires, &rear_right_tire, &front_right_tire, &rear_left_tire, &front_left_tire) { rear_right_tire = tires & 1; front_right_tire = tires >> 1 & 1; rear_left_tire = tires >> 2 & 1; front_left_tire = tires >> 3 & 1; } encode_tires(rear_right_tire, front_right_tire, rear_left_tire, front_left_tire) { return rear_right_tire | (front_right_tire << 1) | (rear_left_tire << 2) | (front_left_tire << 3); } ```
openmultiplayer/web/docs/translations/id/scripting/resources/damagestatus.md/0
{ "file_path": "openmultiplayer/web/docs/translations/id/scripting/resources/damagestatus.md", "repo_id": "openmultiplayer", "token_count": 1296 }
415
--- id: vehiclecolorid title: Vehicle Color IDs description: Informasi tentang ID warna kendaraan. --- :::danger Mulai dari SA-MP 0.3x, informasi ini sudah usang. ID warna kendaraan dari 128 hingga 255 diganti dengan warna baru secara sengaja. Periksa gambar ke-dua untuk warna terbaru di 0.3x. ::: ![image1](/images/vehicleColorIds/Carcolours_All.jpg) ## Warna yang ditambahkan di 0.3x ![image2](/images/vehicleColorIds/Ext_vcolours_2013.jpg) ```c new VehicleColoursTableRGBA[256] = { // Warna yang tersedia di SA-MP 0x000000FF, 0xF5F5F5FF, 0x2A77A1FF, 0x840410FF, 0x263739FF, 0x86446EFF, 0xD78E10FF, 0x4C75B7FF, 0xBDBEC6FF, 0x5E7072FF, 0x46597AFF, 0x656A79FF, 0x5D7E8DFF, 0x58595AFF, 0xD6DAD6FF, 0x9CA1A3FF, 0x335F3FFF, 0x730E1AFF, 0x7B0A2AFF, 0x9F9D94FF, 0x3B4E78FF, 0x732E3EFF, 0x691E3BFF, 0x96918CFF, 0x515459FF, 0x3F3E45FF, 0xA5A9A7FF, 0x635C5AFF, 0x3D4A68FF, 0x979592FF, 0x421F21FF, 0x5F272BFF, 0x8494ABFF, 0x767B7CFF, 0x646464FF, 0x5A5752FF, 0x252527FF, 0x2D3A35FF, 0x93A396FF, 0x6D7A88FF, 0x221918FF, 0x6F675FFF, 0x7C1C2AFF, 0x5F0A15FF, 0x193826FF, 0x5D1B20FF, 0x9D9872FF, 0x7A7560FF, 0x989586FF, 0xADB0B0FF, 0x848988FF, 0x304F45FF, 0x4D6268FF, 0x162248FF, 0x272F4BFF, 0x7D6256FF, 0x9EA4ABFF, 0x9C8D71FF, 0x6D1822FF, 0x4E6881FF, 0x9C9C98FF, 0x917347FF, 0x661C26FF, 0x949D9FFF, 0xA4A7A5FF, 0x8E8C46FF, 0x341A1EFF, 0x6A7A8CFF, 0xAAAD8EFF, 0xAB988FFF, 0x851F2EFF, 0x6F8297FF, 0x585853FF, 0x9AA790FF, 0x601A23FF, 0x20202CFF, 0xA4A096FF, 0xAA9D84FF, 0x78222BFF, 0x0E316DFF, 0x722A3FFF, 0x7B715EFF, 0x741D28FF, 0x1E2E32FF, 0x4D322FFF, 0x7C1B44FF, 0x2E5B20FF, 0x395A83FF, 0x6D2837FF, 0xA7A28FFF, 0xAFB1B1FF, 0x364155FF, 0x6D6C6EFF, 0x0F6A89FF, 0x204B6BFF, 0x2B3E57FF, 0x9B9F9DFF, 0x6C8495FF, 0x4D8495FF, 0xAE9B7FFF, 0x406C8FFF, 0x1F253BFF, 0xAB9276FF, 0x134573FF, 0x96816CFF, 0x64686AFF, 0x105082FF, 0xA19983FF, 0x385694FF, 0x525661FF, 0x7F6956FF, 0x8C929AFF, 0x596E87FF, 0x473532FF, 0x44624FFF, 0x730A27FF, 0x223457FF, 0x640D1BFF, 0xA3ADC6FF, 0x695853FF, 0x9B8B80FF, 0x620B1CFF, 0x5B5D5EFF, 0x624428FF, 0x731827FF, 0x1B376DFF, 0xEC6AAEFF, 0x000000FF, // Perluasan warna SA-MP (0.3x) 0x177517FF, 0x210606FF, 0x125478FF, 0x452A0DFF, 0x571E1EFF, 0x010701FF, 0x25225AFF, 0x2C89AAFF, 0x8A4DBDFF, 0x35963AFF, 0xB7B7B7FF, 0x464C8DFF, 0x84888CFF, 0x817867FF, 0x817A26FF, 0x6A506FFF, 0x583E6FFF, 0x8CB972FF, 0x824F78FF, 0x6D276AFF, 0x1E1D13FF, 0x1E1306FF, 0x1F2518FF, 0x2C4531FF, 0x1E4C99FF, 0x2E5F43FF, 0x1E9948FF, 0x1E9999FF, 0x999976FF, 0x7C8499FF, 0x992E1EFF, 0x2C1E08FF, 0x142407FF, 0x993E4DFF, 0x1E4C99FF, 0x198181FF, 0x1A292AFF, 0x16616FFF, 0x1B6687FF, 0x6C3F99FF, 0x481A0EFF, 0x7A7399FF, 0x746D99FF, 0x53387EFF, 0x222407FF, 0x3E190CFF, 0x46210EFF, 0x991E1EFF, 0x8D4C8DFF, 0x805B80FF, 0x7B3E7EFF, 0x3C1737FF, 0x733517FF, 0x781818FF, 0x83341AFF, 0x8E2F1CFF, 0x7E3E53FF, 0x7C6D7CFF, 0x020C02FF, 0x072407FF, 0x163012FF, 0x16301BFF, 0x642B4FFF, 0x368452FF, 0x999590FF, 0x818D96FF, 0x99991EFF, 0x7F994CFF, 0x839292FF, 0x788222FF, 0x2B3C99FF, 0x3A3A0BFF, 0x8A794EFF, 0x0E1F49FF, 0x15371CFF, 0x15273AFF, 0x375775FF, 0x060820FF, 0x071326FF, 0x20394BFF, 0x2C5089FF, 0x15426CFF, 0x103250FF, 0x241663FF, 0x692015FF, 0x8C8D94FF, 0x516013FF, 0x090F02FF, 0x8C573AFF, 0x52888EFF, 0x995C52FF, 0x99581EFF, 0x993A63FF, 0x998F4EFF, 0x99311EFF, 0x0D1842FF, 0x521E1EFF, 0x42420DFF, 0x4C991EFF, 0x082A1DFF, 0x96821DFF, 0x197F19FF, 0x3B141FFF, 0x745217FF, 0x893F8DFF, 0x7E1A6CFF, 0x0B370BFF, 0x27450DFF, 0x071F24FF, 0x784573FF, 0x8A653AFF, 0x732617FF, 0x319490FF, 0x56941DFF, 0x59163DFF, 0x1B8A2FFF, 0x38160BFF, 0x041804FF, 0x355D8EFF, 0x2E3F5BFF, 0x561A28FF, 0x4E0E27FF, 0x706C67FF, 0x3B3E42FF, 0x2E2D33FF, 0x7B7E7DFF, 0x4A4442FF, 0x28344EFF }; ```
openmultiplayer/web/docs/translations/id/scripting/resources/vehiclecolorid.md/0
{ "file_path": "openmultiplayer/web/docs/translations/id/scripting/resources/vehiclecolorid.md", "repo_id": "openmultiplayer", "token_count": 2330 }
416
--- title: AddVehicleComponent description: Dodaje „komponent” (część tuningową) do pojazdu. tags: ["vehicle"] --- ## Opis Dodaje „komponent” (część tuningową) do pojazdu. Listę komponentów znajdziesz poniżej. | Nazwa | Opis | | --------------------------------------------- | ---------------------------------------------------------------------------- | | vehicleid | ID pojazdu, w którym komponent ma zostać zamontowany. Nie mylić z ID modelu. | | [componentid](../resources/carcomponentid.md) | ID komponentu, który ma zostać zamontowany w pojeździe. | ## Zwracane wartości 0 - Komponent nie został zamontowany, ponieważ pojazd nie istnieje. 1 - Komponent został pomyślnie zamontowany w pojeździe. ## Przykłady ```c new gTaxi; public OnGameModeInit() { gTaxi = AddStaticVehicle(420, -2482.4937, 2242.3936, 4.6225, 179.3656, 6, 1); // Taxi return 1; } public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstate) { if (newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT) { if (GetPlayerVehicleID(playerid) == gTaxi) { AddVehicleComponent(gTaxi, 1010); // Nitro SendClientMessage(playerid, 0xFFFFFFAA, "Nitro zostało zamontowane w taksówce."); } } return 1; } ``` ## Uwagi :::warning Użycie nieprawidłwego ID komponentu powoduje zcrashowanie klienta. Nie ma żadnych dodatkowych zabezpieczeń na to. ::: ## Powiązane funkcje - [RemoveVehicleComponent](RemoveVehicleComponent.md): Usuwa komponent z pojazdu. - [GetVehicleComponentInSlot](GetVehicleComponentInSlot.md): Sprawdza, jakie komponenty pojazd posiada. - [GetVehicleComponentType](GetVehicleComponentType.md): Sprawdza typ komponentu po ID. - [OnVehicleMod](../callbacks/OnVehicleMod.md): Wywoływane, kiedy pojazd jest tuningowany. - [OnEnterExitModShop](../callbacks/OnEnterExitModShop.md): Wywoływane, gdy pojazd wjedzie lub wyjedzie z warsztatu tuningowego.
openmultiplayer/web/docs/translations/pl/scripting/functions/AddVehicleComponent.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pl/scripting/functions/AddVehicleComponent.md", "repo_id": "openmultiplayer", "token_count": 1006 }
417
--- title: asin description: . tags: [] --- <LowercaseNote /> ## Opis Podaje odwróconą wartość arcus sinusa w radianach. | Nazwa | Opis | | ----------- | ----------- | | Float:value | Arcus sinus | ## Zwracane wartości Wartość, której arcus sinus został obliczony, w przedziale [-1,+1]. Jeżeli argument jest spoza tego przedziału, występuje błąd. ## Przykłady ```c //Arcus sinus dla 0.500000 wynosi 30.000000 stopni. public OnGameModeInit() { new Float:param, Float:result; param = 0.5; result = asin(param); printf("Arcus sinus dla %f wynosi %f stopni.", param, result); return 1; } ``` ## Related Functions - [floatsin](floatsin.md): Podaje sinus dla określonego kąta. - [floatcos](floatcos.md): Podaje cosinus dla określonego kąta. - [floattan](floattan.md): Podaje tangens dla określonego kąta.
openmultiplayer/web/docs/translations/pl/scripting/functions/asin.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pl/scripting/functions/asin.md", "repo_id": "openmultiplayer", "token_count": 391 }
418
--- title: OnFilterScriptExit description: Esta callback é chamada quando um filterscript é descarregado. tags: [] --- ## Descrição Esta callback é chamada quando um filterscript é descarregado. É apenas chamado dentro do filterscript que descarregou. ## Exemplos ```c public OnFilterScriptExit() { print("\n--------------------------------------"); print("Meu Filterscript descarregou"); print("--------------------------------------\n"); return 1; } ``` ## Funções Relacionadas
openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnFilterScriptExit.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnFilterScriptExit.md", "repo_id": "openmultiplayer", "token_count": 162 }
419
--- title: OnPlayerClickTextDraw description: Esta callback é chamada quando um jogador clica em uma textdraw ou cancela a seleção pressionando ESC. tags: ["player", "textdraw"] --- ## Descrição Esta callback é chamada quando um jogador clica em uma textdraw ou cancela a seleção pressionando ESC. | Nome | Descrição | | --------- | ------------------------------------------------------------------------------------ | | playerid | O ID do jogador que clicou na TextDraw | | clickedid | O ID da TextDraw que recebeu o clique. INVALID_TEXT_DRAW Se a seleção for cancelada. | ## Retorno 1 - Irá previnir que outro filterscript receba esta callback. 0 - Indica que esta callback será passada para o próximo filterscript. Sempre é chamada primeiro em filterscripts. ## Exemplos ```c new Text:gTextDraw; public OnGameModeInit() { gTextDraw = TextDrawCreate(10.000000, 141.000000, "MinhaTXD"); TextDrawTextSize(gTextDraw,60.000000, 20.000000); TextDrawAlignment(gTextDraw,0); TextDrawBackgroundColor(gTextDraw,0x000000ff); TextDrawFont(gTextDraw,1); TextDrawLetterSize(gTextDraw,0.250000, 1.000000); TextDrawColor(gTextDraw,0xffffffff); TextDrawSetProportional(gTextDraw,1); TextDrawSetShadow(gTextDraw,1); TextDrawSetSelectable(gTextDraw, 1); return 1; } public OnPlayerKeyStateChange(playerid, KEY:newkeys, KEY:oldkeys) { if (newkeys == KEY_SUBMISSION) { TextDrawShowForPlayer(playerid, gTextDraw); SelectTextDraw(playerid, 0xFF4040AA); } return 1; } public OnPlayerClickTextDraw(playerid, Text:clickedid) { if (clickedid == gTextDraw) { SendClientMessage(playerid, 0xFFFFFFAA, "Você clicou em uma textdraw."); CancelSelectTextDraw(playerid); return 1; } return 0; } ``` ## Notas :::warning A área 'clicável' é definida pelo TextDrawTextSize. Os parâmetros de X e Y passados pela função não devem ser "0" ou negativo. Não utilize CancelSelectTextDraw incondicionalmente dentro desta callback. Isso resultaria em um loop infinito. ::: ## Funções Relacionadas - [OnPlayerClickPlayerTextDraw](OnPlayerClickPlayerTextDraw.md): Chamado quando o jogador clica em uma player-textdraw. - [OnPlayerClickPlayer](OnPlayerClickPlayer.md): Chamado quando um jogador clica em outro.
openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnPlayerClickTextDraw.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnPlayerClickTextDraw.md", "repo_id": "openmultiplayer", "token_count": 978 }
420
--- title: OnPlayerKeyStateChange description: Esta callback é chamada quando o estado de qualquer tecla suportada muda (pressionado/solto) tags: ["player"] --- ## Descrição Esta callback é chamada quando o estado de qualquer tecla [suportada](../resources/keys.md) muda. (pressionado/solto). Teclas direcionais não ativam o OnPlayerKeyStateChange (Para cima, baixo, direita, esquerda). | Nome | Descrição | | -------- | --------------------------------------------------------------------------------------------- | | playerid | O ID do jogador que pressionou ou soltou uma tecla. | | newkeys | Um mapa (bitmask) das teclas atualmente pressionadas - [veja aqui](../resources/keys.md) | | oldkeys | Um mapa (bitmask) das teclas pressionadas antes da atual - [veja aqui](../resources/keys.md). | ## Retornos - Esta callback não suporta retornos. - Sempre é chamado primeiro na gamemode. ## Notas <TipNPCCallbacksPT /> :::tip Teclas direcionais não ativam o OnPlayerKeyStateChange (Para cima, baixo, direita, esquerda). Estas podem apenas ser identificadas pelo [GetPlayerKeys](../functions/GetPlayerKeys.md) no [OnPlayerUpdate](../callbacks/OnPlayerUpdate.md) ou em um teporizador. ::: ## Funções Relaciondas - [GetPlayerKeys](../functions/GetPlayerKeys.md): Verifica qual tecla o jogador está pressionando. ## Informação Adicional ### Introdução Esta callback é chamada sempre que um jogador pressionar ou soltar uma das teclas suportadas como dito acima. As teclas suportadas não são exatamente teclas do teclado, mas sim, teclas mapeadas do San Andreas, isso significa que, por exemplo, você não pode detectar quando alguém pressiona a tecla espaço, mas pode detecar quando alguém pressiona a "sprint key" (botão de correr, que pode ou não estar definido para o espaço, pois é o padrão). ### Parâmetros Os parâmetros desta função é uma lista de todoas as teclas que estão sendo pressionadas e de todas as teclas que foram pressionadas até o momento. Esta callback é chamada quando o estado da tecla muda (pressionada/solta) e passa os estados de todas a teclas. Isso pode ser usado para ver o que exatamente acontece, pois as variáveis não podem ser usadas diretamente como ocorre com os parâmetros de outras funções, para reduzir o número de variávies um único BIT é utilizado para representar a tecla, isso significa que uma variável pode conter múltiplas teclas, então comparar os valores nem sempre irá funcionar. ### Como não verificar uma tecla Vamos presumir que você deseja detectar quando um jogador pressiona o botão FIRE (de atirar), o código óbbio seria: ```c if (newkeys == KEY_FIRE) ``` Este código pode funcionar no seu teste, mas está errado e seu teste é insuficiente. Tente agaixar e atirar, o seu código irá para de funcionar instantaneamente. Por que? pois "newkeys" não é mais "KEY_FIRE", agora é o mesmo que "KEY_FIRE" junto de "KEY_CROUCH" (tecla para abaixar). ### Como verificar uma tecla corretamente Então, se a variável pode conter múltiplas teclas, de uma vez, como você verifica por uma única tecla? Cada tecla contém seu única bit na variável (algumas teclas contém o mesmo bit, mas são teclas a pé/veículo, então não podem ser pressionadas ao mesmo tempo de qualquer maneira) e você precisa verificar por aquele determinado e único bit: ```c if (newkeys & KEY_FIRE) ``` Note that the single <strong>&</strong> is correct - this is a bitwise AND, not a logical AND, which is what the two ampersands are called. Note que o <strong>&</strong> sozinho está correto, este é um AND bitwise e não um AND lógico. Agora se testar o código irá funcionar, mesmo se agaixar ou levantar e pressionar a tecla de atirar. Entretanto, ainda há um pequeno problema, irá atirar desde que você esteja pressionando a tecla. OnPlayerKeyStateChange é chamado sempre que uma tecla muda, e aquele código é verdadeire sempre que a botão de atirar e pressionado. Se você pressionar "fire" o código será chamado, porém se essa tecla estiver pressionada e você pressionar a tecla para agaixar o código será chamda de novo, pois pressinou a tecla para agaixar. Como detectar quando uma tecla é PRIMEIRAMENTE pressionada mas não chamada novamente quando pressionada e segurada e outra tecla é pressionada? ### Como verificar uma tecla que foi pressionada Aqui é onde o "oldkeys" entra. Para verificar se uma tecla acabou de ser pressionada você precisa primeiramente verificar se ela está no "newkeys", isso quer dizer que está pressionada, e verificar se não está no "oldkeys", isso quer dizer que apenas foi pressionada e segurada, o código a seguir exemplifica isso: ```c if ((newkeys & KEY_FIRE) && !(oldkeys & KEY_FIRE)) ``` Será verdadeiro quando a tecla "fire" for primeiramente pressionada, não quando é pressionada e segurada e outra tecla muda. ### Como verificar por uma tecla que está sendo pressionada O mesmo princípio que o visto acima, porém invertido: ```c if ((oldkeys & KEY_FIRE) && !(newkeys & KEY_FIRE)) ``` ### Como verificar por múltiplas teclas Se quer verificar se o jogador está pressionando "crouch" e "fire" então o código a seguir funcionará: ```c if ((newkeys & KEY_FIRE) && (newkeys & KEY_CROUCH)) ``` Não funcionará se quiser detectar quando primeiramente pressionarem "fire" e então o "crouch". ```c if ((newkeys & KEY_FIRE) && !(oldkeys & KEY_FIRE) && (newkeys & KEY_CROUCH) && !(oldkeys & KEY_CROUCH)) ``` Why not? Because OnPlayerKeyStateChange is called every time a single key changes. So they press "KEY_FIRE" - OnPlayerKeyStateChange is called with "KEY_FIRE" in "newkeys" and not in "oldkeys", then they press "KEY_CROUCH" - OnPlayerKeyStateChange is called with "KEY_CROUCH" and "KEY_FIRE" in "newkeys", but "KEY_FIRE" is now also in "oldkeys" as it's already been pressed, so "!(oldkeys & KEY_FIRE)" will fail. Fortunately the solution is very simple (in fact simpler than the original code): Por que não? Pois OnPlayerKeyStateChange é chamada sempre que uma única tecla muda. Então ao pressionar "KEY_FIRE" OnPlayerKeyStateChange será chamado com "KEY_FIRE" no "newkeys" e não no "oldkeys", então ao pressionar "KEY_CROUCH" OnPlayerKeyStateChange será chamado com "KEY_CROUCH" e "KEY_FIRE" no "newkeys", mas "KEY_FIRE" agora também está no "oldkeys" pois já foi pressionado, então "!(oldkeys & KEY_FIRE)" irá falhar. Felizmente, a solução é bem simples: ```c if ((newkeys & (KEY_FIRE | KEY_CROUCH)) == (KEY_FIRE | KEY_CROUCH) && (oldkeys & (KEY_FIRE | KEY_CROUCH)) != (KEY_FIRE | KEY_CROUCH)) ``` Parece complicado, mas ele verifica ambas as teclas que estão no "newkeys" e ambas as teclas que não estão no "oldkeys", se uma delas estiver no "oldkeys" não irá importar pois não é ambas que estão lá. Tudo isso pode ser simplificado com bonitos e ótimos "defines". ## Simplificação ### Detectando uma tecla sendo pressionada A definição: ```c // HOLDING(keys) #define HOLDING(%0) \ ((newkeys & (%0)) == (%0)) ``` Pressionando uma tecla: ```c if (HOLDING( KEY_FIRE )) ``` Pressionando múltiplas teclas: ```c if (HOLDING( KEY_FIRE | KEY_CROUCH )) ``` ### Detectando a primeira tecla que foi pressionada A definição: ```c // PRESSED(keys) #define PRESSED(%0) \ (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))) ``` Uma tecla que foi pressionada: ```c if (PRESSED( KEY_FIRE )) ``` Múltiplas teclas que foram pressionadas: ```c if (PRESSED( KEY_FIRE | KEY_CROUCH )) ``` ### Detectando se o jogador, atualmente, está pressionando uma tecla A definição: ```c // PRESSING(keyVariable, keys) #define PRESSING(%0,%1) \ (%0 & (%1)) ``` Pressionando uma tecla: ```c if (PRESSING( newkeys, KEY_FIRE )) ``` Pressionando múltiplas teclas: ```c if (PRESSING( newkeys, KEY_FIRE | KEY_CROUCH )) ``` ### Detectando uma tecla que foi solta A definição: ```c // RELEASED(keys) #define RELEASED(%0) \ (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0))) ``` Uma tecla solta: ```c if (RELEASED( KEY_FIRE )) ``` Múltiplas teclas soltas: ```c if (RELEASED( KEY_FIRE | KEY_CROUCH )) ``` ## Exemplos ### Anexar NOS quando o jogador pressionar 'fire' (atirar) ```c public OnPlayerKeyStateChange(playerid, KEY:newkeys, KEY:oldkeys) { if (PRESSED(KEY_FIRE)) { if (IsPlayerInAnyVehicle(playerid)) { AddVehicleComponent(GetPlayerVehicleID(playerid), 1010); } } return 1; } ``` ### Super pulo ```c public OnPlayerKeyStateChange(playerid, KEY:newkeys, KEY:oldkeys) { if (PRESSED(KEY_JUMP)) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); SetPlayerPos(playerid, x, y, z + 10.0); } return 1; } ``` ### Modo Deus ativado enquanto estiver pressionando uma tecla ```c new Float:gPlayerHealth[MAX_PLAYERS]; #if !defined INFINITY #define INFINITY (Float:0x7F800000) #endif public OnPlayerKeyStateChange(playerid, KEY:newkeys, KEY:oldkeys) { if (PRESSED(KEY_ACTION)) { // Pressionaram a tecla, salve a vida antiga e ativa o modo Deus GetPlayerHealth(playerid, gPlayerHealth[playerid]); SetPlayerHealth(playerid, INFINITY); } else if (RELEASED(KEY_ACTION)) { // Soltaram a tecla, restaura a vida antiga e desative o modo Deus SetPlayerHealth(playerid, gPlayerHealth[playerid]); } return 1; } ``` ### Explicação Você não precisa saber como é feito, apenas que é assim. HOLDING detecta se o jogador está PRESSIONANDO uma tecla ou teclas, PRESSED detecta a tecla(s) que já foram PRESSIONADAS, RELEASED detecta se uma tecla(s) foi SOLTA. O motivo de precisar fazer assim, e não apenas usando & ou ==, é para exatamente detectar as teclas que deseja e ignorar as outra, as quais podem ou não terem sido pressionadas, em binário KEY_SPRINT é: ``` 0b00001000 ``` e KEY_JUMP é: ``` 0b00100000 ``` Se apenas estivessemos usando & e OnPlayerKeyStateChange for chamado por um jogador pressiondo o "jump" poderiamos obter o código a seguir: ``` newkeys = 0b00100000 wanted = 0b00101000 ANDed = 0b00100000 ``` O AND dos dois números não é 0, portanto o resultado é verdadeiro, o que não é o que queremos. Se apenas usarmos == os dois números claramente não são os mesmos, portanto a verificação iria falhar, é o que queremos. Se o jogador estivesse pressionando "jump" (pulo), "sprint" (correr) e crouch (agaixar), nós teriamos o seguinte código: ``` newkeys = 0b00101010 wanted = 0b00101000 ANDed = 0b00101000 ``` A versão ANDed é o mesmo que as teclas necessárias e também não é 0, portante irá dar a resposta correta, entretanto, os dois números originais não são o mesmo, então == irá falhar. Em ambos os exemplos um dos dois resultaram na resposta correta, e outra na errada. Se compararmos o primeiro usando & e == teremos: ``` newkeys = 0b00100000 wanted = 0b00101000 ANDed = 0b00100000 ``` Obviamente "wanted" e ANDed não são o mesmo, então a verificação falha, o que é correto, para o segundo exemplo: ``` newkeys = 0b00101010 wanted = 0b00101000 ANDed = 0b00101000 ``` "wanted" e ANDed são o mesmo, então comparando-os irá retornar verdadeiro, o que novamente é correto. Então usando este método, podemos precisamente verificar se determinadas teclas foram ou não pressionadas e ignorar todas as outras teclas. O "oldkeys" usa em sua verificação != ao invés de == para garantir que as teclas não foram previamente pressionadas, então sabemos que uma delas foi pressionada.
openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnPlayerKeyStateChange.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnPlayerKeyStateChange.md", "repo_id": "openmultiplayer", "token_count": 4605 }
421
--- title: OnRconCommand description: Essa callback é executada quando um comando é enviado ao servidor, seja digitando no console, pela RCON, ou in-game utilizando "/rcon comando". tags: [] --- ## Descrição Essa callback é executada quando um comando é enviado ao servidor, seja digitando no console, pela RCON, ou in-game utilizando "/rcon comando". | Nome | Descrição | | ----- | --------------------------------------------------------------------------------- | | cmd[] | String contendo o comando que foi digitado, também os parâmetros (caso tenham). | ## Retornos É sempre executada primeiro em filterscripts, retorne 1 para bloquear o gamemode de visualizar. ## Exemplos ```c public OnRconCommand(cmd[]) { printf("[RCON]: Você digitou '/rcon %s'!", cmd); return 0; } public OnRconCommand(cmd[]) { if (!strcmp(cmd, "hello", true)) { SendClientMessageToAll(0xFFFFFFAA, "Olá Mundo!"); print("Você disse Olá para o Mundo!"); // Irá aparecer na cor branca para o jogador que digitou o comando RCON no chat. return 1; } return 0; } ``` ## Notas :::tip "/rcon " não está inclusa no "cmd" quando um player utiliza um comando. Caso você utilize a função "print", uma mensagem será enviada para o jogador que digitou o comando in-game e também no log do servidor. Essa callback não é executada caso o jogador não esteja logado na RCON. Quando o jogador não está logado na RCON como admin ele deve usar o comando /rcon login, a callback OnRconLoginAttempt será executada ao invés da OnRconCommand. Apesar disso, quando o jogador fizer login na RCON como admin, o uso do comando /rcon fará com que o mesmo execute a callback OnRconCommand. ::: :::warning Você precisa incluir essa callback em um filterscript ja carregado para que a mesma funcione no gamemode! ::: ## Funções Relacionadas - [IsPlayerAdmin](../functions/IsPlayerAdmin): Verifica se o jogador está logado na RCON. ## Callbacks Relacionadas - [OnRconLoginAttempt](OnRconLoginAttempt): Executada quando o jogador tenta fazer login na RCON.
openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnRconCommand.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnRconCommand.md", "repo_id": "openmultiplayer", "token_count": 808 }
422
--- title: AddPlayerClass description: Adiciona uma classe à seleção de classes. As classes são usadas para que os jogadores possam aparecer com uma skin (personagem) de sua escolha. tags: [] --- ## Descrição Adiciona uma classe à seleção de classes. As classes são usadas para que os jogadores possam aparecer com uma skin (personagem) de sua escolha. | Nome | Descrição | | -------------- | --------------------------------------------------------- | | modelid | A skin com a qual o jogador irá dar spawn. | | Float: spawn_x | A coordenada X do ponto de spawn desta classe. | | Float: spawn_y | A coordenada Y do ponto de spawn desta classe. | | Float: spawn_z | A coordenada Z do ponto de desova desta classe. | | Float: z_angle | O ângulo Z que o jogador deverá ser voltado após o spawn. | | weapon1 | A primeira arma com que o jogador irá dar spawn. | | weapon1_ammo | A quantidade de munição para a arma primária. | | weapon2 | A segunda arma com que o jogador irá dar spawn. | | weapon2_ammo | A quantidade de munição para a arma secundária. | | weapon3 | A terceira arma com que o jogador irá dar spawn. | | weapon3_ammo | A quantidade de munição para a arma terciária. | ## Retorno O ID da classe que acabou de ser adicionada. 319 se o limite da classe (320) foi atingido. O maior ID de classe possível é 319. ## Exemplos ```c public OnGameModeInit() { // Os jogadores podem escolher entre dar spawn com a skin do CJ (0) ou a skin do The Truth (1). AddPlayerClass(0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0); // CJ AddPlayerClass(1, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0); // The Truth return 1; } ``` ## Notas :::tip A identificação máxima da classe é 319 (começando em 0, portanto, um total de 320 classes). Quando esse limite for atingido, quaisquer outras classes adicionadas substituirão a ID 319. ::: ## Funções Relacionadas - [AddPlayerClassEx](../functions/AddPlayerClassEx.md): Adiciona uma classe com uma equipe padrão. - [SetSpawnInfo](../functions/SetSpawnInfo.md): Define a configuração de spawn para um jogador. - [SetPlayerSkin](../functions/SetPlayerSkin.md): Define a skin (personagem) de um jogador.
openmultiplayer/web/docs/translations/pt-BR/scripting/functions/AddPlayerClass.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/functions/AddPlayerClass.md", "repo_id": "openmultiplayer", "token_count": 1004 }
423
--- title: BanEx description: Bane um jogador com um motivo específico. tags: [] --- ## Descrição Bane um jogador com um motivo específico. | Nome | Descrição | | -------- | ----------------------------- | | playerid | O ID do jogador a ser banido. | | reason | O motivo do banimento. | ## Retorno Esta função não retorna nenhum valor específico. ## Exemplos ```c public OnPlayerCommandText( playerid, cmdtext[] ) { if (!strcmp(cmdtext, "/banme", true)) { // Bane o jogador que executar este comando e inclui o motivo "Solicitado". BanEx(playerid, "Solicitado"); return 1; } } // Para exibir uma mensagem (por exemplo, motivo) para o jogador antes que a conexão seja fechada // você tem que usar um cronômetro (timer) para criar um atraso. Esse atraso precisa ser de apenas alguns milissegundos, // mas este exemplo usa um segundo inteiro apenas por garantia. forward BanExPublic(playerid, reason[]); public BanExPublic(playerid, reason[]) { BanEx(playerid, reason); } stock BanExWithMessage(playerid, color, message[], reason[]) { //motivo - O motivo do banimento para ser usado no BanEx. SendClientMessage(playerid, color, message); SetTimerEx("BanExPublic", 1000, false, "ds", playerid, reason); } public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/banme", true) == 0) { // Bane o jogador que executar este comando. BanExWithMessage(playerid, 0xFF0000FF, "Você foi banido!", "Solicitado"); return 1; } return 0; } ``` ## Notas :::warning Qualquer ação realizada diretamente antes do Ban() (como enviar uma mensagem com SendClientMessage) não chegará ao jogador. Um cronômetro (timer) deve ser usado para atrasar o banimento. ::: ## Funções Relacionadas - [BanEx](../functions/Ban.md): Bane um jogador do servidor. - [Kick](../functions/Kick.md): Expulsa um jogador do servidor.
openmultiplayer/web/docs/translations/pt-BR/scripting/functions/BanEx.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/functions/BanEx.md", "repo_id": "openmultiplayer", "token_count": 781 }
424
--- title: GangZoneShowForAll description: Mostra uma gangzone com a cor desejada para todos os jogadores. tags: ["gangzone"] --- ## Descrição Mostra uma gangzone com a cor desejada para todos os jogadores. | Nome | Descrição | | ----- | ---------------------------------------------------------------------------------------------------------------- | | zone | O ID da gangzone a ser mostrada (retornada por GangZoneCreate). | | color | A cor a ser mostrada na gangzone, pode ser integer ou hex no formato de cor RGBA. Transparência Alpha suportada. | ## Retorno 1: A função foi executada com sucesso. A gangzone foi mostrada para todos os jogadores. 0: A função falhou ao ser executada. A gangzone não existe. ## Exemplos ```c new gGangZoneId; public OnGameModeInit() { gGangZoneId = GangZoneCreate(1248.011, 2072.804, 1439.348, 2204.319); return 1; } public OnPlayerSpawn(playerid) { if (IsPlayerAdmin(playerid)) { GangZoneShowForAll(gGangZoneId, COLOR_RED); } return 1; } ``` ## Funções Relacionadas - [GangZoneCreate](GangZoneCreate): Cria uma gangzone. - [GangZoneDestroy](GangZoneDestroy): Destrói uma gangzone. - [GangZoneShowForPlayer](GangZoneShowForPlayer): Mostra uma gangzone a um jogador. - [GangZoneHideForPlayer](GangZoneHideForPlayer): Esconde uma gangzone a um jogador. - [GangZoneHideForAll](GangZoneHideForAll): Esconde uma gangzone para todos os jogadores. - [GangZoneFlashForPlayer](GangZoneFlashForPlayer): Faz uma gangzone piscar para um jogador. - [GangZoneFlashForAll](GangZoneFlashForAll): Faz uma gangzone piscar para todos os jogadores. - [GangZoneStopFlashForPlayer](GangZoneStopFlashForPlayer): Pare uma Gangzone de piscar para um jogador. - [GangZoneStopFlashForAll](GangZoneStopFlashForAll): Pare uma Gangzone de piscar para todos os jogadores.
openmultiplayer/web/docs/translations/pt-BR/scripting/functions/GangZoneShowForAll.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/functions/GangZoneShowForAll.md", "repo_id": "openmultiplayer", "token_count": 793 }
425
--- title: GivePlayerMoney description: Dá ou retira dinheiro para/de um jogador. tags: ["player"] --- ## Descrição Dá ou tira dinheiro para/de um jogador. | Nome | Descrição | | -------- | -------------------------------------------------------------------------------------- | | playerid | O ID do jogador ao qual dá ou retira dinheiro. | | money | Quantidade de dinheiro a dar ao jogador. Use um valor negativo(-) para tirar dinheiro. | ## Retorno 1: A função foi executada com sucesso. 0: A função falhou ao ser executada. Isso significa que o jogador não está conectado. ## Exemplos ```c public OnPlayerDeath(playerid, killerid, WEAPON:reason) { if (killerid != INVALID_PLAYER_ID) { // Dê $1000 para o assassino GivePlayerMoney(killerid, 1000); SendClientMessage(killerid, -1, "Você recebeu $1000 pelo assassinato."); } // Retira $500 do jogador que morreu. GivePlayerMoney(playerid, -500); } ``` ## Funções Relacionadas - [ResetPlayerMoney](ResetPlayerMoney.md): Define o dinheiro de um jogador para \$0. - [GetPlayerMoney](GetPlayerMoney.md): Verifique quanto dinheiro um jogador tem.
openmultiplayer/web/docs/translations/pt-BR/scripting/functions/GivePlayerMoney.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/functions/GivePlayerMoney.md", "repo_id": "openmultiplayer", "token_count": 544 }
426
--- title: db_close description: Fecha uma conexão de banco de dados SQLite que foi aberta com `db_open`. keywords: - sqlite --- <LowercaseNote /> ## Descrição Fecha uma conexão de banco de dados SQLite que foi aberta com [db_open](db_open). | Nome | Descrição | | ----- | ---------------------------------------------------------------------------------------------- | | DB:db | O identificador da conexão de banco de dados a ser fechada (retornada por [db_open](db_open)). | ## Retorno 1: A função foi executada com sucesso. 0: A função falhou ao executar. Isso pode significar que o identificador de conexão do banco de dados é inválido. ## Exemplos ```c static DB:gDBConnectionHandle; // ... public OnGameModeInit() { // Criar uma conexão com um banco de dados gDBConnectionHandle = db_open("exemplo.db"); // Se a conexão com o banco de dados existir if(gDBConnectionHandle) { // Uma conexão com o banco de dados foi criada com sucesso print("Conexão com o banco de dados \"exemplo.db\" criada com sucesso."); } else { // Falha ao criar uma conexão com o banco de dados print("Falha ao abrir uma conexão com o banco de dados \"exemplo.db\"."); } return 1; } public OnGameModeExit() { // Feche a conexão com o banco de dados se a conexão estiver aberta if(db_close(gDBConnectionHandle)) { // Limpeza extra gDBConnectionHandle = DB:0; } // ... return 1; } ``` ## Notas :::warning Usar um identificador inválido diferente de zero irá travar seu servidor! Obtenha um identificador de conexão de banco de dados válido usando [db_open](db_open). ::: ## Funções relacionadas - [db_open](db_open): Abre uma conexão com um banco de dados SQLite. - [db_query](db_query): Consulta um banco de dados SQLite. - [db_free_result](db_free_result): Liberar memória de resultado de uma db_query. - [db_num_rows](db_num_rows): Obtenha o número de linhas em um resultado. - [db_next_row](db_next_row): Mover para a próxima linha. - [db_num_fields](db_num_fields): Obtenha o número de campos em um resultado. - [db_field_name](db_field_name): Retorna o nome de um campo em um determinado índice. - [db_get_field](db_get_field): Obtém o conteúdo do campo com o ID especificado da linha de resultado atual. - [db_get_field_assoc](db_get_field_assoc): Obtém o conteúdo do campo com o nome especificado da linha de resultado atual. - [db_get_field_int](db_get_field_int): Obtém o conteúdo do campo como um número inteiro com ID especificado da linha de resultado atual. - [db_get_field_assoc_int](db_get_field_assoc_int): Obtém o conteúdo do campo como um número inteiro com o nome especificado da linha de resultado atual. - [db_get_field_float](db_get_field_float): Obtém o conteúdo do campo como um float com ID especificado da linha de resultado atual. - [db_get_field_assoc_float](db_get_field_assoc_float): Obtém o conteúdo do campo como um float com o nome especificado da linha de resultado atual. - [db_get_mem_handle](db_get_mem_handle): Obtenha o identificador de memória para um banco de dados SQLite que foi aberto com db_open. - [db_get_result_mem_handle](db_get_result_mem_handle): Obtenha o identificador de memória para uma consulta SQLite que foi executada com db_query. - [db_debug_openfiles](db_debug_openfiles): A função obtém o número de conexões de banco de dados abertas para fins de depuração. - [db_debug_openresults](db_debug_openresults): A função obtém o número de resultados do banco de dados aberto.
openmultiplayer/web/docs/translations/pt-BR/scripting/functions/db_close.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/functions/db_close.md", "repo_id": "openmultiplayer", "token_count": 1507 }
427
--- title: Click Sources description: Click Sources --- Para ser usado com [OnPlayerClickPlayer](../callbacks/OnPlayerClickPlayer) | Valor | Símbolo constante | | ----- | ----------------------- | | 0 | CLICK_SOURCE_SCOREBOARD | | - | - |
openmultiplayer/web/docs/translations/pt-BR/scripting/resources/clicksources.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/resources/clicksources.md", "repo_id": "openmultiplayer", "token_count": 113 }
428
--- title: OnFilterScriptExit description: Acest callback este apelat atunci când un script de filtru este descărcat. tags: [] --- ## Descriere Acest callback este apelat atunci când un script de filtru este descărcat. Este apelat doar în interiorul filterscript-ului care este descărcat. ## Exemple ```c public OnFilterScriptExit() { print("\n--------------------------------------"); print(" FilterScript-ul meu s-a descărcat"); print("--------------------------------------\n"); return 1; } ``` ## Related Callbacks
openmultiplayer/web/docs/translations/ro/scripting/callbacks/OnFilterScriptExit.md/0
{ "file_path": "openmultiplayer/web/docs/translations/ro/scripting/callbacks/OnFilterScriptExit.md", "repo_id": "openmultiplayer", "token_count": 182 }
429
--- title: OnPlayerEnterCheckpoint description: Acest callback este apelat atunci când un jucător intră în punctul de control setat pentru acel jucător. tags: ["player", "checkpoint"] --- ## Descriere Acest callback este apelat atunci când un jucător intră în punctul de control setat pentru acel jucător. | Name | Descriere | | -------- | -------------------------------------- | | playerid | Jucătorul care a intrat în checkpoint. | ## Returnări Este întotdeauna numit primul în filterscript-uri. ## Exemple ```c //În acest exemplu, un checkpoint este creat pentru jucător când apare, //care creează un vehicul și dezactivează checkpoint-ul. public OnPlayerSpawn(playerid) { SetPlayerCheckpoint(playerid, 1982.6150, -220.6680, -0.2432, 3.0); return 1; } public OnPlayerEnterCheckpoint(playerid) { CreateVehicle(520, 1982.6150, -221.0145, -0.2432, 82.2873, -1, -1, 60000); DisablePlayerCheckpoint(playerid); return 1; } ``` ## Note <TipNPCCallbacks /> ## Funcții similare - [SetPlayerCheckpoint](../functions/SetPlayerCheckpoint): Creați un checkpoint pentru un jucător. - [DisablePlayerCheckpoint](../functions/DisablePlayerCheckpoint): Dezactivează checkpoint-ul curent al jucătorului. - [IsPlayerInCheckpoint](../functions/IsPlayerInRaceCheckpoint): Verificați dacă un jucător se află într-un checkpoint. - [SetPlayerRaceCheckpoint](../functions/SetPlayerRaceCheckpoint): Creați un checkpoint al cursei pentru un jucător. - [DisablePlayerRaceCheckpoint](../functions/DisablePlayerRaceCheckpoint): Dezactivează checkpoint-ul cursei curente al jucătorului. - [IsPlayerInRaceCheckpoint](../functions/IsPlayerInRaceCheckpoint): Verificați dacă un jucător se află într-un checkpoint al unei cursei.
openmultiplayer/web/docs/translations/ro/scripting/callbacks/OnPlayerEnterCheckpoint.md/0
{ "file_path": "openmultiplayer/web/docs/translations/ro/scripting/callbacks/OnPlayerEnterCheckpoint.md", "repo_id": "openmultiplayer", "token_count": 687 }
430
--- title: OnPlayerRequestSpawn description: Apelat atunci când un jucător încearcă să apară prin selecția clasei, fie apăsând SHIFT, fie făcând clic pe butonul „Apariție”. tags: ["player"] --- ## Descriere Apelat atunci când un jucător încearcă să apară prin selecția clasei, fie apăsând SHIFT, fie făcând clic pe butonul „Apariție”. | Name | Descriere | | -------- | --------------------------------------------- | | playerid | ID-ul jucătorului care a solicitat să apară. | ## Returnări Este întotdeauna numit primul în filterscript-uri, așa că returnarea 0 acolo blochează și alte scripturi să-l vadă. ## Exemple ```c public OnPlayerRequestSpawn(playerid) { if (!IsPlayerAdmin(playerid)) { SendClientMessage(playerid, -1, "Nu te poti spawna."); return 0; } return 1; } ``` ## Note <TipNPCCallbacks /> :::tip Pentru a împiedica jucătorii să apară cu anumite clase, ultima clasă vizualizată trebuie salvată într-o variabilă în OnPlayerRequestClass. ::: ## Funcții similare
openmultiplayer/web/docs/translations/ro/scripting/callbacks/OnPlayerRequestSpawn.md/0
{ "file_path": "openmultiplayer/web/docs/translations/ro/scripting/callbacks/OnPlayerRequestSpawn.md", "repo_id": "openmultiplayer", "token_count": 522 }
431
--- title: OnVehicleDamageStatusUpdate description: Acest callback este apelat atunci când un element al vehiculului, cum ar fi ușile, anvelopele, panourile sau luminile își schimbă starea de deteriorare. tags: ["vehicle"] --- :::tip Pentru câteva funcții utile pentru lucrul cu valorile daunelor vehiculului, consultați [aici](../resources/damagestatus). ::: ## Descriere This callback is called when a vehicle element such as doors, tires, panels, or lights change their damage status. | Nume | Descriere | | --------- | ------------------------------------------------------------------------------------------------------ | | vehicleid | ID-ul vehiculului căruia i-a fost schimbat starea de deteriorare. | | playerid | ID-ul jucătorului care a sincronizat modificarea stării deteriorării (care a avut mașina avariată sau reparată). | ## Returnări 1 - Va împiedica alte filterscript-uri să primească acest apel invers. 0 - Indică faptul că acest apel invers va fi transmis următorului filterscript. Este întotdeauna numit primul în filterscript-uri. ## Exemple ```c public OnVehicleDamageStatusUpdate(vehicleid, playerid) { // Obține starea de deteriorare a tuturor componentelor new panels, doors, lights, tires; GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires); // Setați anvelopele la 0, ceea ce înseamnă că niciunul nu este spart tires = 0; // Actualizați starea de deteriorare a vehiculului cu anvelope nescăpate UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires); return 1; } ``` ## Note :::tip Aceasta nu include modificările de sănătate a vehiculului. ::: ## Funcții similare - [GetVehicleDamageStatus](../functions/GetVehicleDamageStatus): Obțineți starea de deteriorare a vehiculului pentru fiecare parte individual. - [UpdateVehicleDamageStatus](../functions/UpdateVehicleDamageStatus): Actualizați daunele vehiculului.
openmultiplayer/web/docs/translations/ro/scripting/callbacks/OnVehicleDamageStatusUpdate.md/0
{ "file_path": "openmultiplayer/web/docs/translations/ro/scripting/callbacks/OnVehicleDamageStatusUpdate.md", "repo_id": "openmultiplayer", "token_count": 842 }
432
--- title: AddStaticVehicle description: Adaugă un vehicul 'static' (modelele sunt preîncărcate pentru jucători) la modul de joc. tags: ["vehicle"] --- ## Descriere Adaugă un vehicul 'static' (modelele sunt preîncărcate pentru jucători) la modul de joc. | Nume | Descriere | | ---------------------------------------- | ----------------------------------------------- | | modelid | ID-ul modelului vehiculului. | | Float:spawn_X | Coordonata X pentru vehicul. | | Float:spawn_Y | Coordonata Y pentru vehicul. | | Float:spawn_Z | Coordonata Z pentru vehicul. | | Float:z_angle | Direcția vehiculului - unghiul. | | [color1](../resources/vehiclecolorid.md) | ID-ul culorii primare. -1 pentru aleatoriu. | | [color2](../resources/vehiclecolorid.md) | Codul secundar de culoare. -1 pentru aleatoare. | ## Se intoarce Codul vehiculului vehiculului creat (între 1 și MAX_VEHICLES). INVALID_VEHICLE_ID (65535) dacă vehiculul nu a fost creat (limita vehiculului a fost atinsă sau ID-ul modelului vehiculului nevalid a fost trecut). ## Exemple ```c public OnGameModeInit() { // Add a Hydra to the game AddStaticVehicle(520, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1); return 1; } ``` ## Funcții conexe - [AddStaticVehicleEx](AddStaticVehicleEx.md): Adăugați un vehicul static cu timp de respawn personalizat. - [CreateVehicle](CreateVehicle.md): Creați un vehicul. - [DestroyVehicle](DestroyVehicle.md): Distrugeți un vehicul.
openmultiplayer/web/docs/translations/ro/scripting/functions/AddStaticVehicle.md/0
{ "file_path": "openmultiplayer/web/docs/translations/ro/scripting/functions/AddStaticVehicle.md", "repo_id": "openmultiplayer", "token_count": 884 }
433
--- title: Tipuri de lovituri de glonț --- :::info Se foloseste in [OnPlayerWeaponShot](../callbacks/OnPlayerWeaponShot). ::: --- | Nume | Valoare | | ----------------------------- | ------- | | BULLET_HIT_TYPE_NONE | 0 | | BULLET_HIT_TYPE_PLAYER | 1 | | BULLET_HIT_TYPE_VEHICLE | 2 | | BULLET_HIT_TYPE_OBJECT | 3 | | BULLET_HIT_TYPE_PLAYER_OBJECT | 4 | --- :::caution BULLET_HIT_TYPE_PLAYER este apelat și pentru NPC-uri. Actorii sunt ignorați de acest apel invers și detectează ca BULLET_HIT_TYPE_NONE. :::
openmultiplayer/web/docs/translations/ro/scripting/resources/bullethittypes.md/0
{ "file_path": "openmultiplayer/web/docs/translations/ro/scripting/resources/bullethittypes.md", "repo_id": "openmultiplayer", "token_count": 315 }
434
--- title: "Structuri avansate" --- ## Manipularea matricei ### Găsirea corectă a unui slot gol Acest exemplu arată cum să găsiți un slot gol într-o matrice folosind practicile standard de codare. ```c new gMyArray[10]; stock FindEmptySlot() { new i = 0; while (i < sizeof (gMyArray) && gMyArray[i]) { i++; } if (i == sizeof (gMyArray)) return -1; return i; } ``` Acest exemplu de bază presupune că un slot de matrice este gol dacă valoarea sa este 0. Bucla parcurge toate valorile din matrice (s-ar putea face și cu o constantă) atâta timp cât valorile nu sunt 0. Când atinge una care este 0 în timp ce starea va eșua și bucla se termină fără a utiliza o pauză, așa cum este practică obișnuită, dar descurajată în astfel de situații. Această funcție returnează și -1 dacă nu se găsește un slot liber, care ar trebui verificat la celălalt capăt. În mod obișnuit, ați folosi imediat identificatorul găsit: ```c MyFunction() { new i = 0; while (i < sizeof (gMyArray) && gMyArray[i]) { i++; } if (i == sizeof (gMyArray)) { printf("No free slot found"); return 0; } printf("Slot %d is empty", i); // Use the found slot in your code for whatever return 1; } ``` Evident, ați înlocui expresia „gMyArray[i]” cu propria dvs. indicație a unui slot în uz. ### Lista #### Introducere Listele sunt un tip de structură foarte utilă, sunt practic o matrice în care următoarea piesă sau datele relevante sunt arătate de ultima piesă. Exemplu: Spuneți că aveți următoarea matrice: ```c 3, 1, 64, 2, 4, 786, 2, 9 ``` Dacă doriți să sortați matricea, veți termina cu: ```c 1, 2, 2, 3, 4, 9, 64, 786 ``` Dacă totuși ați dorit să lăsați datele în ordinea inițială, dar știți numerele în ordine din anumite motive (este doar un exemplu), aveți o problemă, cum doriți să aveți numere în două ordine simultan? Aceasta ar fi o bună utilizare a listelor. Pentru a construi o listă din aceste date, ar trebui să transformați matricea într-o matrice 2d, unde a doua dimensiune avea 2 celule mari, prima dimensiune conținând numărul original, cealaltă conținând indexul următorului număr cel mai mare. De asemenea, ați avea nevoie de o variabilă separată pentru a menține indicele celui mai mic număr, astfel încât noua matrice ar arăta astfel: ```c start = 1 3, 1, 64, 2, 4, 786, 2, 9 4, 3, 5, 6, 7, -1, 0, 2 ``` Următorul index asociat cu 786 este -1, acesta este un index de matrice nevalid și indică sfârșitul listei, adică nu mai sunt numere. Cele două 2 ar putea fi, evident, în sens invers, primul din matrice este și primul din listă, deoarece este cel mai probabil să fie întâmpinat mai întâi. Celălalt avantaj al acestei metode de sortare a numerelor este că se adaugă mai multe numere este mult mai rapid. Dacă doriți să adăugați un alt număr 3 la matricea sortată, ar trebui să schimbați mai întâi cel puțin 4 numere un slot spre dreapta pentru a face spațiu, nu teribil aici, dar foarte lent în matrici mai mari. Cu versiunea listă, puteți adăuga doar 3 la sfârșitul matricei și puteți modifica o singură valoare din listă: ```c start = 1 3, 1, 64, 2, 4, 786, 2, 9, 3 8, 3, 5, 6, 7, -1, 0, 2, 4 ^ modifica aceasta valoare ^ urmatorul cel mai mare slot ``` Niciunul dintre celelalte numere nu s-a mutat, astfel încât niciunul dintre ceilalți indici nu trebuie actualizat, trebuie doar să indicați următorul număr cel mai scăzut către noul număr și să faceți ca noul număr să fie numărul către următorul cel mai scăzut obișnuit. Eliminarea unei valori este și mai ușoară: ```c start = 1 3, 1, 64, X, 4, 786, 2, 9, 3 8, 6, 5, 6, 7, -1, 0, 2, 4 ^ Changed to jump over the removed value ``` Aici primele 2 au fost eliminate și numărul care indica acest număr (1) a fost actualizat pentru a indica numărul către care era îndreptat numărul eliminat. În acest exemplu, nici indicatorul și numărul numărului eliminat nu au fost eliminate, dar nu puteți ajunge la acel slot urmând lista, deci nu contează, este efectiv eliminat. #### Types Listele din exemplele de mai sus au fost doar liste simple de bază, puteți avea, de asemenea, liste duble în care fiecare valoare indică următoarea valoare și ultima valoare, acestea tind să aibă un pointer la sfârșitul listei și pentru a merge înapoi (de exemplu la obțineți numerele în ordine descrescătoare): ```c start = 1 end = 5 value: 3, 1, 64, 2, 4, 786, 2, 9, 3 next: 8, 3, 5, 6, 7, -1, 0, 2, 4 last: 6, -1, 7, 1, 8, 2, 3, 4, 0 ``` Trebuie să aveți grijă la acestea, mai ales atunci când aveți mai mult de una dintre orice valori, ca ultimul indicator să indice numărul care este următorul indicator care revine direct înapoi, de exemplu, acest lucru este greșit: ```c 2, 3, 3 1, 2, -1 -1, 2, 0 ``` Următorul indicator al 2 indică 3 în slotul unu, dar ultimul indicator al lui 3 nu revine la cele două, ambele liste sunt în ordine pe cont propriu (deoarece cele două trei pot fi în sens invers), dar împreună sunt greșite , versiunea corectă ar fi: ```c 2, 3, 3 1, 2, -1 -1, 0, 2 ``` Ambele liste încep și se termină la sfârșitul a două numere, lista din spate în exemplul greșit a început pe numărul din mijloc. Celălalt tip de listă este cel în buclă, unde ultima valoare arată înapoi la prima. Avantajul evident al acestui lucru este că puteți ajunge la orice valoare din orice altă valoare fără să știți în prealabil dacă ținta este înainte sau după punctul de pornire, trebuie doar să aveți grijă să nu intrați într-o buclă infinită, deoarece nu există niciun fel explicit - 1 punct final. Aceste liste au încă puncte de început. Puteți face, de asemenea, liste cu buclă dublă, în cazul în care aveți o listă următoare și ultima, ambele rotunjite în buclă: ```c start = 1 end = 5 3, 1, 64, 2, 4, 786, 2, 9, 3 8, 3, 5, 6, 7, 1, 0, 2, 4 6, 5, 7, 1, 8, 2, 3, 4, 0 ``` #### Liste mixte Listele mixte sunt tablouri care conțin mai multe liste simultan. Un exemplu ar putea fi o serie de valori, sortate după o listă, cu o altă listă care leagă toate sloturile neutilizate, astfel încât să știți unde puteți adăuga o nouă valoare. Exemplu (X înseamnă slot nefolosit (gol)): ```c sortedStart = 3 unusedStart = 1 value: 34, X, X, 6, 34, 46, X, 54, 23, 25, X, 75, X, 45 sort: 4, 8, 13, 7, 11, 9, 0, -1, 5 free: 2, 6, 10, 12, -1 ``` Evident, cele două liste nu interacționează niciodată, astfel încât ambele pot folosi același slot pentru următoarea lor valoare: #### Cod Înainte de a începe codul, trebuie să decideți ce tip de listă este cel mai potrivit pentru aplicația dvs., aceasta se bazează în totalitate pe aplicație care nu poate fi acoperită cu ușurință aici. Toate aceste exemple sunt liste mixte, o listă pentru valorile necesare, una pentru sloturile neutilizate. Acest exemplu arată cum se scrie cod pentru o listă sortată numeric crescător. ```c #define NUMBER_OF_VALUES (10) enum E_DATA_LIST { E_DATA_LIST_VALUE, E_DATA_LIST_NEXT } new gListData[NUMBER_OF_VALUES][E_DATA_LIST], gUnusedStart = 0, gListStart = -1; // Starts off with no list // This function initializes the list List_Setup() { new i, size = NUMBER_OF_VALUES; size--; for (i = 0; i < size; i++) { // To start with all slots are unused gListData[i][E_DATA_LIST_NEXT] = i + 1; } // End the list gListData[size][E_DATA_LIST_NEXT] = -1; } // This function adds a value to the list (using basic sorting) List_Add(value) { // Check if there are free slots in the array if (gUnusedStart == -1) return -1; new pointer = gListStart, last = -1, slot = gUnusedStart; // Add the value to the array gListData[slot][E_DATA_LIST_VALUE] = value; // Update the empty list gUnusedStart = gListData[slot][E_DATA_LIST_NEXT]; // Loop through the list till we get to bigger/same size number while (pointer != -1 && gListData[pointer][E_DATA_LIST_VALUE] < value) { // Save the position of the last value last = pointer; // Move on to the next slot pointer = gListData[pointer][E_DATA_LIST_NEXT]; } // If we got here we ran out of values or reached a larger one // Check if we checked any numbers if (last == -1) { // The first number was bigger or there is no list // Either way add the new value to the start of the list gListData[slot][E_DATA_LIST_NEXT] = gListStart; gListStart = slot; } else { // Place the new value in the list gListData[slot][E_DATA_LIST_NEXT] = pointer; gListData[last][E_DATA_LIST_NEXT] = slot; } return slot; } // This function removes a value from a given slot in the array (returned by List_Add) List_Remove(slot) { // Is this a valid slot if (slot < 0 || slot >= NUMBER_OF_VALUES) return 0; // First find the slot before new pointer = gListStart, last = -1; while (pointer != -1 && pointer != slot) { last = pointer; pointer = gListData[pointer][E_DATA_LIST_NEXT]; } // Did we find the slot in the list if (pointer == -1) return 0; if (last == -1) { // The value is the first in the list // Skip over this slot in the list gListStart = gListData[slot][E_DATA_LIST_NEXT]; } else { // The value is in the list // Skip over this slot in the list gListData[last][E_DATA_LIST_NEXT] = gListData[slot][E_DATA_LIST_NEXT]; } // Add this slot to the unused list // The unused list isn't in any order so this doesn't matter gListData[slot][E_DATA_LIST_NEXT] = gUnusedStart; gUnusedStart = slot; return 1; } ``` ### Copaci binari #### Introducere Arborii binari sunt o metodă foarte rapidă de căutare a datelor într-o matrice utilizând un sistem de liste foarte special. Cel mai cunoscut arbore binar este probabil jocul cu 20 de întrebări, cu doar 20 de întrebări da / nu pe care le puteți avea peste 1048576 articole. Un arbore binar, așa cum sugerează și numele, este un tip de arbore, similar cu un arbore genealogic, în care fiecare articol are 0, 1 sau 2 copii. Nu sunt folosite pentru a comanda date, cum ar fi o listă, ci pentru a sorta datele pentru o căutare foarte eficientă. Practic, începeți cu un element undeva aproape de mijlocul listei ordonate de obiecte (de exemplu, numărul de mijloc dintr-o matrice sortată) și comparați-l cu valoarea pe care doriți să o găsiți. Dacă este la fel că ați găsit articolul dvs., dacă este mai mare, vă deplasați la articolul la dreapta (nu imediat la dreapta, elementul din dreapta elementului din mijloc ar fi elementul de la punctul trei sferturi), dacă este mai puțin să vă mișcați la stânga, apoi repetați procesul. **Exemplu** ```c 1 2 5 6 7 9 12 14 17 19 23 25 28 33 38 ``` Aveți matricea ordonată precedentă și doriți să aflați în ce slot este numărul 7 (dacă este deloc), în acest exemplu este probabil mai eficient să faceți doar o buclă directă prin matrice pentru a o găsi, dar asta nu este punctul metoda crește în timp liniar cu dimensiunea tabloului, un timp de căutare binar crește liniar pe măsură ce tabloul crește exponențial ca dimensiune. Adică o matrice 128 mare va dura de două ori mai mult pentru a căuta direct ca o matrice 64 mare, dar o căutare binară 128 mare va lua doar un cec mai mult decât o căutare binară 64 mare, deloc mult. Dacă construim un arbore binar din datele de mai sus, obținem: ![Imgur](https://web.archive.org/web/20190416012239im_/https://wiki.sa-mp.com/wroot/images2/f/fe/Binarytree.GIF) Dacă citiți de la stânga la dreapta, ignorând aspectul vertical, puteți vedea că numerele sunt în ordine. Acum putem încerca să găsim 7. Numărul de start este 14, 7 este mai mic decât 14, așa că mergem la slotul indicat de ramura din stânga a 14. Aceasta ne aduce la 6, 7 este mai mare decât 6, așa că mergem la dreapta la 9, apoi din nou la stânga la 7. Această metodă a făcut 4 comparații pentru a găsi numărul (inclusiv verificarea finală pentru a confirma că suntem pe 7), folosind o căutare directă ar fi fost necesare 5. Să spunem că nu există 7, am ajunge la acest arbore binar: ![Binarytree-7-less](https://web.archive.org/web/20190416012239im_/https://wiki.sa-mp.com/wroot/images2/e/e5/Binarytree-7-less.GIF) Acesta, spre deosebire de exemplul de mai sus, are un singur număr copil (cel 9), precum și 2 și 0 numere copil. Obțineți un arbore perfect numai atunci când există (2 ^ n) -1 numere (0, 1, 3, 7, 15, 31 ...), orice alte numere vor da un arbore nu destul de complet. În acest caz, când ajungem la 9, unde va fi 7, vom descoperi că nu există ramură stângă, adică 7 nu există (nu poate fi nicăieri altundeva în copac, gândiți-vă la asta), deci returnăm -1 pentru slot nevalid. #### Balansat si nebalansat Arborii din exemplele de mai sus sunt numiți arbori binari echilibrați, aceasta înseamnă cât mai aproape posibil toate ramurile au aceeași lungime (evident că în al doilea nu există suficiente numere pentru ca acest lucru să fie cazul, dar este cât mai aproape posibil). Construirea copacilor echilibrați nu este ușoară, metoda general acceptată de a construi copaci aproape echilibrați este plasarea numerelor într-o ordine aleatorie, acest lucru poate însemna că veți ajunge la așa ceva: ![Binarytree-uneven](https://web.archive.org/web/20190416012239im_/https://wiki.sa-mp.com/wroot/images2/a/a2/Binarytree-uneven.GIF) Evident, acest arbore este încă valabil, dar partea dreaptă este mult mai mare decât stânga, totuși găsirea a 25 necesită doar 7 comparații în acest raport față de 12 din lista dreaptă. De asemenea, atâta timp cât începeți cu un număr destul de mediu, metoda de inserare aleatorie ar trebui să producă un arbore destul de echilibrat. Cel mai rău lucru posibil pe care îl puteți face este să puneți numerele în ordine, deoarece atunci nu vor exista deloc ramuri stângi (sau ramuri dreapta dacă se face invers), totuși chiar și în acest caz cel mai rău arborele binar nu va mai dura să caute decât lista dreaptă. **Modificare** #### Adaugare Adăugarea unei valori unui copac binar este relativ ușor, trebuie doar să urmăriți copacul, folosind valoarea pe care doriți să o adăugați ca referință până când ajungeți la o ramură goală și adăugați numărul acolo. De exemplu. dacă ați dori să adăugați numărul 15 la arborele nostru echilibrat original, acesta ar ajunge pe ramura din stânga a 17. Dacă am dori să adăugăm numărul 8 la al doilea arbore echilibrat (cel fără 7) ar ajunge în vechiul slot al 7 din stânga lui 9. #### Stergere Ștergerea unui număr dintr-un arbore binar poate fi dificilă sau poate fi ușoară. Dacă numărul este la sfârșitul unei ramuri (de exemplu, 1, 5, 7, 12 etc. în arborele original) pur și simplu le eliminați. Dacă un număr are un singur copil (de exemplu, 9 în al doilea exemplu), pur și simplu îl mutați pe copil (de exemplu, 12) în poziția lor (deci copiii lui 6 ar fi 2 și 12 în noul al doilea exemplu, cu 9 eliminați). Ștergerea devine interesantă numai atunci când un nod are doi copii. Există cel puțin patru moduri de a face acest lucru: Prima metodă este cea mai simplă din punct de vedere calculatic. Practic, alegeți una dintre ramuri (stânga sau dreapta, asumați dreapta pentru această explicație) și înlocuiți nodul pe care l-ați eliminat cu primul nod al acelei ramuri (adică copilul drept al nodului pe care l-ați eliminat). Apoi mergeți la stânga prin noua ramură până ajungeți la capăt și așezați ramura stângă acolo. De exemplu. dacă ați eliminat 14 din exampe-ul original, ați ajunge cu 25 ocupându-i locul în vârful copacului și 6 atașat la ramura stângă a 17. Această metodă este rapidă, dar se termină cu copaci foarte dezechilibrați foarte repede. A doua metodă este să obțineți toate numerele care sunt copiii nodului pe care tocmai l-ați eliminat și să reconstruiți un nou arbore binar din ele, apoi să puneți partea de sus a acelui arbore în nodul pe care tocmai l-ați eliminat. Acest lucru menține arborele destul de bine echilibrat, dar este evident mai lent. A treia metodă este de a combina cele două metode de mai sus și de a reconstrui arborele în linie, acest lucru este mai complex de codat, dar menține arborele echilibrat și este mai rapid decât cea de-a doua metodă (deși nu este aproape la fel de rapid ca prima). Mentalul final enumerat aici este să setați pur și simplu un steag pe o valoare spunând că nu mai este utilizată, aceasta este chiar mai rapidă decât prima metodă și menține structura, dar înseamnă că nu puteți reutiliza sloturile decât dacă puteți găsi o valoare pentru înlocuiți-l cu mai târziu.
openmultiplayer/web/docs/translations/ro/tutorials/AdvancedStructures.md/0
{ "file_path": "openmultiplayer/web/docs/translations/ro/tutorials/AdvancedStructures.md", "repo_id": "openmultiplayer", "token_count": 7790 }
435
--- title: OnActorStreamIn description: Этот коллбэк вызывается, когда актёр попадает в зону стрима клиента. tags: [] --- <VersionWarn name='callback' version='SA-MP 0.3.7' /> ## Описание Этот коллбэк вызывается, когда актёр попадает в зону стрима клиента. | Аргумент | Описание | | ----------- | ------------------------------------------------------------- | | actorid | ID актёра, который попал в зону стрима клиента. | | forplayerid | Клиент, в чью зону стрима попал актёр. | ## Результат Данный коллбэк всегда вызывается в filterscript'ах первее. ## Пример ```c public OnActorStreamIn(actorid, forplayerid) { new string[40]; format(string, sizeof(string), "Актёр %d попал в вашу зону стрима.", actorid); SendClientMessage(forplayerid, 0xFFFFFFFF, string); return 1; } ``` ## Примечания <TipNPCCallbacks /> ## Функции
openmultiplayer/web/docs/translations/ru/scripting/callbacks/OnActorStreamIn.md/0
{ "file_path": "openmultiplayer/web/docs/translations/ru/scripting/callbacks/OnActorStreamIn.md", "repo_id": "openmultiplayer", "token_count": 641 }
436
--- title: "Компенсация лагов" descripion: Описание учитывания (компенсации) лагов. --- Компенсация лагов для выстреленных пуль включена по умолчанию, начиная с серверной версии SA-MP 0.3z. Статус может быть изменён в параметре `lagcompmode` в [server.cfg](server.cfg). Установив настройку на 0, это отключит лагокомпенсацию полностью и игроки будут вынуждены стрелять на упреждение при лагах, а не по скину цели. Отключение компенсации лагов приведёт к прекращению срабатывания коллбэка [OnPlayerWeaponShot](../callbacks/OnPlayerWeaponShot) при стрельбе. Данная настройка может быть изменена только в [server.cfg](server.cfg).
openmultiplayer/web/docs/translations/ru/server/LagCompenstaion.md/0
{ "file_path": "openmultiplayer/web/docs/translations/ru/server/LagCompenstaion.md", "repo_id": "openmultiplayer", "token_count": 579 }
437
--- title: OnIncomingConnection description: Ta "callback" se pokliče, ko se naslov IP poskuša povezati s strežnikom. tags: [] --- ## Opis Ta "callback" se pokliče, ko se naslov IP poskuša povezati s strežnikom. Če želite blokirati dohodne povezave, uporabite "BlockIpAddress". | Ime | Opis | | ------------ | ----------------------------------------------- | | playerid | ID predvajalnika, ki se poskuša povezati | | ip_address[] | Naslov IP predvajalnika, ki se poskuša povezati | | port | "Port" so poskusila povezavo | ## Returns 1 - Preprečil bo druge "filterscript" to prejmem "callback". 0 -Pomeni, da bo ta "callback" se posreduje na naslednjo "filterscript". Vedno je bila povabljena prva v "filterscript". ## Primeri ```c public OnIncomingConnection(playerid, ip_address[], port) { printf(Dohodna povezava iz ID-ja igralca %i [IP/port: %s:%i]", playerid, ip_address, port); return 1; } ``` ## Povezane Funkcijo - [BlockIpAddress](../functions/BlockIpAddress.md): Blokirajte naslov IP, da se določen čas ne poveže s strežnikom. - [UnBlockIpAddress](../functions/UnBlockIpAddress.md): Odblokirajte IP, ki ste ga prej blokirali.
openmultiplayer/web/docs/translations/sl/scripting/callbacks/OnIncomingConnection.md/0
{ "file_path": "openmultiplayer/web/docs/translations/sl/scripting/callbacks/OnIncomingConnection.md", "repo_id": "openmultiplayer", "token_count": 555 }
438
--- title: CreatePickup description: Ova funkcija radi isto sto i AddStaticPickup, osim sto vraca ID pickup-a koji mozemo da pratimo pod OnPlayerPickUpPickup ili da ga unistimo. tags: [] --- ## Opis Ova funkcija radi isto sto i AddStaticPickup, osim sto vraca ID pickup-a koji mozemo da pratimo pod OnPlayerPickUpPickup ili da ga unistimo. | Ime | Opis | | ------------ | ------------------------------------------------------------------------------- | | model | Model pickup-a | | type | Spawn tip pickup-a | | Float:X | X koordinata gde se pickup kreira | | Float:Y | Y koordinata gde se pickup kreira | | Float:Z | Z koordinata gde se pickup kreira | | virtualworld | Virtuelni svet pickup-a. Koristite -1 da bi se pickup pokazao u svim svetovima. | ## Vraca ID kreiranog pickup-a, ili -1 ako ne uspe da ga kreira (pickup max limit). ## Primeri ```c new pickup; // Kreiramo varijablu gde cemo drzati ID pickup-a public OnGameModeInit() { pickup = CreatePickup(1242, 2, 1503.3359, 1432.3585, 10.1191, -1); // Kreiramo pickup za armor i sacuvamo ID pickup-a u varijablu pickup return 1; } // Kasnije.. DestroyPickup(pickup); // Primer koriscenja ID-a pickup-a ( unistavamo pickup ) pickup = 0; // pickup varijabla se mora resetovati da bi se izbeglo mesanje sa ostalim ``` ## Beleske :::tip Jedini tip pickup-a koji moze da se pokupi iz unutrasnjosti vozila je 14 ( osim par specijalnih pickup-ova kao sto su bribes). Pickup-ovi su prikazani svima i mogu se pokupiti od strane svih igraca. Moguce je da, ako se DestroyPickup() koristi kada se pickup pokupio, vise od jednog igraca moze da pokupi pickup, zbog lag-a. Ovo moze da se izbegne koristeci varijable. Neki pickup-ovi dolaze sa 'automatskim odgovorom', na primer M4 model ce automatski dati igracu oruzije i malo municije. Za potpuno skriptovane pickup-ove, tip 1 bi trebalo da se koristi. ::: :::warning Poznati bagovi: Pickup-ovi koji imaju X ili Y manji od -4096.0 ili veci od 4096.0 se nece prikazati i nece izazvati OnPlayerPickUpPickup. ::: ## Srodne Funkcije - [AddStaticPickup](AddStaticPickup.md): Doda statican pickup. - [DestroyPickup](DestroyPickup.md): Unistava pickup. - [OnPlayerPickUpPickup](../callbacks/OnPlayerPickUpPickup.md): Poziva se kada igrac pokupi pickup.
openmultiplayer/web/docs/translations/sr/scripting/functions/CreatePickup.md/0
{ "file_path": "openmultiplayer/web/docs/translations/sr/scripting/functions/CreatePickup.md", "repo_id": "openmultiplayer", "token_count": 1245 }
439
--- title: OnFilterScriptInit description: Callback นี้ถูกเรียกเมื่อฟิลเตอร์สคริปต์เริ่มต้นทำงาน (โหลด) tags: [] --- ## คำอธิบาย Callback นี้ถูกเรียกเมื่อฟิลเตอร์สคริปต์เริ่มต้นทำงาน (โหลด) มันถูกเรียกเฉพาะในฟิลเตอร์สคริปต์ที่กำลังเริ่มต้นทำงาน | ชื่อ | คำอธิบาย | | ---- | -------- | ## ตัวอย่าง ```c public OnFilterScriptInit() { print("\n--------------------------------------"); print("Filterscript ได้เริ่มทำงานแล้ว"); print("--------------------------------------\n"); return 1; } ``` ## ฟังก์ชั่นที่เกี่ยวข้องกัน
openmultiplayer/web/docs/translations/th/scripting/callbacks/OnFilterScriptInit.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/callbacks/OnFilterScriptInit.md", "repo_id": "openmultiplayer", "token_count": 554 }
440
--- title: OnPlayerEnterRaceCheckpoint description: This callback is called when a player enters a race checkpoint. tags: ["player", "checkpoint", "racecheckpoint"] --- ## คำอธิบาย This callback is called when a player enters a race checkpoint. | Name | Description | | -------- | ----------------------------------------------------- | | playerid | The ID of the player who entered the race checkpoint. | ## ส่งคืน มันถูกเรียกในฟิลเตอร์สคริปต์ก่อนเสมอ ## ตัวอย่าง ```c public OnPlayerEnterRaceCheckpoint(playerid) { printf("Player %d entered a race checkpoint!", playerid); return 1; } ``` ## บันทึก :::tip NPC สามารถเรียก Callback นี้ได้ ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [SetPlayerCheckpoint](../../scripting/functions/SetPlayerCheckpoint.md): Create a checkpoint for a player. - [DisablePlayerCheckpoint](../../scripting/functions/DisablePlayerCheckpoint.md): Disable the player's current checkpoint. - [IsPlayerInCheckpoint](../../scripting/functions/IsPlayerInRaceCheckpoint.md): Check if a player is in a checkpoint. - [SetPlayerRaceCheckpoint](../../scripting/functions/SetPlayerRaceCheckpoint.md): Create a race checkpoint for a player. - [DisablePlayerRaceCheckpoint](../../scripting/functions/DisablePlayerRaceCheckpoint.md): Disable the player's current race checkpoint. - [IsPlayerInRaceCheckpoint](../../scripting/functions/IsPlayerInRaceCheckpoint.md): Check if a player is in a race checkpoint.
openmultiplayer/web/docs/translations/th/scripting/callbacks/OnPlayerEnterRaceCheckpoint.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/callbacks/OnPlayerEnterRaceCheckpoint.md", "repo_id": "openmultiplayer", "token_count": 633 }
441
--- title: OnPlayerSelectObject description: This callback is called when a player selects an object after SelectObject has been used. tags: ["player"] --- ## คำอธิบาย This callback is called when a player selects an object after SelectObject has been used. | Name | Description | | -------- | ---------------------------------------------------------- | | playerid | The ID of the player that selected an object | | type | The [type](../resources/selectobjecttypes.md) of selection | | objectid | The ID of the selected object | | modelid | The model of the selected object | | Float:fX | The X position of the selected object | | Float:fY | The Y position of the selected object | | Float:fZ | The Z position of the selected object | ## ส่งคืน 1 - Will prevent other scripts from receiving this callback. 0 - Indicates that this callback will be passed to the next script. มันถูกเรียกในฟิลเตอร์สคริปต์ก่อนเสมอ ## ตัวอย่าง ```c public OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ) { printf("Player %d selected object %d", playerid, objectid); if (type == SELECT_OBJECT_GLOBAL_OBJECT) { EditObject(playerid, objectid); } else { EditPlayerObject(playerid, objectid); } SendClientMessage(playerid, 0xFFFFFFFF, "You now are able to edit your object!"); return 1; } ``` ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [SelectObject](../../scripting/functions/SelectObject.md): Select an object.
openmultiplayer/web/docs/translations/th/scripting/callbacks/OnPlayerSelectObject.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/callbacks/OnPlayerSelectObject.md", "repo_id": "openmultiplayer", "token_count": 780 }
442
--- title: OnVehicleDeath description: This callback is called when a vehicle is destroyed - either by exploding or becoming submerged in water. tags: ["vehicle"] --- ## คำอธิบาย This callback is called when a vehicle is destroyed - either by exploding or becoming submerged in water. | Name | Description | | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | | vehicleid | The ID of the vehicle that was destroyed. | | killerid | The ID of the player that reported (synced) the vehicle's destruction (name is misleading). Generally the driver or a passenger (if any) or the closest player. | ## ส่งคืน มันถูกเรียกในฟิลเตอร์สคริปต์ก่อนเสมอ ## ตัวอย่าง ```c public OnVehicleDeath(vehicleid, killerid) { new string[64]; format(string, sizeof(string), "Vehicle %i was destroyed. Reported by player %i.", vehicleid, killerid); SendClientMessageToAll(0xFFFFFFFF, string); return 1; } ``` ## บันทึก :::tip This callback will also be called when a vehicle enters water, but the vehicle can be saved from destruction by teleportation or driving out (if only partially submerged). The callback won't be called a second time, and the vehicle may disappear when the driver exits, or after a short time. ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [SetVehicleHealth](../../scripting/functions/SetVehicleHealth.md): Set the health of a vehicle.
openmultiplayer/web/docs/translations/th/scripting/callbacks/OnVehicleDeath.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/callbacks/OnVehicleDeath.md", "repo_id": "openmultiplayer", "token_count": 795 }
443
--- title: AddStaticVehicleEx description: Adds a 'static' vehicle (models are pre-loaded for players)to the gamemode. tags: ["vehicle"] --- ## คำอธิบาย Adds a 'static' vehicle (models are pre-loaded for players)to the gamemode. Differs from AddStaticVehicle in only one way: allows a respawn time to be set for when the vehicle is left unoccupied by the driver. | Name | Description | | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | | modelid | The Model ID for the vehicle. | | Float:spawn_X | The X-coordinate for the vehicle. | | Float:spawn_Y | The Y-coordinate for the vehicle. | | Float:spawn_Z | The Z-coordinate for the vehicle. | | Float:z_angle | The facing - angle for the vehicle. | | [color1](../../scripting/resources/vehiclecolorid.md) | The primary color ID. | | [color2](../../scripting/resources/vehiclecolorid.md) | The secondary color ID. | | respawn_delay | The delay until the car is respawned without a driver, in seconds. | | addsiren | Has a default value 0. Enables the vehicle to have a siren, providing the vehicle has a horn. | ## ส่งคืน The vehicle ID of the vehicle created (1 - MAX_VEHICLES). INVALID_VEHICLE_ID (65535) if vehicle was not created (vehicle limit reached or invalid vehicle model ID passed). ## ตัวอย่าง ```c public OnGameModeInit() { // Add a Hydra (520) to the game that will respawn 15 seconds after being left AddStaticVehicleEx (520, 2109.1763, 1503.0453, 32.2887, 82.2873, -1, -1, 15); return 1; } ``` ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [AddStaticVehicle](../../scripting/functions/AddStaticVehicle.md): Add a static vehicle. - [CreateVehicle](../../scripting/functions/CreateVehicle.md): Create a vehicle.
openmultiplayer/web/docs/translations/th/scripting/functions/AddStaticVehicleEx.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/AddStaticVehicleEx.md", "repo_id": "openmultiplayer", "token_count": 1960 }
444
--- title: AttachTrailerToVehicle description: Attach a vehicle to another vehicle as a trailer. tags: ["vehicle"] --- ## คำอธิบาย Attach a vehicle to another vehicle as a trailer. | Name | Description | | --------- | ------------------------------------------------- | | trailerid | The ID of the vehicle that will be pulled. | | vehicleid | The ID of the vehicle that will pull the trailer. | ## ส่งคืน This function always returns 1, even if neither of the vehicle IDs passed are valid. ## ตัวอย่าง ```c new vehicleid = CreateVehicle(...); new trailerid = CreateVehicle(...); AttachTrailerToVehicle(trailerid, vehicleid); ``` ## บันทึก :::warning This will only work if both vehicles are streamed in for a player (check IsVehicleStreamedIn). ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [DetachTrailerFromVehicle](../../scripting/functions/DetachTrailerFromVehicle.md): Detach a trailer from a vehicle. - [IsTrailerAttachedToVehicle](../../scripting/functions/IsTrailerAttachedToVehicle.md): Check if a trailer is attached to a vehicle. - [GetVehicleTrailer](../../scripting/functions/GetVehicleTrailer.md): Check what trailer a vehicle is pulling.
openmultiplayer/web/docs/translations/th/scripting/functions/AttachTrailerToVehicle.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/AttachTrailerToVehicle.md", "repo_id": "openmultiplayer", "token_count": 480 }
445
--- title: CreateExplosionForPlayer description: Creates an explosion that is only visible to a single player. tags: ["player"] --- ## คำอธิบาย Creates an explosion that is only visible to a single player. This can be used to isolate explosions from other players or to make them only appear in specific virtual worlds. | Name | Description | | ------------ | -------------------------------------------------------- | | playerid | The ID of the player to create the explosion for. | | Float:X | The X coordinate of the explosion. | | Float:Y | The Y coordinate of the explosion. | | Float:Z | The Z coordinate of the explosion. | | type | The [type](../resources/explosionlist) of the explosion. | | Float:radius | The radius of the explosion. | ## ส่งคืน This function always returns 1, even if the function failed to excute (player doesn't exist, invalid radius, or invalid explosion type). ## ตัวอย่าง ```c if (strcmp(cmdtext, "/burnme", true) == 0) { new Float:POS[3]; GetPlayerPos(playerid, POS[0], POS[1], POS[2]); CreateExplosionForPlayer(playerid, POS[0], POS[1], POS[2], 1, 10.0); return 1; } ``` ## บันทึก :::tip There is a limit as to how many explosions can be seen at once by a player. This is roughly 10. ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [CreateExplosion](CreateExplosion.md): Create an explosion which is visible for all players. - [Explosion Types](explosionlist): A list of all the explosion types.
openmultiplayer/web/docs/translations/th/scripting/functions/CreateExplosionForPlayer.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/CreateExplosionForPlayer.md", "repo_id": "openmultiplayer", "token_count": 693 }
446
--- title: DestroyPlayerObject description: Destroy a player-object created using CreatePlayerObject. tags: ["player"] --- ## คำอธิบาย Destroy a player-object created using CreatePlayerObject. | Name | Description | | -------- | ----------------------------------------------------------------------- | | playerid | The ID of the player whose player-object to destroy. | | objectid | The ID of the player-object to destroy. Returned by CreatePlayerObject. | ## ส่งคืน This function does not return any specific values. ## ตัวอย่าง ```c public OnPlayerObjectMoved(playerid, objectid) { DestroyPlayerObject(playerid, objectid); return 1; } ``` ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [CreatePlayerObject](../../scripting/functions/CreatePlayerObject.md): Create an object for only one player. - [IsValidPlayerObject](../../scripting/functions/IsValidPlayerObject.md): Checks if a certain player object is vaild. - [MovePlayerObject](../../scripting/functions/MovePlayerObject.md): Move a player object. - [StopPlayerObject](../../scripting/functions/StopPlayerObject.md): Stop a player object from moving. - [SetPlayerObjectPos](../../scripting/functions/SetPlayerObjectPos.md): Set the position of a player object. - [SetPlayerObjectRot](../../scripting/functions/SetPlayerObjectRot.md): Set the rotation of a player object. - [GetPlayerObjectPos](../../scripting/functions/GetPlayerObjectPos.md): Locate a player object. - [GetPlayerObjectRot](../../scripting/functions/GetPlayerObjectRot.md): Check the rotation of a player object. - [AttachPlayerObjectToPlayer](../../scripting/functions/AttachPlayerObjectToPlayer.md): Attach a player object to a player. - [CreateObject](../../scripting/functions/CreateObject.md): Create an object. - [DestroyObject](../../scripting/functions/DestroyObject.md): Destroy an object. - [IsValidObject](../../scripting/functions/IsValidObject.md): Checks if a certain object is vaild. - [MoveObject](../../scripting/functions/MoveObject.md): Move an object. - [StopObject](../../scripting/functions/StopObject.md): Stop an object from moving. - [SetObjectPos](../../scripting/functions/SetObjectPos.md): Set the position of an object. - [SetObjectRot](../../scripting/functions/SetObjectRot.md): Set the rotation of an object. - [GetObjectPos](../../scripting/functions/GetObjectPos.md): Locate an object. - [GetObjectRot](../../scripting/functions/GetObjectRot.md): Check the rotation of an object. - [AttachObjectToPlayer](../../scripting/functions/AttachObjectToPlayer.md): Attach an object to a player.
openmultiplayer/web/docs/translations/th/scripting/functions/DestroyPlayerObject.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/DestroyPlayerObject.md", "repo_id": "openmultiplayer", "token_count": 887 }
447
--- title: EnableTirePopping description: With this function you can enable or disable tire popping. tags: [] --- ## คำอธิบาย With this function you can enable or disable tire popping. | Name | Description | | ---- | --------------------------------------- | | show | 1 to enable, 0 to disable tire popping. | ## ส่งคืน This function does not return any specific values. ## ตัวอย่าง ```c public OnGameModeInit() { // This will disable tire popping on your gamemode. EnableTirePopping(0); return 1; } ``` ## บันทึก :::warning This function was removed in SA-MP 0.3. Tire popping is enabled by default. If you want to disable tire popping, you'll have to manually script it using OnVehicleDamageStatusUpdate. ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน
openmultiplayer/web/docs/translations/th/scripting/functions/EnableTirePopping.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/EnableTirePopping.md", "repo_id": "openmultiplayer", "token_count": 344 }
448
--- title: GangZoneShowForPlayer description: Show a gangzone for a player. tags: ["player", "gangzone"] --- ## คำอธิบาย Show a gangzone for a player. Must be created with GangZoneCreate first. | Name | Description | | -------- | --------------------------------------------------------------------------------------------------------- | | playerid | The ID of the player you would like to show the gangzone for.. | | zone | The ID of the gang zone to show for the player. Returned by GangZoneCreate | | color | The color to show the gang zone, as an integer or hex in RGBA color format. Alpha transparency supported. | ## ส่งคืน 1 if the gangzone was shown, otherwise 0 (non-existant). ## ตัวอย่าง ```c new Zone; public OnGameModeInit() { Zone = GangZoneCreate(1082.962, -2787.229, 2942.549, -1859.51); return 1; } public OnPlayerSpawn(playerid) { GangZoneShowForPlayer(playerid, Zone, 0xFFFF0096); return 1; } ``` ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [GangZoneCreate](../functions/GangZoneCreate): Create a gangzone. - [GangZoneDestroy](../functions/GangZoneDestroy): Destroy a gangzone. - [GangZoneShowForPlayer](../functions/GangZoneShowForPlayer): Show a gangzone for a player. - [GangZoneHideForPlayer](../functions/GangZoneHideForPlayer): Hide a gangzone for a player. - [GangZoneHideForAll](../functions/GangZoneHideForAll): Hide a gangzone for all players. - [GangZoneFlashForPlayer](../functions/GangZoneFlashForPlayer): Make a gangzone flash for a player. - [GangZoneFlashForAll](../functions/GangZoneFlashForAll): Make a gangzone flash for all players. - [GangZoneStopFlashForPlayer](../functions/GangZoneStopFlashForPlayer): Stop a gangzone flashing for a player. - [GangZoneStopFlashForAll](../functions/GangZoneStopFlashForAll): Stop a gangzone flashing for all players.
openmultiplayer/web/docs/translations/th/scripting/functions/GangZoneShowForPlayer.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/GangZoneShowForPlayer.md", "repo_id": "openmultiplayer", "token_count": 808 }
449
--- title: GetObjectModel description: Get the model ID of an object (CreateObject). tags: [] --- :::warning ฟังก์ชั่นนี้ถูกเพิ่มใน SA-MP 0.3.7 และจะไม่ทำงานในเวอร์ชั่นก่อนหน้านี้! ::: ## คำอธิบาย Get the model ID of an object (CreateObject). | Name | Description | | -------- | ---------------------------------------- | | objectid | The ID of the object to get the model of | ## ส่งคืน The model ID of the object. -1 if object does not exist. ## ตัวอย่าง ```c new objectid = CreateObject(1234, 0, 0, 0, 0, 0, 0); new modelid = GetObjectModel(objectid); ``` ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [GetPlayerObjectModel](../functions/GetPlayerObjectModel): Get the model ID of a player-object.
openmultiplayer/web/docs/translations/th/scripting/functions/GetObjectModel.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/GetObjectModel.md", "repo_id": "openmultiplayer", "token_count": 437 }
450
--- title: GetPlayerCameraPos description: Get the position of the player's camera. tags: ["player"] --- ## คำอธิบาย Get the position of the player's camera. | Name | Description | | -------- | ------------------------------------------------------------------- | | playerid | The ID of the player to get the camera position of. | | Float:x | A float variable to store the X coordinate in, passed by reference. | | Float:y | A float variable to store the Y coordinate in, passed by reference. | | Float:z | A float variable to store the Z coordinate in, passed by reference. | ## ส่งคืน The player's position is stored in the specified variables. ## ตัวอย่าง ```c public OnPlayerDisconnect(playerid) { new Float:x, Float:y, Float:z; GetPlayerCameraPos(playerid, x, y, z); printf("The player left when they had their camera at %f,%f,%f.", x, y, z); // You could write this to a userfile. return 1; } ``` ## บันทึก :::warning Player's camera positions are only updated once a second, unless aiming.It is recommended to set a 1 second timer if you wish to take action that relies on a player's camera position. ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [SetPlayerCameraPos](../functions/SetPlayerCameraPos): Set a player's camera position. - [GetPlayerCameraZoom](../functions/GetPlayerCameraZoom): Get the zoom level of a player's camera. - [GetPlayerCameraAspectRatio](../functions/GetPlayerCameraAspectRation): Get the aspect ratio of a player's camera. - [GetPlayerCameraMode](../functions/GetplayerCameraMode): Get a player's camera mode. - [GetPlayerCameraFrontVector](../functions/GetPlayerCameraFrontVector): Get the player's camera front vector
openmultiplayer/web/docs/translations/th/scripting/functions/GetPlayerCameraPos.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/GetPlayerCameraPos.md", "repo_id": "openmultiplayer", "token_count": 647 }
451
--- title: GetPlayerKeys description: Check which keys a player is pressing. tags: ["player"] --- ## คำอธิบาย Check which keys a player is pressing. | Name | Description | | --------- | ------------------------------------------------------------------------------------------------------------------------- | | playerid | The ID of the player to get the keys of. | | keys | A set of bits containing the player's key states. This value is what is called a bit mask. Click here for a list of keys. | | updown | Up/down state. | | leftright | Left/right state. | ## ส่งคืน The keys are stored in the specified variables. ## ตัวอย่าง ```c public OnPlayerUpdate(playerid) { new KEY:keys, updown, leftright; GetPlayerKeys(playerid, keys, updown, leftright); if (updown == KEY_UP) { SendClientMessage(playerid, -1, "UP"); } else if (updown == KEY_DOWN) { SendClientMessage(playerid, -1, "DOWN"); } if (leftright == KEY_LEFT) { SendClientMessage(playerid, -1, "LEFT"); } else if (leftright == KEY_RIGHT) { SendClientMessage(playerid, -1, "RIGHT"); } return 1; } ``` ## บันทึก :::warning Only the FUNCTION of keys can be detected; not actual keys. For example, it is not possible to detect if a player presses SPACE, but you can detect if they press SPRINT (which can be mapped (assigned/binded) to ANY key (but is space by default)). As of update 0.3.7, the keys "A" and "D" are not recognized when in a vehicle. However, keys "W" and "S" can be detected with the "keys" parameter. ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน
openmultiplayer/web/docs/translations/th/scripting/functions/GetPlayerKeys.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/GetPlayerKeys.md", "repo_id": "openmultiplayer", "token_count": 1048 }
452
--- title: GetPlayerState description: Get a player's current state. tags: ["player"] --- ## คำอธิบาย Get a player's current state. | Name | Description | | -------- | ------------------------------------------------- | | playerid | The ID of the player to get the current state of. | ## ส่งคืน The player's current state as an integer (see: [Player States](../../scripting/resources/playerstates.md)). ## ตัวอย่าง ```c public OnPlayerDeath(playerid, killerid, WEAPON:reason) { new playerState = GetPlayerState(killerid); // Get the killer's state if (playerState == PLAYER_STATE_DRIVER) // If the killer was in a vehicle { //It's a driver drive-by, take some money GivePlayerMoney(killerid, -10000); } return 1; } ``` ## ฟังก์ชั่นที่เกี่ยวข้องกัน - GetPlayerSpecialAction: Get a player's current special action. - SetPlayerSpecialAction: Set a player's special action. - OnPlayerStateChange: Called when a player changes state.
openmultiplayer/web/docs/translations/th/scripting/functions/GetPlayerState.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/GetPlayerState.md", "repo_id": "openmultiplayer", "token_count": 424 }
453
--- title: GetSVarFloat description: Gets a float server variable's value. tags: [] --- :::warning This function was added in SA-MP 0.3.7 R2 and will not work in earlier versions! ::: ## คำอธิบาย Gets a float server variable's value. | Name | Description | | ------- | ----------------------------------------------------------------------------- | | varname | The name of the server variable (case-insensitive). Assigned in SetSVarFloat. | ## ส่งคืน The float value of the specified server variable. It will still return 0 if the variable is not set. ## ตัวอย่าง ```c // set "Version" SetSVarFloat("Version", 0.37); // will print version that server has printf("Version: %f", GetSVarFloat("Version")); ``` ## ฟังก์ชั่นที่เกี่ยวข้องกัน - SetSVarInt: Set an integer for a server variable. - GetSVarInt: Get a player server as an integer. - SetSVarString: Set a string for a server variable. - GetSVarString: Get the previously set string from a server variable. - SetSVarFloat: Set a float for a server variable. - DeleteSVar: Delete a server variable.
openmultiplayer/web/docs/translations/th/scripting/functions/GetSVarFloat.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/GetSVarFloat.md", "repo_id": "openmultiplayer", "token_count": 452 }
454
--- title: GetVehicleModel description: Gets the model ID of a vehicle. tags: ["vehicle"] --- ## คำอธิบาย Gets the model ID of a vehicle. | Name | Description | | --------- | ------------------------------------------ | | vehicleid | The ID of the vehicle to get the model of. | ## ส่งคืน The vehicle's model ID, or 0 if the vehicle doesn't exist. ## ตัวอย่าง ```c public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { if (GetVehicleModel(vehicleid) == 411) // 411 is the Infernus model { SendClientMessage(playerid, 0xFFFFFFFF, "Nice Infernus!"); } return 1; } ``` ## ฟังก์ชั่นที่เกี่ยวข้องกัน - GetPlayerVehicleID: Get the ID of the vehicle the player is in. - GetVehiclePos: Get the position of a vehicle. - GetVehicleZAngle: Check the current angle of a vehicle. - GetPlayerVehicleSeat: Check what seat a player is in.
openmultiplayer/web/docs/translations/th/scripting/functions/GetVehicleModel.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/GetVehicleModel.md", "repo_id": "openmultiplayer", "token_count": 402 }
455
--- title: HTTP description: Sends a threaded HTTP request. tags: [] --- ## คำอธิบาย Sends a threaded HTTP request. | Name | Description | | ---------- | ------------------------------------------------------------------------------------------- | | index | ID used to differentiate requests that are sent to the same callback (useful for playerids) | | type | The type of request you wish to send. | | url[] | The URL you want to request. (Without 'http://') | | data[] | Any POST data you want to send with the request. | | callback[] | Name of the callback function you want to use to handle responses to this request. | ## ส่งคืน 1 on success, 0 on failure ## ตัวอย่าง ```c forward MyHttpResponse(index, response_code, data[]); public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp("/hello",cmdtext,true)) { HTTP(playerid, HTTP_GET, "kc.gd/hello.txt", "", "MyHttpResponse"); return 1; } return 0; } public MyHttpResponse(index, response_code, data[]) { // In this callback "index" would normally be called "playerid" ( if you didn't get it already:) ) new buffer[ 128 ]; if (response_code == 200) //Did the request succeed? { //Yes! format(buffer, sizeof(buffer), "The URL replied: %s", data); SendClientMessage(index, 0xFFFFFFFF, buffer); } else { //No! format(buffer, sizeof(buffer), "The request failed! The response code was: %d", response_code); SendClientMessage(index, 0xFFFFFFFF, buffer); } } ``` ``` HTTP_ERROR_BAD_HOST (1) HTTP_ERROR_NO_SOCKET (2) HTTP_ERROR_CANT_CONNECT (3) HTTP_ERROR_CANT_WRITE (4) HTTP_ERROR_CONTENT_TOO_BIG (5) HTTP_ERROR_MALFORMED_RESPONSE (6) ``` ## บันทึก :::tip As well as the response codes listed above, there are also all of the typical HTTP responses such as 404 (Page not found), 500 (Server error) or 403 (forbidden) ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน
openmultiplayer/web/docs/translations/th/scripting/functions/HTTP.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/HTTP.md", "repo_id": "openmultiplayer", "token_count": 1063 }
456
--- title: IsPlayerObjectMoving description: Checks if the given player objectid is moving. tags: ["player"] --- :::warning This function was added in SA-MP 0.3d and will not work in earlier versions! ::: ## คำอธิบาย Checks if the given player objectid is moving. | Name | Description | | -------- | ---------------------------------------------------- | | playerid | The ID of the player whose player-object is checked. | | objectid | The player objectid you want to check if is moving. | ## ส่งคืน 1 if the player object is moving, 0 if not. ## ตัวอย่าง ```c if (IsPlayerObjectMoving(playerid, objectid)) { StopPlayerObject(playerid, objectid); } ``` ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [CreatePlayerObject](../../scripting/functions/CreatePlayerObject.md): Create an object for only one player. - [DestroyPlayerObject](../../scripting/functions/DestroyPlayerObject.md): Destroy a player object. - [IsValidPlayerObject](../../scripting/functions/IsValidPlayerObject.md): Checks if a certain player object is vaild. - [MovePlayerObject](../../scripting/functions/MovePlayerObject.md): Move a player object. - [StopPlayerObject](../../scripting/functions/StopPlayerObject.md): Stop a player object from moving. - [SetPlayerObjectPos](../../scripting/functions/SetPlayerObjectPos.md): Set the position of a player object. - [SetPlayerObjectRot](../../scripting/functions/SetPlayerObjectRot.md): Set the rotation of a player object. - [GetPlayerObjectPos](../../scripting/functions/GetPlayerObjectPos.md): Locate a player object. - [GetPlayerObjectRot](../../scripting/functions/GetPlayerObjectRot.md): Check the rotation of a player object. - [AttachPlayerObjectToPlayer](../../scripting/functions/AttachObjectToPlayer.md): Attach a player object to a player. - [CreateObject](../../scripting/functions/CreateObject.md): Create an object. - [DestroyObject](../../scripting/functions/DestroyObject.md): Destroy an object. - [IsValidObject](../../scripting/functions/IsValidObject.md): Checks if a certain object is vaild. - [MoveObject](../../scripting/functions/MoveObject.md): Move an object. - [IsObjectMoving](../../scripting/functions/IsObjectMoving.md): Check if the object is moving. - [StopObject](../../scripting/functions/StopObject.md): Stop an object from moving. - [SetObjectPos](../../scripting/functions/SetObjectPos.md): Set the position of an object. - [SetObjectRot](../../scripting/functions/SetObjectRot.md): Set the rotation of an object. - [GetObjectPos](../../scripting/functions/GetObjectPos.md): Locate an object. - [GetObjectRot](../../scripting/functions/GetObjectRot.md): Check the rotation of an object. - [AttachObjectToPlayer](../../scripting/functions/AttachObjectToPlayer.md): Attach an object to a player. - [OnPlayerObjectMoved](../../scripting/callbacks/OnPlayerObjectMoved.md): Called when a player-object stops moving.
openmultiplayer/web/docs/translations/th/scripting/functions/IsPlayerObjectMoving.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/IsPlayerObjectMoving.md", "repo_id": "openmultiplayer", "token_count": 957 }
457
--- title: NetStats_BytesReceived description: Gets the amount of data (in bytes) that the server has received from the player. tags: [] --- ## คำอธิบาย Gets the amount of data (in bytes) that the server has received from the player. | Name | Description | | -------- | ------------------------------------------ | | playerid | The ID of the player to get the data from. | ## ส่งคืน This function returns the number of bytes the server has received from the player. 0 is returned if the player is not connected. ## ตัวอย่าง ```c public OnPlayerCommandText(playerid,cmdtext[]) { if (!strcmp(cmdtext, "/bytesreceived")) { new szString[144]; format(szString, sizeof(szString), "You have sent %i bytes of information to the server.", NetStats_BytesReceived(playerid)); SendClientMessage(playerid, -1, szString); } return 1; } ``` ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [GetPlayerNetworkStats](../functions/GetPlayerNetworkStats.md): Gets a player networkstats and saves it into a string. - [GetNetworkStats](../functions/GetNetworkStats.md): Gets the servers networkstats and saves it into a string. - [NetStats_GetConnectedTime](../functions/NetStats_GetConnectedTime.md): Get the time that a player has been connected for. - [NetStats_MessagesReceived](../functions/NetStats_MessagesReceived.md): Get the number of network messages the server has received from the player. - [NetStats_MessagesSent](../functions/NetStats_MessagesSent.md): Get the number of network messages the server has sent to the player. - [NetStats_BytesSent](../functions/NetStats_BytesSent.md): Get the amount of information (in bytes) that the server has sent to the player. - [NetStats_MessagesRecvPerSecond](../functions/NetStats_MessagesRecvPerSecond.md): Get the number of network messages the server has received from the player in the last second. - [NetStats_PacketLossPercent](../functions/NetStats_PacketLossPercent.md): Get a player's packet loss percent. - [NetStats_ConnectionStatus](../functions/NetStats_ConnectionStatus.md): Get a player's connection status. - [NetStats_GetIpPort](../functions/NetStats_GetIpPort.md): Get a player's IP and port.
openmultiplayer/web/docs/translations/th/scripting/functions/NetStats_BytesReceived.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/NetStats_BytesReceived.md", "repo_id": "openmultiplayer", "token_count": 756 }
458
--- title: PlayerTextDrawUseBox description: Toggle the box on a player-textdraw. tags: ["player", "textdraw", "playertextdraw"] --- ## คำอธิบาย Toggle the box on a player-textdraw. | Name | Description | |-----------------|----------------------------------------------------------| | playerid | The ID of the player whose textdraw to toggle the box of | | PlayerText:text | The ID of the player-textdraw to toggle the box of | | bool:use | **true** to use a box or **false** to not use a box | ## ส่งคืน This function does not return any specific values. ## ตัวอย่าง ```c new PlayerText:MyTD[MAX_PLAYERS]; public OnPlayerConnect(playerid) { MyTD[playerid] = CreatePlayerTextDraw(playerid, 40.0, 140.0, "_~N~Example text!~N~_"); PlayerTextDrawUseBox(playerid, MyTD[playerid], true); PlayerTextDrawBoxColor(playerid, MyTD[playerid], 0x00000066); // Set the box color to a semi-transparent black return 1; } ``` ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [CreatePlayerTextDraw](CreatePlayerTextDraw): Create a player-textdraw. - [PlayerTextDrawDestroy](PlayerTextDrawDestroy): Destroy a player-textdraw. - [PlayerTextDrawIsBox](PlayerTextDrawIsBox): Checks if a player-textdraw is box. - [PlayerTextDrawColor](PlayerTextDrawColor): Set the color of the text in a player-textdraw. - [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): Set the color of a player-textdraw's box. - [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): Set the background color of a player-textdraw. - [PlayerTextDrawAlignment](PlayerTextDrawAlignment): Set the alignment of a player-textdraw. - [PlayerTextDrawFont](PlayerTextDrawFont): Set the font of a player-textdraw. - [PlayerTextDrawLetterSize](PlayerTextDrawLetterSize): Set the letter size of the text in a player-textdraw. - [PlayerTextDrawTextSize](PlayerTextDrawTextSize): Set the size of a player-textdraw box (or clickable area for PlayerTextDrawSetSelectable). - [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): Toggle the outline on a player-textdraw. - [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): Set the shadow on a player-textdraw. - [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): Scale the text spacing in a player-textdraw to a proportional ratio. - [PlayerTextDrawSetString](PlayerTextDrawSetString): Set the text of a player-textdraw. - [PlayerTextDrawShow](PlayerTextDrawShow): Show a player-textdraw. - [PlayerTextDrawHide](PlayerTextDrawHide): Hide a player-textdraw.
openmultiplayer/web/docs/translations/th/scripting/functions/PlayerTextDrawUseBox.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/PlayerTextDrawUseBox.md", "repo_id": "openmultiplayer", "token_count": 881 }
459