text
stringlengths
1
2.83M
id
stringlengths
16
152
metadata
dict
__index_level_0__
int64
0
949
--- title: listenport description: Sets up the port number to listen at. tags: ["datagram"] --- <LowercaseNote /> :::warning This function is deprecated, Use [HTTP](HTTP) or [pawn-requests](https://github.com/Southclaws/pawn-requests) plugin. ::: ## Description Sets up the port number to listen at. | Name | Description | | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | | port | The number of the port to listen at. This must be a value between 1 and 65535, but you should probably avoid to use any of the reserved port numbers. | ## Return Values This function always returns **0**. ## Notes :::warning - You must call this function **before** receiving the first packet. In other words, you should set up a port in main. - If no port number has been explicitily chosen, the module will listen at port **9930**. ::: ## Related Functions - [@receivestring](@receivestring): A packed was received. - [sendstring](sendstring): Sends a packet containing a string.
openmultiplayer/web/docs/scripting/functions/listenport.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/listenport.md", "repo_id": "openmultiplayer", "token_count": 419 }
324
--- title: strcopy description: Copies a string into the destination string. tags: ["string"] --- <VersionWarn version='omp v1.1.0.2612' /> <LowercaseNote /> ## Description Copies a string into the destination string. | Name | Description | | ------------------------- | --------------------------------------------------- | | dest[] | The string to copy the source string into. | | const source[] | The source string. | | maxlength = sizeof (dest) | The maximum length of the destination. *(optional)* | ## Returns The length of the new destination string. ## Examples ```c new playerName[MAX_PLAYER_NAME]; GetPlayerName(playerid, playerName, MAX_PLAYER_NAME); new string[64]; strcopy(string, playerName); // Copies playerName into string ``` ## Related Functions - [strcat](strcat): Concatenate two strings into a destination reference.
openmultiplayer/web/docs/scripting/functions/strcopy.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/strcopy.md", "repo_id": "openmultiplayer", "token_count": 372 }
325
--- title: valstr description: Convert an integer into a string. tags: ["string"] --- <LowercaseNote /> ## Description Convert an integer into a string. | Name | Description | | ----------------- | ------------------------------------------------- | | dest | The destination of the string. | | value | The value to convert to a string. | | pack *(optional)* | Whether to pack the destination (off by default). | ## Returns This function does not return any specific values. ## Examples ```c new string[4]; new value = 250; valstr(string, value); // string is now "250" ``` ## Notes :::warning Passing a high value to this function can cause the server to freeze/crash. Fixes are available. Below is a fix that can be put straight in to your script (before valstr is used anywhere). [fixes.inc](https://github.com/pawn-lang/sa-mp-fixes) includes this fix. ```c // valstr fix by Slice stock FIX_valstr(dest[], value, bool:pack = false) { // format can't handle cellmin properly 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 ``` ::: ## Related Functions - [strval](strval): Convert a string into an integer. - [strcmp](strcmp): Compare two strings to check if they are the same.
openmultiplayer/web/docs/scripting/functions/valstr.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/valstr.md", "repo_id": "openmultiplayer", "token_count": 558 }
326
--- title: GameText Styles description: GameText Styles used in textdraws and gametext. --- This page covers everything you need to know about gametext styles, and how they can be used in textdraws and in text rendered for a (single) player. Mainly used by [GameText](../functions/GameTextForPlayer) and [GameTextForAll](../functions/GameTextForAll). --- ## Text Colors It is possible to draw certain parts of your text in different colors. To do this, you simply need to use the colour slugs listed below, and encapsulate the part of your text which you want to draw in a specific color (e.g. \~y\~I'm drawn in yellow!\~y\~). | Code | Colour | Description | | -------------------- | -------------------------------------- | ------------------------------------------------ | | N/A | ![](/images/gameTextStyles/-.png) | Default colour, has no code. | | `~h~` | ![](/images/gameTextStyles/h.png) | Lighter version of the default colour. | | `~h~~h~` | ![](/images/gameTextStyles/hh.png) | Lighter version of the default colour. | | `~r~` | ![](/images/gameTextStyles/r.png) | Has five levels of lightening. | | `~r~~h~` | ![](/images/gameTextStyles/rh.png) | | | `~r~~h~~h~` | ![](/images/gameTextStyles/rhh.png) | | | `~r~~h~~h~~h~` | ![](/images/gameTextStyles/rhhh.png) | | | `~r~~h~~h~~h~~h~` | ![](/images/gameTextStyles/rhhhh.png) | | | `~r~~h~~h~~h~~h~~h~` | ![](/images/gameTextStyles/rhhhhh.png) | | | `~g~` | ![](/images/gameTextStyles/g.png) | Has four levels of lightening. | | `~g~~h~` | ![](/images/gameTextStyles/gh.png) | | | `~g~~h~~h~` | ![](/images/gameTextStyles/ghh.png) | | | `~g~~h~~h~~h~` | ![](/images/gameTextStyles/ghhh.png) | | | `~g~~h~~h~~h~~h~` | ![](/images/gameTextStyles/ghhhh.png) | Same as `~y~~h~~h~`. | | `~b~` | ![](/images/gameTextStyles/b.png) | Has three levels of lightening. | | `~b~~h~` | ![](/images/gameTextStyles/bh.png) | | | `~b~~h~~h~` | ![](/images/gameTextStyles/bhh.png) | | | `~b~~h~~h~~h~` | ![](/images/gameTextStyles/bhhh.png) | | | `~p~` | ![](/images/gameTextStyles/p.png) | Has two levels of lightening. | | `~p~~h~` | ![](/images/gameTextStyles/ph.png) | | | `~p~~h~~h~` | ![](/images/gameTextStyles/phh.png) | | | `~y~` | ![](/images/gameTextStyles/y.png) | Has two levels of lightening. | | `~y~~h~` | ![](/images/gameTextStyles/yh.png) | | | `~y~~h~~h~` | ![](/images/gameTextStyles/yhh.png) | Same as `~g~~h~~h~~h~~h~`. | | `~l~` | ![](/images/gameTextStyles/l.png) | Lower case "L". Can't be lightened. | | `~w~ (or ~s~)` | ![](/images/gameTextStyles/w.png) | Has one level of lightening. | | `~w~~h~ (or ~s~~h~)` | ![](/images/gameTextStyles/wh.png) | All colours become this when lightened too much. | --- ## Special Text Letters Unlike text colors, these slugs do not require encapsulation. They can be used as-is. | Code | Description | | ------ | ---------------------------------------------------------------------------------------------------------------------------------- | | `~n~` | New line | | `~h~` | Turn selected colours lighter. Text can appear between the main colour and the lightening, for example `~r~Hello ~h~world` will make "Hello" red and "world" slightly lighter red. | | `~u~` | Up arrow (gray) | | `~d~` | Down arrow (gray) | | `~<~` | Left arrow (gray) | | `~>~` | Right arrow (gray) | | `~]~` | Displays a `*` symbol (Only in text styles 3, 4 and 5) | | `~k~` | Keyboard key mapping (e.g. `~k~~VEHICLE_TURRETLEFT~` and `~k~~PED_FIREWEAPON~`). Look [here](../resources/keys) for a list of keys. | :::caution Be careful, using too many text colors or special characters in one gametext may crash every player the gametext is shown to. Additionally, avoid using an uneven usage of the `~` character. Example: `~~r~Hello, ~g~how are ~y~you?` ::: ## Text Styles You can use the following text styles in game texts. | Style | Preview | Description | | ------- | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | | Style 0 | ![](/images/gameTextStyles/style0.png) | Appears for 9 seconds regardless of time setting. Hides textdraws and any other gametext on screen (fixed in fixes.inc) | | Style 1 | ![](/images/gameTextStyles/style1.png) | Fades out after 8 seconds, regardless of time set. If you have a time setting longer than that, it will re-appear after fading out and repeat until the time ends (fixed in fixes.inc) | | Style 2 | ![](/images/gameTextStyles/style2.png) | N/A | | Style 3 | ![](/images/gameTextStyles/style3.png) | N/A | | Style 4 | ![](/images/gameTextStyles/style4.png) | N/A | | Style 5 | ![](/images/gameTextStyles/style5.png) | Displays for 3 seconds, regardless of what time you set. Will refuse to be shown if it is 'spammed' (fixed in fixes.inc) | | Style 6 | ![](/images/gameTextStyles/style6.png) | N/A | --- ## Text Styles added by [fixes.inc](https://github.com/pawn-lang/sa-mp-fixes) | Style | Preview | Description | | -------- | --------------------------------------- | -------------------------------------------------- | | Style 7 | ![](/images/gameTextStyles/style7.png) | Based on SA vehicle names. | | Style 8 | ![](/images/gameTextStyles/style8.png) | Based on SA location names. | | Style 9 | ![](/images/gameTextStyles/style9.png) | Based on SA radio station names (once selected). | | Style 10 | ![](/images/gameTextStyles/style10.png) | Based on SA radio station names (while switching). | | Style 11 | ![](/images/gameTextStyles/style11.png) | Based on SA positive money. | | Style 12 | ![](/images/gameTextStyles/style12.png) | Based on SA negative money. | | Style 13 | ![](/images/gameTextStyles/style13.png) | Based on SA stunt bonuses. | | Style 14 | ![](/images/gameTextStyles/style14.png) | Based on SA in-game clock. | | Style 15 | ![](/images/gameTextStyles/style15.png) | Based on SA notification popup. |
openmultiplayer/web/docs/scripting/resources/gametextstyles.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/resources/gametextstyles.md", "repo_id": "openmultiplayer", "token_count": 5036 }
327
--- title: Object Edition Response Types --- :::info Here you can find all of the object edition response types used by [OnPlayerEditObject](../callbacks/OnPlayerEditObject). ::: | Value | Definition | Description | |-------|----------------------|------------------------------------------------------------------| | 1 | EDIT_RESPONSE_CANCEL | The player cancelled any modifications by pressing ESC | | 2 | EDIT_RESPONSE_FINAL | The player considers the changes as final and pressed on Save | | 3 | EDIT_RESPONSE_UPDATE | The player simply moved the object (edition did not stop at all) |
openmultiplayer/web/docs/scripting/resources/objecteditionresponsetypes.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/resources/objecteditionresponsetypes.md", "repo_id": "openmultiplayer", "token_count": 236 }
328
--- title: Spectate Modes description: Spectate Modes used by PlayerSpectatePlayer and PlayerSpectateVehicle functions. tags: [] sidebar_label: Spectate Modes --- :::info Spectate Modes used by [PlayerSpectatePlayer](../functions/PlayerSpectatePlayer) and [PlayerSpectateVehicle](../functions/PlayerSpectateVehicle) functions. ::: | Type | Effect | | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | | SPECTATE_MODE_NORMAL | Normal spectate mode (third person point of view). Camera can not be changed | | SPECTATE_MODE_FIXED | Use [SetPlayerCameraPos](../functions/SetPlayerCameraPos) after this to position the player's camera, and it will track the player/vehicle set with [PlayerSpectatePlayer](../functions/PlayerSpectatePlayer)/[PlayerSpectateVehicle](../functions/PlayerSpectateVehicle) | | SPECTATE_MODE_SIDE | The camera will be attached to the side of the player/vehicle (like when you're in first-person camera on a bike and you do a wheelie) |
openmultiplayer/web/docs/scripting/resources/spectatemodes.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/resources/spectatemodes.md", "repo_id": "openmultiplayer", "token_count": 530 }
329
--- title: Doprinos description: Kako doprinijeti SA-MP Wiki i open.mp dokumentaciji. --- Ovaj izvor dokumentacije otvoren je za sve za doprinos promjenama! Sve što trebate je [GitHub](https://github.com) nalog i malo slobodnog vremena. Čak ne morate da znate Git, sve to možete uraditi preko web sučelja! Ako želite pomoći u održavanju određenog jezika, otvorite _pull request_(PR) na [`CODEOWNERS`](https://github.com/openmultiplayer/web/blob/master/CODEOWNERS) fajl i dodajte novu liniju sa direktorijumom vašeg jezika sa vašim korisničkim imenom. ## Uređivanje Sadržaja Na svakoj stranici nalazi se dugme koje vas dovodi na GitHub stranicu za uređivanje: ![Uredi ovu stranicu](images/contributing/edit-this-page.png) Naprimjer, ukoliko kliknete ovo dugme na [SetVehicleAngularVelocity](../scripting/functions/SetVehicleAngularVelocity) odvesti će vas na [ovu stranicu](https://github.com/openmultiplayer/web/edit/master/docs/scripting/functions/SetVehicleAngularVelocity.md) koji vam nudi uređivač teksta kako biste mogli napraviti promjene u fajlu (pod pretpostavkom da ste prijavljeni na vaš GitHub račun). Uredi ga i postavi "Pull Request", to znači da će Wiki održavatelji i ostali članovi zajednice pregledati vašu izmjenu, diskutovati o tome da li su potrebne dodatne izmjene i onda primjeniti Vaše izmjene. ## Dodavanje Novog Sadržaja Dodavanje novog sadržaja je malo više komplicirano. Možete to uraditi na dva načina: ### GitHub Sučelje Kada pregledavate direktorijum na GitHub-u, tu se nalazi "Dodaj fajl" (Add File) dugme u gornjem desnom ćošku od liste fajlova: ![Dodaj fajl dugme](images/contributing/add-new-file.png) Možete prenijeti MarkDown fajl koji ste već prethodno napisali ili ga napisati u GitHub tekst uređivaču. Fajl _mora_ imati `.md` nastavak i sadržavati MarkDown. Za više informacija o MarkDown-u, provjerite [ovaj vodič](https://guides.github.com/features/mastering-markdown/). Kada je to gotovo, kliknite "Predloži novi fajl" (Propose new file) i Pull Request će biti otvoren za pregled. ### Git Ukoliko želite da koristite Git, sve što trebate jeste da klonirate Wiki repositorij sa: ```sh git clone https://github.com/openmultiplayer/wiki.git ``` Otvorite ga u vašem omiljenom text editoru. Preporučujem Visual Studio Code jer ima odličnih alata za uređivanje i formatiranje Markdown fajlova. Kao što možete da vidite, ja pišem ovo koristeći Visual Studio Code! ![Visual Studio Code markdown pregled](images/contributing/vscode.png) Predlažem dva produžetka (ekstenzije) za bolje iskustvo: - [markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint) izradio: David Anson - ovo je produžetak (ekstenzija) koja osigurava da je vaš MarkDown korektno formatiran. To spriječava neke sintaksičke i semantičke greške. Nisu sva upozorenja važna, ali neka mogu pomoći za poboljšanje čitljivosti. Koristite najbolju presudbu a ako se dvoumite, samo pitajte recenzenta. - [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) izradili: Prettier.js Team - Ovo je formater koji će automatski formatirati vaše Markdown fajlove tako da svi koriste dosljedan stil. Wiki Repository ima nekoliko podešavanja u svome `package.json` koje će ekstenzija automatski koristiti. Budite sigurni da omogućite "Formatiranje Pri Čuvanju" (Format On Save) u postavkama vašeg uređivača tako da vaši Markdown fajlovi butu automatski formatirani svaki put kada ih sačuvate. ## Zabilješke, Savjeti i konvencije ### Interne Veze Ne koristite apsolutne URL-ove za internetske veze. Koristite relativne puteve. - ❌ ```md Za upotrebu sa [OnPlayerClickPlayer](https://www.open.mp/docs/scripting/callbacks/OnPlayerClickPlayer) ``` - ✔ ```md Za upotrebu sa [OnPlayerClickPlayer](../callbacks/OnPlayerClickPlayer) ``` `../` znači "idi gore za jedan direktorijum" (go up one directory) tako da ako je fajl kojeg editujete unutar `functions` direktorijumu a vi povezujete za `callbacks` koristite `../` da idete gore na `scripting/` zatim `callbacks/` kako biste ušli u callbacks direktorijum, zatim ime fajla (bez `.md`) kojeg želite povezati. ### Slike Slike idu unutar poddirektorija u `/static/images`. Nakon što povežete sliku u `![]()` samo koristite `/images/` kao osnovni put (path) (nema potrebe za `static` to je samo za repositorij). Ako ste u dilemi, pročitajte drugu stranicu koja koristi slike i kopirajte kako je tu urađeno. ### Metadata prva stvar u _bilo kojem_ dokumentu ovdje trebala bi biti metadata: ```mdx --- title: Moja Dokumentacija description: Ovo je stranica o stvarima i burgerima, yay! --- ``` Svaka stranica bi trebala sadržati naslov (title) i deskripciju (description) Za punu listu šta sve može ići između `---`, provjerite [Docusaurus dokumentaciju](https://v2.docusaurus.io/docs/markdown-features#markdown-headers). ### Naslovi Ne kreirajte nivo 1 naslov (`<h1>`) sa `#` kako je već samo generirano. Vaš prvi naslov bi _uvijek_ trebao biti `##` - ❌ ```md # Moj Naslov Ovo je dokumentacija za ... # Pododjeljak ``` - ✔ ```md Ovo je dokumentacija za ... ## Pododjeljak ``` ### Koristi `Kod` Isječke Za Tehničke Reference Kada pišete paragraf koji sadrži ime, brojeve, izraze ili bilo šta drugo za funkcije što nije pisano standardnim jezikom kojim pišete, okruži ih sa \`backticks\` kao ovdje. To olakšava razdvajanje jezika za opisivanje stvari od referenci na tehničke elemente kao što su imena funkcija i dijelovi koda. - ❌ > fopen funkcija će vratiti vrijednost sa tagom `File:`, nema problema u toj liniji jer se povratna vrijednost pohranjuje u varijablu također sa tagom File: (imajte na umu da su i slučajevi isti). Kako god na sljedećoj liniji vrijednost 4 je dodana privremenoj referenci (file handle). 4 nema taga [...] - ✔ > `fopen` funkcija će vratiti vrijednost sa tagom `File:`, nema problema u toj liniji jer se povratna vrijednost pohranjuje u varijablu također sa tagom `File:` (imajte na umu da su i slučajevi isti). Kako god na sljedećoj liniji vrijednost `4` je dodana privremenoj referenci (file handle). `4` nema taga U gornjem primjeru, `fopen` je ime funkcije, ne riječ na Bosanskom jeziku, tako da okružujući ga `code` pomaže razlikovati ga od drugog sadržaja. Također, ako paragraf upiućuje na neki blok primjera koda, to pomaže čitaču da asocira riječi sa primjerom. ### Tabele Ako tabela ima naslove, onda ide na prvo mjesto - ❌ ```md | | | | -------- | ---------------------------------------------------- | | Zdravlje | Stanje Motora | | 650 | Neoštećen | | 650-550 | Bijeli dim | | 550-390 | Sivi dim | | 390-250 | Crni dim | | < 250 | Zapaljeno (eksplodirati će nekoliko sekundi kasnije) | ``` - ✔ ```md | Zdravlje | Stanje motora | | -------- | ---------------------------------------------------- | | 650 | Neoštećen | | 650-550 | Bijeli dim | | 550-390 | Sivi dim | | 390-250 | Crni dim | | < 250 | Zapaljeno (eksplodirati će nekoliko sekundi kasnije) | ``` ## Migracije sa SA-MP Wiki Većina sadržaja je premještena, ali ako pronađete stranicu koja fali, ovdje možete pronaći kratki vodić kako da konvertujete sadržaj u Markdown. ### Uzimanje HTML-a 1. Kliknite ovo dugme (Firefox) ![image](images/contributing/04f024579f8d.png) (Chrome) ![image](images/contributing/f62bb8112543.png) 2. Zadržite pokazivač u gornjem lijevom uglu glavne wiki stranice, na lijevoj margini ili uglu, dok ne vidite `#content` ![image](images/contributing/65761ffbc429.png) Ili tražite `<div id=content>` ![image](images/contributing/77befe2749fd.png) 3. Kopirajte unutrašnji HTML tog elementa ![image](images/contributing/8c7c75cfabad.png) Sada imate _samo_ HTML kod pravog _sadržaja_ stranice, stvari koje nas zanimaju, i možete ih konvertovati u Markdown. ### Konvertovanje HTML-a u Markdown Za konvertovanje osnovnog HTML-a (bez tabela) u Markdown koristite: https://domchristie.github.io/turndown/ ![image](images/contributing/77f4ea555bbb.png) ^^ Primijetite sada da je potpuno zeznuo tablicu... ### HTML Tablice u Markdown Tablice S obzirom da prethodni alat ne podržava tablice, koristite ovaj: https://jmalarcon.github.io/markdowntables/ I kopirajte samo `<table>` elemente u: ![image](images/contributing/57f171ae0da7.png) ### Čišćenje Pretvaranje vjerovatno neće biti perfektno. Stoga ćete morati uraditi malo čišćenje. Formatiranje ekstenzija koje su popisane gote će vam pomoći oko toga ali ćete možda opet morati provesti neko vrijeme manuelno raditi. Ako nemate vremena, ne brinite! Predajte nedovršenu skicu i neko drugi je može preuzeti gdje ste vi stali. ## Ugovor o Licenci Svi open.mp projekti imaju [Ugovor o Licenci Za Saradnike](https://cla-assistant.io/openmultiplayer/homepage). Ovo zapravo znači da vi pristajete na to da mi koristimo vaš radi i da ga stavimo pod "open-source" licencu (da ju svako može preuzeti i editovati). Kada otvorite Pull Request prvi put, CLA-Assistant bot će postaviti link gdje možete potpisati ugovor.
openmultiplayer/web/docs/translations/bs/meta/Contributing.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/meta/Contributing.md", "repo_id": "openmultiplayer", "token_count": 4379 }
330
--- title: OnPlayerClickPlayer description: Poziva se kada igrač dva puta klikne na igrača na scoreboard-u (TAB). tags: ["player"] --- ## Deskripcija Poziva se kada igrač dva puta klikne na igrača na scoreboard-u (TAB). | Ime | Deskripcija | | --------------- | ---------------------------------------------------- | | playerid | ID igrača koji je kliknuo na igrača na scoreboard-u. | | clickedplayerid | ID igrača koji je kliknut. | | source | Izvor igračevog klika. | ## Returns 1 - Spriječiti će da druge filterskripte primaju ovaj callback. 0 - Označava da će ovaj callback biti proslijeđen do sljedeće filterskripte. Uvijek je pozvana prva u filterskripti. ## Primjeri ```c public OnPlayerClickPlayer(playerid, clickedplayerid, CLICK_SOURCE:source) { new message[32]; format(message, sizeof(message), "Kliknuo si na igraca %d", clickedplayerid); SendClientMessage(playerid, 0xFFFFFFFF, message); return 1; } ``` ## Zabilješke :::tip Trenutno je dostupan samo jedan 'source' (0 - CLICK_SOURCE_SCOREBOARD). Postojanost ovog argumenta predlaže da će možda više izvora biti podržano u budućnosti. ::: ## Srodne Funkcije - [OnPlayerClickTextDraw](OnPlayerClickTextDraw.md): Pozvana kada igrač klikne na textdraw.
openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnPlayerClickPlayer.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnPlayerClickPlayer.md", "repo_id": "openmultiplayer", "token_count": 611 }
331
--- title: OnPlayerGiveDamageActor description: Ovaj callback je pozvan kada igrač nanese povredu aktoru. tags: ["player"] --- :::warning Ova funkcija je dodana u SA-MP 0.3.7 i ne radi u nižim verzijama! ::: ## Deskripcija Ovaj callback je pozvan kada igrač nanese povredu aktoru. | Ime | Deskripcija | |-----------------|------------------------------------------------------------| | playerid | ID igrača koji zadaje povredu. | | damaged_actorid | ID aktora koji je primio povredu. | | Float:amount | Količina healtha i armora kojeg je izgubi damaged_actorid. | | WEAPON:weaponid | Razlog zbog kojeg je zadobio povredu. | | bodypart | Dio tijela koji je udaren. | ## Returns 1 - Spriječiti će da druge filterskripte primaju ovaj callback. 0 - Označava da će ovaj callback biti proslijeđen narednoj filterskripti. Uvijek je pozvana prva u filterskripti. ## Primjeri ```c public OnPlayerGiveDamageActor(playerid, damaged_actorid, Float:amount, WEAPON:weaponid, bodypart) { new string[128], attacker[MAX_PLAYER_NAME]; new weaponname[24]; GetPlayerName(playerid, attacker, sizeof (attacker)); GetWeaponName(weaponid, weaponname, sizeof (weaponname)); format(string, sizeof(string), "%s je nanio %.0f stete aktoru id %d, oruzjem: %s", attacker, amount, damaged_actorid, weaponname); SendClientMessageToAll(0xFFFFFFFF, string); return 1; } ``` ## Zabilješke :::tip Ova funkcije nije pozvana ako je aktor postavljen na "neranjiv" (invulnerable) (ŠTO JE PO DEFAULTU). Pogledaj [SetActorInvulnerable](../functions/SetActorInvulnerable). ::: ## Srodne Funkcije - [CreateActor](../functions/CreateActor): Kreiraj aktora (statični NPC). - [SetActorInvulnerable](../functions/SetActorInvulnerable): Postavi aktorovu neranjivost. - [SetActorHealth](../functions/SetActorHealth): Postavi health aktoru. - [GetActorHealth](../functions/GetActorHealth): Dobij količinu healtha aktora. - [IsActorInvulnerable](../functions/IsActorInvulnerable): Provjeri da li je igrač neranjiv. - [IsValidActor](../functions/IsValidActor): Provjeri da li je ID aktora validan. ## Srodne Callbacks - [OnActorStreamOut](OnActorStreamOut): Poziva se kada se aktor pojavi u igračevom klijentu. - [OnPlayerStreamIn](OnPlayerStreamIn): Poziva se kada se aktor prestane prikazivati na igračevom klijentu.
openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnPlayerGiveDamageActor.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnPlayerGiveDamageActor.md", "repo_id": "openmultiplayer", "token_count": 1043 }
332
--- title: OnPlayerTakeDamage description: Ovaj callback je pozvan kada igrač prvimi povredu (damage). tags: ["player"] --- ## Deskripcija Ovaj callback je pozvan kada igrač prvimi povredu (damage). | Ime | Deskripcija | |-----------------|--------------------------------------------------------------------------------------------------------------------------------| | playerid | ID igrača koji je primio povredu (damage). | | issuerid | ID igrača koji je uzrokovao povredu. INVALID_PLAYER_ID ako je sam sebe povrijedio. | | Float:amount | Količina povrede (damage-a) koje je igrač primio (health i armor kombinirano). | | WEAPON:weaponid | ID oružja/razlog zbog kojeg je primio povredu (damage). | | bodypart | Dio tijela u koji je igrač pogođen. | ## Returns 1 - Callback se neće pozvati u drugim filterskriptama. 0 - Dozvoljava da se ovaj callback pozove u narednoj filterskripti. Uvijek je pozvan prvo u filterskripti tako da će return-ovanje 1 ovdje blokirati da ga ostale filterskripte vide. ## Primjeri ```c public OnPlayerTakeDamage(playerid, issuerid, Float:amount, WEAPON:weaponid, bodypart) { if (issuerid != INVALID_PLAYER_ID) // If not self-inflicted { new infoString[128], weaponName[24], victimName[MAX_PLAYER_NAME], attackerName[MAX_PLAYER_NAME]; GetPlayerName(playerid, victimName, sizeof (victimName)); GetPlayerName(issuerid, attackerName, sizeof (attackerName)); GetWeaponName(weaponid, weaponName, sizeof (weaponName)); format(infoString, sizeof(infoString), "%s has made %.0f damage to %s, weapon: %s, bodypart: %d", attackerName, amount, victimName, weaponName, bodypart); SendClientMessageToAll(-1, infoString); } return 1; } public OnPlayerTakeDamage(playerid, issuerid, Float:amount, WEAPON:weaponid, bodypart) { if (issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9) { // Jedan metak u glavu sa sniperom da ga odmah ubije SetPlayerHealth(playerid, 0.0); } return 1; } ``` ## Zabilješke :::tip ID oružja (weaponid) će return-ovati 37 (flame thrower) od bilo kojeg izvora vatre (npr. molotov, 18) ID oružja (weaponid) će return-ovati 51 od bilo koje vrste eksplozije (npe. RPG, granata) playerid je jedini koji može pozvati ovaj callback. Količina je uvijek maksimalna povreda koju taj ID oružja (weaponid) može da dadne, iako je nivo healtha manji od maksimalne povrede. Tako da kada igrač ima 100.0 healtha i biva pogođen sa Desert Eagle-om koji daje damage vrijednosti 46.2, potrebna su 3 hica da se taj igrač ubije. Sva tri hica će priakzati količinu 46.2, iako zadnji kada zadnji hitac biva ispaljen, igrač ima samo 7.6 preostalog healtha. ::: :::warning GetPlayerHealth i GetPlayerArmour će return-ovati stare vrijednosti igračevog healtha i armora prije ovog callbacka. Uvijek provjerite da li je issuerid validan prije nego ga koristite u array indexu. ::: ## Srodne Callbacks - [OnPlayerGiveDamage](OnPlayerGiveDamage): This callback is called when a player gives damage. - [OnPlayerWeaponShot](OnPlayerWeaponShot): This callback is called when a player fires a weapon.
openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnPlayerTakeDamage.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnPlayerTakeDamage.md", "repo_id": "openmultiplayer", "token_count": 1642 }
333
--- title: OnVehicleStreamIn description: Pozvan kada se vozilo pojavi u igračevom klijentu. tags: ["vehicle"] --- ## Deskripcija Pozvan kada se vozilo pojavi u igračevom klijentu. | Ime | Deskripcija | | ----------- | ------------------------------------------------ | | vehicleid | ID vozila koje se pojavilo u igračevom klijentu. | | forplayerid | ID igrača u čijem se klijentu pojavilo vozilo. | ## Returns Uvijek je pozvan prvo u filterskriptama. ## Primjeri ```c public OnVehicleStreamIn(vehicleid, forplayerid) { new string[32]; format(string, sizeof(string), "Sada mozes da vidis vozilo %d.", vehicleid); SendClientMessage(forplayerid, 0xFFFFFFFF, string); return 1; } ``` ## Zabilješke :::tip Ovaj callback pozvat će i NPC. ::: ## Srodne Funkcije
openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnVehicleStreamIn.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnVehicleStreamIn.md", "repo_id": "openmultiplayer", "token_count": 370 }
334
--- title: ApplyAnimation description: Primijeni animaciju igraču. tags: [] --- ## Deskripcija Primijeni animaciju igraču. | Ime | Deskripcija | | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | playerid | ID igrača kojem primijenjujete animaciju | | animlib[] | Biblioteka (library) animacija iz koje želite primijeniti animaciju. | | animname[] | Ime animacije koju hoćete primijeniti, unutar oodređene biblioteke (library-a). | | fDelta | Brzina reprodukcije animacija (koristi 4.1). . | | loop | Ako je postavljen 1, animacija će se ponavljati. Ako je postavljen na 0, animacija će se reproducirati jednom. | | lockx | Ako je postavljen 0, aktor će se vratiti na svoeu staru x kordinatu nakon što se animacija završi (za animacije koje aktora pokreću kao npr 'walking' / 'hodanje'). 1 ga neće vratiti na staru poziciju | | locky | Isto kao i parametar iznad samo za Y osu. Trebalo bi se ostaviti kao i gornji. | | freeze | Postavljanjem ovo na 1 će zalediti aktora nakon što se animacija zavšri. 0 neće. | | time | Tajmer u milisekundama. Za animaciju koja se neprestano ponavlja je 0. | | forcesync | Postavite na 1 da server sinkronizira animaciju sa svim ostalim igračima u streaming radijusu (opcionalno). 2 radi isto kao i 1, ali SAMO će primijeniti animaciju na reproducirane igrače, ali NE i na stvarnog igrača kojem je animacija primijenjena (korisno za npc animacije i trajne animacije kada se igrači učitavaju) | | | ## Returns Ova funkcija će uvijek return-ovati 1, bilo da označeni igrač ne postoji ili da je neki od parametara nevažeći (npr. nevažeća biblioteka (library)). ## Primjeri ```c ApplyAnimation(playerid, "PED", "WALK_DRUNK", 4.1, 1, 1, 1, 1, 1, 1); ``` ## Zabilješke :::tip 'forcesync' je neobavezan parametar, koji je po zadanim postavkama 0, u većini slučajeva nije potreban s obzirom da igrači sinhroniziraju animacije sami od sebe. 'forcesync' parametar može natjerati sve igrale koji vide 'playerid' (tog igrača) reprodukciju animacije bez obzira na to da li je igrač izvodi. Ovo je korisno uOvo je korisno u okolnostima kada igrač ne može sam sinhronizirati animaciju. Na primjer, mogu biti pauzirani. ::: :::warning Nevažeća biblioteka (library) animacije će crashovati igračevu igru. ::: ## Srodne Funkcije - [ClearAnimations](ClearAnimations.md): Očisti sve animacije koje igrač izvodi. - [SetPlayerSpecialAction](SetPlayerSpecialAction.md): Postavi igraču specijalnu radnju/akciju.
openmultiplayer/web/docs/translations/bs/scripting/functions/ApplyAnimation.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/ApplyAnimation.md", "repo_id": "openmultiplayer", "token_count": 3498 }
335
--- title: CancelEdit description: Prekida mod za editovanje objekta za igrača. tags: [] --- ## Deskripcija Prekida mod za editovanje objekta za igrača. | Ime | Deskripcija | | -------- | ------------------------------------------------------ | | playerid | ID igrača kojem će se prekinuti mod editovanja objekta | ## Returns Ova funkcija ne vraća nikakve posebne vrijednosti. ## Primjeri ```c public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/stopedit", true)) { CancelEdit(playerid); SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: You stopped editing the object!"); return 1; } return 0; } ``` ## Srodne Funkcije - [SelectObject](SelectObject): Selektovanje objekta. - [EditObject](EditObject): Editovanje objekta. - [EditPlayerObject](EditPlayerObject): Editovanje objekta igrača. - [EditAttachedObject](EditAttachedObject): Editovanje zakačenog objekta. - [CreateObject](CreateObject): Kreiranje objekta. - [DestroyObject](DestroyObject): Uništavanje objekta. - [MoveObject](MoveObject): Pomjeranje objekta.
openmultiplayer/web/docs/translations/bs/scripting/functions/CancelEdit.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/CancelEdit.md", "repo_id": "openmultiplayer", "token_count": 455 }
336
--- title: CreatePlayerTextDraw description: Kreira textdraw za jednog igrača. tags: ["player", "textdraw", "playertextdraw"] --- ## Deskripcija Kreira textdraw za jednog igrača. Ovo se može koristiti za zaobići limit globalnih textdraw-ova. | Ime | Deskripcija | | -------- | -------------------------------------- | | playerid | ID igrača za kojeg se kreira textdraw. | | Float:x | X-kordinata | | Float:y | Y-kordinata | | text[] | Tekst u textdraw-u. | ## Returns ID kreiranog textdraw-a. ## Primjeri ```c // Ova varijabla je korištena da bi smo sačuvali ID textdraw-a // kako bismo ga mogli koristiti kroz skriptu new PlayerText:welcomeText[MAX_PLAYERS]; public OnPlayerConnect(playerid) { // Prvo, kreiramo textdraw welcomeText[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "Dobrodosli na moj SA-MP server"); // Sada ga prikažemo PlayerTextDrawShow(playerid, welcomeText[playerid]); } ``` ## Zabilješke :::tip Player-textdraws se automatski unište kada se igrač diskonektuje. ::: :::warning Kodovi mapiranja tipkovnice (kao što je ~k~~VEHICLE_ENTER_EXIT~ Ne radi duže od 255. znaka). ::: ## Srodne Funkcije - [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. - [PlayerTextDrawTextSize](PlayerTextDrawTextSize): Postavi veličinu box-a player-textdrawa (ili dijela koji reaguje na klik za PlayerTextDrawSetSelectable). - [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): (Ne) Koristi outline za player-textdraw. - [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): Postavi sjenu na player-textdraw. - [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): Razmjeri razmak teksta u player-textdrawu na proporcionalni omjer. - [PlayerTextDrawUseBox](PlayerTextDrawUseBox): (Ne) Koristi box na player-textdrawu. - [PlayerTextDrawSetString](PlayerTextDrawSetString): Postavi tekst player-textdrawa. - [PlayerTextDrawShow](PlayerTextDrawShow): Prikaži player-textdraw. - [PlayerTextDrawHide](PlayerTextDrawHide): Sakrij player-textdraw.
openmultiplayer/web/docs/translations/bs/scripting/functions/CreatePlayerTextDraw.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/CreatePlayerTextDraw.md", "repo_id": "openmultiplayer", "token_count": 1028 }
337
--- title: DisableNameTagLOS description: Onemogućava provjeru linije naziva vidljivosti kako bi igrači mogli vidjeti oznake imena kroz objekte. tags: [] --- ## Deskripcija DOnemogućava provjeru linije naziva vidljivosti kako bi igrači mogli vidjeti oznake imena kroz objekte. ## Primjeri ```c public OnGameModeInit() { DisableNameTagLOS(); return 1; } ``` ## Zabilješke :::warning Ovo se ne može poništiti sve dok se server ne restartuje. ::: ## Srodne Funkcije - [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/DisableNameTagLOS.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/DisableNameTagLOS.md", "repo_id": "openmultiplayer", "token_count": 292 }
338
--- title: GameModeExit description: Završava trenutni gamemode. tags: [] --- ## Deskripcija Završava trenutni gamemode. ## Primjeri ```c if (OneTeamHasWon) { GameModeExit(); } ``` ## Srodne Funkcije
openmultiplayer/web/docs/translations/bs/scripting/functions/GameModeExit.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/GameModeExit.md", "repo_id": "openmultiplayer", "token_count": 96 }
339
--- title: GetActorPos description: Dobij poziciju actora. tags: ["actor"] --- <VersionWarn version='SA-MP 0.3.7' /> ## Deskripcija Dobij poziciju actora. | Ime | Deskripcija | | ------- | --------------------------------------------------------------------------------------- | | actorid | ID actora koji će dobiti poziciju. Returnan od funkcije CreateActor. | | X | Float varijabla proslijeđena referencom u kojoj se pohranjuje X koordinata actora. | | Y | Float varijabla proslijeđena referencom u kojoj se pohranjuje Y koordinata actora. | | Z | Float varijabla proslijeđena referencom u kojoj se pohranjuje Z koordinata actora. | ## Returns 1: Funkcija je uspješno izvršena. 0: Funkcija nije uspjela da se izvrši. Navedeni actor ne postoji. Pozicija actora je pohranjena u navedenim varijablama. ## Primjeri ```c new Float:x, Float:y, Float:z; GetActorPos(actorid, x, y, z); ``` ## Srodne Funkcije - [SetActorPos](SetActorPos): Postavi poziciju actora.
openmultiplayer/web/docs/translations/bs/scripting/functions/GetActorPos.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/GetActorPos.md", "repo_id": "openmultiplayer", "token_count": 506 }
340
--- title: GetPVarString description: Dobija igračevu varijablu kao string. tags: ["pvar"] --- ## Deskripcija Dobija igračevu varijablu kao string. | Ime | Deskripcija | | -------------- | ------------------------------------------------------------ | | playerid | ID igrača za dobiti igračevu varijablu. | | varname | Ime igračeve varijable, postavljeno od SetPVarString. | | &string_return | Niz za pohraniti string vrijednost, proslijeđeno referencom. | | len | Maksimalna dužina returnovanog/vraćenog stringa. | ## Returns Dužina stringa. ## Primjeri ```c public OnPlayerConnect(playerid,reason) { new playerName[MAX_PLAYER_NAME+1]; GetPlayerName(playerid, playerName, MAX_PLAYER_NAME); SetPVarString(playerid, "PlayerName", playerName); return 1; } public OnPlayerDeath(playerid, killerid, WEAPON:reason) { new playerName[MAX_PLAYER_NAME+1]; GetPVarString(playerid, "PlayerName", playerName, sizeof(playerName)); printf("%s je umro.", playerName); } ``` ## Zabilješke :::tip Ako je dužina niza jednaka nuli (vrijednost nije postavljena), tekst string_return neće se ažurirati ili postaviti na bilo što i ostat će sa starim podacima, nužno obrisati varijablu na praznu vrijednost ako GetPVarString vrati 0 ako to ponašanje nije poželjno. ::: ## Srodne Funkcije - [SetPVarString](SetPVarString): Postavi string za igračevu varijablu. - [SetPVarInt](SetPVarInt): Postavi cijeli broj za igračevu varijablu. - [GetPVarInt](GetPVarInt): Dobij prethodno postavljeni cijeli broj iz igračeve varijable. - [SetPVarFloat](SetPVarFloat): Postavi float za igračevu varijablu. - [GetPVarFloat](GetPVarFloat): Dobij prethodno postavljeni float iz igračeve varijable. - [DeletePVar](DeletePVar): Ukloni igračevu varijablu.
openmultiplayer/web/docs/translations/bs/scripting/functions/GetPVarString.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/GetPVarString.md", "repo_id": "openmultiplayer", "token_count": 836 }
341
--- title: GetPlayerVersion description: Returna/vraća verziju SA-MP klijenta, kako je izvijestio igrač. tags: ["player"] --- ## Deskripcija Returna/vraća verziju SA-MP klijenta, kako je izvijestio igrač. | Ime | Deskripcija | | --------- | ------------------------------------------------------------ | | playerid | ID igrača za dobiti verziju klijenta. | | version[] | String za pohraniti verziju igrača, proslijeđeno referencom. | | len | Maksimalna dužina verzije. | ## Returns Verzija klijenta je pohranjena u navedenom nizu. ## Primjeri ```c public OnPlayerConnect(playerid) { new string[24]; GetPlayerVersion(playerid, string, sizeof(string)); format(string, sizeof(string), "Tvoja verzija SA-MP-a: %s", string); SendClientMessage(playerid, 0xFFFFFFFF, string); // mogući tekst: "Tvoja verzija SA-MP-a: 0.3.7" return 1; } ``` ## Zabilješke :::tip Klijentska verzija može imati najviše 24 znaka, inače će veza biti odbijena zbog "Nevažeće veze s klijentom". Međutim, normalni igrači mogu se pridružiti samo sa verzijom dužine između 5 (0.3.7) i 9 (0.3.DL-R1) znakova. ::: :::warning Niz u kojem se verzija čuva bit će prazan ako je playerid NPC. ::: ## Srodne Funkcije - [GetPlayerName](GetPlayerName): Dobij ime igrača. - [GetPlayerPing](GetPlayerPing): Dobij ping igrača. - [GetPlayerIp](GetPlayerIp): Dobij IP igrača.
openmultiplayer/web/docs/translations/bs/scripting/functions/GetPlayerVersion.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/GetPlayerVersion.md", "repo_id": "openmultiplayer", "token_count": 727 }
342
--- title: GetTickCount description: Daje vrijeme trajanja stvarnog servera (ne SA-MP servera) u milisekundama. tags: [] --- ## Deskripcija Daje vrijeme trajanja stvarnog servera (ne SA-MP servera) u milisekundama. ## Primjeri ```c public OnPlayerConnect(playerid) { new count = GetTickCount(); //Ostatak OnPlayerConnect-a printf("Vrijeme potrebno za izvršenje OnPlayerConnect-a: %d", GetTickCount() - count); return 1; } ``` ## Zabilješke :::tip Jedna uobičajena upotreba GetTickCount je za benčmarking. Pomoću njega se može izračunati koliko vremena je potrebno nekom izvršnom kodu. Pogledajte primer za primer. ::: :::warning GetTickCount će uzrokovati probleme na serverima s vremenom neprekidnog rada duže od 24 dana, jer će GetTickCount na kraju iskriviti ograničenja cijele veličine. Provjeri [ovaj paket](https://github.com/ScavengeSurvive/tick-difference) za rješenje. ::: ## Srodne Funkcije - [Tickcount](Tickcount): Nabavite vrijeme rada stvarnog servera.
openmultiplayer/web/docs/translations/bs/scripting/functions/GetTickCount.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/GetTickCount.md", "repo_id": "openmultiplayer", "token_count": 429 }
343
--- title: GetVehicleVelocity description: Dobij brzinu vozila na X,Y i Z osi. tags: ["vehicle"] --- ## Deskripcija Dobij brzinu vozila na X,Y i Z osi. | Ime | Deskripcija | | --------- | -------------------------------------------------------------------------------- | | vehicleid | ID vozila za dobiti brzinu. | | &Float:x | Float varijabla za pohraniti the brzinu vozila u X osi, proslijeđeno referencom. | | &Float:y | Float varijabla za pohraniti the brzinu vozila u Y osi, proslijeđeno referencom. | | &Float:z | Float varijabla za pohraniti the brzinu vozila u Z osi, proslijeđeno referencom. | ## Returns 1: Funkcija uspješno izvršena. 0: Funkcija neuspješno izvršena. Ovo znači da navedeno vozilo ne postoji. Brzina vozila pohranjena je u navedenim varijablama. ## Primjeri ```c public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp("/GetMyCarVelocity", cmdtext) && IsPlayerInAnyVehicle(playerid)) { new Float: vehVelocity[3], clientMessage[80]; GetVehicleVelocity(GetPlayerVehicleID(playerid), vehVelocity[0], vehVelocity[1], vehVelocity[2]); format(clientMessage, sizeof(clientMessage), "Ideš brzinom od: X%f, Y%f, Z%f", vehVelocity[0], vehVelocity[1], vehVelocity[2]); SendClientMessage(playerid, 0xFFFFFFFF, clientMessage); return 1; } return 0; } ``` ## Zabilješke :::tip Ova funkcija se može koristiti za pronalaženje brzine vozila (km/h, m/s ili mph). Za više informacija pogledajte ovdje. ::: ## Srodne Funkcije - [GetPlayerVelocity](GetPlayerVelocity): Dobij brzinu igrača. - [SetVehicleVelocity](SetVehicleVelocity): Postavi brzinu vozila. - [SetPlayerVelocity](SetPlayerVelocity): Postavi brzinu igrača.
openmultiplayer/web/docs/translations/bs/scripting/functions/GetVehicleVelocity.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/GetVehicleVelocity.md", "repo_id": "openmultiplayer", "token_count": 844 }
344
--- title: IsPlayerAttachedObjectSlotUsed description: Provjeri da li igrač ima prikvačen objekat u određenom indexu (slotu). tags: ["player"] --- ## Deskripcija Provjeri da li igrač ima prikvačen objekat u određenom indexu (slotu). | Ime | Deskripcija | | -------- | ------------------------- | | playerid | ID igrača za provjeru. | | index | Index (slot) za provjeru. | ## Returns 1: Navedeni slot koristi se za prikvačeni objekt. 0: Navedeni slot se ne koristi za prikvačeni objekt. ## Primjeri ```c stock CountAttachedObjects(playerid) { new count; for(new i = 0; i < MAX_PLAYER_ATTACHED_OBJECTS; i++) { if (IsPlayerAttachedObjectSlotUsed(playerid, i)) { count++; } } return count; } ``` ## Srodne Funkcije - [SetPlayerAttachedObject](SetPlayerAttachedObject): Prikvači objekat za igrača - [RemovePlayerAttachedObject](RemovePlayerAttachedObject): Ukloni prikvačeni objekat sa igrača
openmultiplayer/web/docs/translations/bs/scripting/functions/IsPlayerAttachedObjectSlotUsed.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/IsPlayerAttachedObjectSlotUsed.md", "repo_id": "openmultiplayer", "token_count": 430 }
345
--- title: IsValidVehicle description: Provjerava da li je vozilo kreirano. tags: [] --- :::note Ova funkcija nije prisutna u starim bibliotekama/library-ima pakiranim sa SA-MP serverom, međutim [najnovije verzije održavanih biblioteka/library-a](https://github.com/pawn-lang/samp-stdlib) sadrže ovu i druge deklaracije koje su ranije nedostajale . ::: ## Deskripcija Provjerava da li je vozilo kreirano. ## Parameters | Ime | Deskripcija | | --------- | -------------------------------- | | vehicleid | Vozilo za provjeriti postojanje. | ## Return Values **true** ako vozilo postoji, uostalom **false**. ## Primjer upotrebe ```c #if !defined IsValidVehicle native IsValidVehicle(vehicleid); #endif // Count vehicles public OnPlayerCommandText(playerid,cmdtext[]) { if (!strcmp(cmdtext,"/countvehicles",true)) { new count, msg[60]; for(new i; i < MAX_VEHICLES; i++) { if (IsValidVehicle(i)) count++; } format(msg, sizeof(msg), "* Nalazi se %d valjano stvorenih vozila na ovom serveru.", count); SendClientMessage(playerid, 0x33CCCCFF, msg); return 1; } return 0; } ``` ## Srodne Funkcije - [GetPlayerVehicleID](GetPlayerVehicleID): Dobij ID vozila u kojem je igrač trenutno. - [GetVehicleModel](GetVehicleModel): Dobij ID modela vozila.
openmultiplayer/web/docs/translations/bs/scripting/functions/IsValidVehicle.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/IsValidVehicle.md", "repo_id": "openmultiplayer", "token_count": 620 }
346
--- title: NetStats_MessagesRecvPerSecond description: Dobija broj poruka koje je igrač primio u posljednjoj sekundi. tags: [] --- ## Deskripcija Dobija broj poruka koje je igrač primio u posljednjoj sekundi. | Ime | Deskripcija | | -------- | ---------------------------- | | playerid | ID igrača za dobiti podatke. | ## Returns Broj poruka koje je igrač primio u posljednjoj sekundi. ## Primjeri ```c public OnPlayerCommandText(playerid,cmdtext[]) { if (!strcmp(cmdtext, "/msgpersec")) { new szString[144]; format(szString, sizeof(szString), "Primio si %i network poruka u posljednoj sekundi.", NetStats_MessagesRecvPerSecond(playerid)); SendClientMessage(playerid, -1, szString); } return 1; } ``` ## Srodne Funkcije - [GetPlayerNetworkStats](GetPlayerNetworkStats): Dobija mrežne statistike igrača i pohranjuje ih u string. - [GetNetworkStats](GetNetworkStats): Dobija mrežne statistike servera i sprema ih u string. - [NetStats_GetConnectedTime](NetStats_GetConnectedTime): Dobij vrijeme za kojeg je igrač povezan na server. - [NetStats_MessagesReceived](NetStats_MessagesReceived): Dohvatite broj mrežnih poruka koje je server primio od igrača. - [NetStats_BytesReceived](NetStats_BytesReceived): Dohvatite količinu informacija (u bajtovima) koju je poslužitelj primio od igrača. - [NetStats_MessagesSent](NetStats_MessagesSent): Dohvatite broj mrežnih poruka koje je server poslao igraču. - [NetStats_BytesSent](NetStats_BytesSent): Dohvatite količinu informacija (u bajtovima) koje je poslužitelj poslao uređaju za reprodukciju. - [NetStats_PacketLossPercent](NetStats_PacketLossPercent): Dobijte packet loss procenat igrača. - [NetStats_ConnectionStatus](NetStats_ConnectionStatus): Dohvatite status veze igrača. - [NetStats_GetIpPort](NetStats_GetIpPort): Nabavite IP adresu i port igrača.
openmultiplayer/web/docs/translations/bs/scripting/functions/NetStats_MessagesRecvPerSecond.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/NetStats_MessagesRecvPerSecond.md", "repo_id": "openmultiplayer", "token_count": 760 }
347
--- title: PlayerTextDrawSetOutline description: Postavite outline za player-textdraw. tags: ["player", "textdraw", "playertextdraw"] --- ## Deskripcija Postavite outline za player-textdraw. Boja outline-a ne može biti promijenjena osim ako se PlayerTextDrawBackgroundColor ne koristi. | Ime | Deskripcija | | -------- | ---------------------------------------------------- | | playerid | ID igrača čijem player-textdrawu se stavlja outline. | | text | ID player-textdrawa za postaviti outline | | size | Debljina outline-a. | ## Returns Ova funkcija ne returna (vraća) nikakve posebne vrijednosti. ## Primjeri ```c gMyTextDraw[playerid] = CreatePlayerTextDraw(playerid, 100.0, 33.0,"Primjer Textdrawa"); PlayerTextDrawSetOutline(playerid, gMyTextDraw[playerid], 1); ``` ## 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. - [PlayerTextDrawTextSize](PlayerTextDrawTextSize): Postavi veličinu box-a player-textdrawa (ili dijela koji reaguje na klik za PlayerTextDrawSetSelectable). - [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/PlayerTextDrawSetOutline.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/PlayerTextDrawSetOutline.md", "repo_id": "openmultiplayer", "token_count": 828 }
348
--- title: RemovePlayerMapIcon description: Uklanja ikonicu na mapi koja je prethodno postavljena za igrača koristeći SetPlayerMapIcon. tags: ["player"] --- ## Deskripcija Uklanja ikonicu na mapi koja je prethodno postavljena za igrača koristeći SetPlayerMapIcon. | Ime | Deskripcija | | -------- | ------------------------------------------------------------------- | | playerid | ID igrača čija će ikonica biti uklonjena. | | iconid | ID ikonice za ukloniti. Ovo je drugi parametar od SetPlayerMapIcon. | ## Returns 1: Funkcija uspješno izvršena. 0: Funkcija neuspješno izvršena. ## Primjeri ```c SetPlayerMapIcon(playerid, 12, 2204.9468, 1986.2877, 16.7380, 52, 0); // Kasnije RemovePlayerMapIcon(playerid, 12); ``` ## Srodne Funkcije - [SetPlayerMapIcon](/docs/scripting/functions/SetPlayerMapIcon): Kreiraj map-ikonicu za igrača.
openmultiplayer/web/docs/translations/bs/scripting/functions/RemovePlayerMapIcon.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/RemovePlayerMapIcon.md", "repo_id": "openmultiplayer", "token_count": 422 }
349
--- title: SetActorHealth description: Postavi healthe (zdravlje) aktoru. tags: [] --- :::warning Ova funkcija je dodana u SA-MP 0.3.7 i ne radi u nižim verzijama! ::: ## Deskripcija Postavi healthe (zdravlje) aktoru. | Ime | Deskripcija | | ------------ | ------------------------------- | | actorid | ID aktora za postaviti healthe. | | Float:health | Vrijednost za postaviti health. | ## Returns 1 - uspješno 0 - greška (Aktor nije kreiran). ## Primjeri ```c new gMyActor; public OnGameModeInit() { gMyActor = CreateActor(179, 316.1, -134.0, 999.6, 90.0); // Aktor kao prodavač u Ammunation-u. SetActorHealth(gMyActor, 100); return 1; } ``` ## Srodne Funkcije
openmultiplayer/web/docs/translations/bs/scripting/functions/SetActorHealth.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/SetActorHealth.md", "repo_id": "openmultiplayer", "token_count": 326 }
350
--- title: SetObjectsDefaultCameraCollision description: Omogućuje da se kolizije kamere s novostvorenim objektima onemoguće prema zadanim postavkama. tags: ["object", "camera"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Deskripcija Omogućuje da se sudari kamere s novostvorenim objektima onemoguće prema zadanim postavkama. | Ime | Deskripcija | |--------------|------------------------------------------------------------------------------------------------------------------------------------------| | bool:disable | `true` za onemogućavanje koliziju kamere za novostvorene objekte i `false` za njihovo omogućavanje (omogućeno prema zadanim postavkama). | ## Returnovi Zabilješka Ova funkcija utječe samo na kolizije kamere objekata stvorenih NAKON njezine upotrebe - ne mijenja kolizije kamera postojećih objekata. ## Primjeri ```c public OnGameModeInit() { // Onemogući koliziju kamere SetObjectsDefaultCameraCollision(true); // Kreira mapane objekte CreateObject(...); CreateObject(...); CreateObject(...); CreateObject(...); // Gore navedeni objekti NEĆE imati kolizije kamera // Ponovo omogući kolizije kamere SetObjectsDefaultCameraCollision(false); // Kreira mapane objekte CreateObject(...); CreateObject(...); CreateObject(...); CreateObject(...); // Gornji objekti ĆE IMATI koliziju kamere // ALI, prvi set još uvijek NEĆE imati kolizije kamera return 1; } ``` ## Zabilješke :::tip Ova funkcija utječe samo na kolizije kamere objekata stvorenih NAKON njezine upotrebe - ne mijenja kolizije kamera postojećih objekata. ::: :::warning Ova funkcija SAMO radi izvan granica normalne SA mape (preko 3000 jedinica). ::: ## Srodne Funkcije - [SetObjectNoCameraCollision](SetObjectNoCameraCollision): Onemogućuje kolizije između kamere i objekta. - [SetPlayerObjectNoCameraCollision](SetPlayerObjectNoCameraCollision): Onemogućuje kolizije između kamere i player objekta.
openmultiplayer/web/docs/translations/bs/scripting/functions/SetObjectsDefaultCameraCollision.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/SetObjectsDefaultCameraCollision.md", "repo_id": "openmultiplayer", "token_count": 927 }
351
--- title: SetPlayerHealth description: Postavi healthe (zdravlje) igrača. tags: ["player"] --- ## Deskripcija Postavi healthe (zdravlje) igrača. | Ime | Deskripcija | | ------------ | ----------------------------------------------------------------------------------------------------------------------------------- | | playerid | ID igrača za postaviti healthe. | | Float:health | Vrijednost za postaviti healthe igraču. Maksimalan health koji se može prikazati na HUD-u je 100, ali i veće vrijednosti su važeće. | ## Returns 1: Funkcija uspješno izvršena. 0: Funkcija neuspješno izvršena. Ovo znači da navedeni igrač ne postoji. ## Primjeri ```c // Postavi igraču healthe na potpuno (full) public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp("/heal", cmdtext, true)) { SetPlayerHealth(playerid, 100.0); return 1; } if (!strcmp("/kill", cmdtext, true)) { SetPlayerHealth(playerid, 0.0); return 1; } return 0; } ``` ## Zabilješke :::tip Ako je health/zdravlje igrača postavljeno na 0 ili minus vrijednost, oni će odmah umrijeti. Ako je zdravstveno stanje igrača ispod 10 ili više od 98303, traka zdravlja će treptati. ::: :::warning Zdravlje se zaokružuje na cijele brojeve: postavite 50,15, ali ćete dobiti 50,0 ::: ## Srodne Funkcije - [GetPlayerHealth](GetPlayerHealth): Doznaj koliko healtha ima igrač. - [GetPlayerArmour](GetPlayerArmour): Otkrijte koliko armora ima igrač. - [SetPlayerArmour](SetPlayerArmour): Postavi armor igrača.
openmultiplayer/web/docs/translations/bs/scripting/functions/SetPlayerHealth.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/SetPlayerHealth.md", "repo_id": "openmultiplayer", "token_count": 868 }
352
--- title: SetPlayerShopName description: Učitava ili rasterećuje unutrašnju skriptu (enterijera) za igrača (na primjer meni za ammunation). tags: ["player"] --- ## Deskripcija Učitava ili rasterećuje unutrašnju skriptu (enterijera) za igrača (na primjer meni za ammunation). | Ime | Deskripcija | | ---------- | -------------------------------------------------------------------------------- | | playerid | ID igrača za učitati skripte enterijera. | | shopname[] | Skripta trgovine za učitavanje. Ostavi prazno ("") za rasteretiti (onemogućiti). | ## Returns Ova funkcija ne returna (vraća) nikakve posebne vrijednosti. ## Primjeri ```c public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp("/enter", cmdtext)) { SetPlayerInterior(playerid, 5); SetPlayerPos(playerid, 372.5565, -131.3607, 1001.4922); SetPlayerShopName(playerid,"FDPIZA"); SendClientMessage(playerid,0xFFFFFFFF,"Dobrodošao u Pizza Stack!"); return 1; } return 0; } ``` ## Zabilješke :::tip Ova funkcija ne podržava casino skripte. ::: ## Srodne Funkcije - [DisableInteriorEnterExits](DisableInteriorEnterExits): Onemogući žute markere na vratima. - [SetPlayerInterior](SetPlayerInterior): Postavlja igraču enterijer
openmultiplayer/web/docs/translations/bs/scripting/functions/SetPlayerShopName.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/SetPlayerShopName.md", "repo_id": "openmultiplayer", "token_count": 633 }
353
--- title: SetTimer description: Postavlja 'timer' za pozvati funkciju nakon određenog vremena. tags: [] --- ## Deskripcija Postavlja 'timer' za pozvati funkciju nakon određenog vremena. Može biti postavljen da se ponavlja. | Ime | Deskripcija | | ---------- | --------------------------------------------------------------------------------------------------------------------- | | funcname[] | Ime funkcije za pozvati kao string. Ovo mora biti public/javna funkcija (forwarded). Prazan string će srušiti server. | | interval | Interval u milisekundama. | | repeating | Boolean (true/false) o tome treba li tajmer ponoviti ili ne. | ## Returns ID tajmera koji je pokrenut. ID-ovi tajmera počinju od 1. ## Primjeri ```c forward message(); public OnGameModeInit() { print("Pokrecemo tajmer..."); SetTimer("message", 1000, false); // Postavi tajmer od 1000 milisekundi (1 sekunda) } public message() { print("1 sekunda je prošla."); } ``` ## Zabilješke :::tip Intervali tajmera nisu tačni (otprilike 25% popusta). Postoje ispravci dostupni ovdje i ovdje. ID-ovi tajmera nikada se ne koriste dva puta. Možete koristiti KillTimer () na ID-u tajmera i neće biti važno pokreće li se ili ne. Funkcija koju treba pozvati mora biti javna, što znači da mora biti proslijeđena. Korištenje mnogih tajmera rezultirat će povećanom upotrebom memorije / procesora. ::: ## Srodne Funkcije - [SetTimerEx](SetTimerEx): Postavi tajmer sa parametrima. - [KillTimer](KillTimer): Zaustavi tajmer.
openmultiplayer/web/docs/translations/bs/scripting/functions/SetTimer.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/SetTimer.md", "repo_id": "openmultiplayer", "token_count": 861 }
354
--- title: ShowMenuForPlayer description: Prikazuje prethodno kreirani meni za igrača. tags: ["player", "menu"] --- ## Deskripcija Prikazuje prethodno kreirani meni za igrača. | Ime | Deskripcija | | -------- | -------------------------------------------------------- | | menuid | ID menija za prikazati. Returnovan/vraćen od CreateMenu. | | playerid | ID igrača kojem će meni biti prikazan. | ## Returns 1: Funkcija uspješno izvršena. 0: Funkcija neuspješno izvršena. Menu i/ili igrač ne postoje. ## Primjeri ```c new Menu:gPlayerTeleport; public OnGameModeInit() { gPlayerTeleport = CreateMenu(...); return 1; } if (strcmp(cmdtext, "/tele", true) == 0) { ShowMenuForPlayer(gPlayerTeleport, playerid); return 1; } ``` ## Zabilješke :::tip Crashuje (ruši) i server i igrača ako se proslijedi nevažeći ID menija. ::: ## Srodne Funkcije - [CreateMenu](CreateMenu): Kreiraj meni. - [AddMenuItem](AddMenuItem): Dodaje artikal u određeni meni. - [SetMenuColumnHeader](SetMenuColumnHeader): Postavi zaglavlje za jednu kolonu u meniju. - [DestroyMenu](DestroyMenu): Uništi meni. - [OnPlayerSelectedMenuRow](../callbacks/OnPlayerSelectedMenuRow): Pozvano kada igrač odabere red u meniju. - [OnPlayerExitedMenu](../callbacks/OnPlayerExitedMenu): Pozvano kada igrač napusti meni.
openmultiplayer/web/docs/translations/bs/scripting/functions/ShowMenuForPlayer.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/ShowMenuForPlayer.md", "repo_id": "openmultiplayer", "token_count": 595 }
355
--- title: TextDrawColor description: Postavlja boju teksta textdrawa. tags: ["textdraw"] --- ## Deskripcija Postavlja boju teksta textdrawa. | Ime | Deskripcija | | ----- | ---------------------------------------- | | text | ID textdrawa za promijeniti boju teksta. | | color | Boja za postaviti. | ## Returns Ova funkcija ne returna (vraća) nikakve posebne vrijednosti. ## Primjeri ```c new Text: gMyTextdraw; public OnGameModeInit() { gMyTextdraw = TextDrawCreate(123.0, 123.0, "Primjer"); TextDrawColor(gMyTextdraw, 0x000000FF); return 1; } ``` ## Zabilješke :::tip Ako je textdraw već prikazan, on mora biti ponovno prikazan (TextDrawShowForAll/TextDrawShowForPlayer) kako bi izmjene ove funkcije imale efekta. ::: ## Srodne Funkcije - [TextDrawCreate](TextDrawCreate): Kreiraj textdraw. - [TextDrawDestroy](TextDrawDestroy): Uništi textdraw. - [TextDrawBoxColor](TextDrawBoxColor): Postavi boju boxa u textdrawu. - [TextDrawBackgroundColor](TextDrawBackgroundColor): Postavi boju pozadine textdrawa. - [TextDrawAlignment](TextDrawAlignment): Postavi poravnanje textdrawa. - [TextDrawFont](TextDrawFont): Postavi font textdrawa. - [TextDrawLetterSize](TextDrawLetterSize): Postavi veličinu znakova teksta u textdrawu. - [TextDrawTextSize](TextDrawTextSize): Postavi veličinu boxa u textdrawu. - [TextDrawSetOutline](TextDrawSetOutline): Odluči da li da tekst ima outline. - [TextDrawSetShadow](TextDrawSetShadow): Uključi/isključi sjene (shadows) na textdrawu. - [TextDrawSetProportional](TextDrawSetProportional): Razmjestite razmak između teksta u texstdrawu na proporcionalni omjer. - [TextDrawUseBox](TextDrawUseBox): Uključite ili isključite da li textdraw koristi box ili ne. - [TextDrawSetString](TextDrawSetString): Postavi tekst u već postojećem textdrawu. - [TextDrawShowForPlayer](TextDrawShowForPlayer): Prikaži textdraw za određenog igrača. - [TextDrawHideForPlayer](TextDrawHideForPlayer): Sakrij textdraw za određenog igrača. - [TextDrawShowForAll](TextDrawShowForAll): Prikaži textdraw za sve igrače. - [TextDrawHideForAll](TextDrawHideForAll): Sakrij textdraw za sve igrače.
openmultiplayer/web/docs/translations/bs/scripting/functions/TextDrawColor.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/TextDrawColor.md", "repo_id": "openmultiplayer", "token_count": 860 }
356
--- title: TextDrawShowForPlayer description: Prikazuje textdraw za određenog igrača. tags: ["player", "textdraw"] --- ## Deskripcija Prikazuje textdraw za određenog igrača. | Ime | Deskripcija | | -------- | --------------------------------------------------------------- | | playerid | ID igrača za prikazati textdraw. | | text | ID textdrawa za prikazati. Returnovan/vraćen od TextDrawCreate. | ## Returns 1: Funkcija uspješno izvršena. 0: Funkcija neuspješno izvršena. Ovo znači da navedeni igrač i/ili textdraw ne postoji. ## Primjeri ```c public OnPlayerConnect(playerid) { new Text: textId = TextDrawCreate(100.0, 100.0, "Dobrodosao!"); TextDrawShowForPlayer(playerid, textId); } ``` ## Zabilješke :::tip Ako će samo jedan igrač vidjeti textdraw, bilo bi pametno da koristite player-textdraw-ove. Ovo je također koristno za textdraw-ove koji moraju da prikažu informacije koje su posebne za svakog igrača posebno. ::: ## Srodne Funkcije - [TextDrawHideForPlayer](TextDrawHideForPlayer): Sakrij textdraw za određenog igrača. - [TextDrawShowForAll](TextDrawShowForAll): Prikaži textdraw za sve igrače. - [TextDrawHideForAll](TextDrawHideForAll): Sakrij textdraw za sve igrače.
openmultiplayer/web/docs/translations/bs/scripting/functions/TextDrawShowForPlayer.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/TextDrawShowForPlayer.md", "repo_id": "openmultiplayer", "token_count": 582 }
357
--- title: atan2 description: . tags: [] --- :::warning Ova funkcija započinje malim slovom. ::: :::warning Obratite pažnju da je vrijednost y prvi parametar, a vrijednost x drugi parametar. ::: ## Deskripcija Dobijte obrnutu vrijednost tangente luka od y / x, izraženu u radijanima. | Ime | Deskripcija | | ------- | ---------------------------------------------- | | Float:y | Vrijednost koja predstavlja udio y-koordinate. | | Float:x | Vrijednost koja predstavlja udio y-koordinate. | ## Returns Vraća glavnu vrijednost tangente luka od y / x, izraženu u radijanima. Da bi izračunala vrijednost, funkcija uzima u obzir znak oba argumenta kako bi odredila kvadrant. ## Primjeri ```c //Tangenta luka za (x=-10.000000, y=10.000000) je 135.000000 stepeni. public OnGameModeInit() { new Float:x, Float:y, Float:result; x = -10.0; y = 10.0; result = atan2 (y,x) * 180 / PI; printf ("Tangenta luka za (x=%f, y=%f) je %f stepeni\n", x, y, result ); return 0; } ``` ## Srodne Funkcije - [floatsin](floatsin): Uzmite sinus iz određenog ugla. - [floatcos](floatcos): Uzmite kosinus iz određenog ugla. - [floattan](floattan): Uzmite tangentu pod određenim uglom.
openmultiplayer/web/docs/translations/bs/scripting/functions/atan2.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/atan2.md", "repo_id": "openmultiplayer", "token_count": 583 }
358
--- title: floatcos description: Dobijte kosinus iz zadanog ugla. tags: [] --- :::warning Ova funkcija započinje malim slovom. ::: ## Deskripcija Dobijte kosinus iz zadanog ugla. Ulazni kut može biti u radijanima, stupnjevima ili stupnjevima. | Ime | Deskripcija | | ----------- | ---------------------------------------------------------- | | Float:value | Ugao iz kojeg se dobija kosinus. | | anglemode | Način kuta koji se koristi, ovisno o unesenoj vrijednosti. | ## Returns Kosinus unesene vrijednosti. ## Primjeri ```c public OnGameModeInit() { printf("kosinus iz 90° je %f", floatcos(90.0, degrees)); // Output: 0 return 1; } ``` ## Zabilješke :::warning GTA / SA-MP u većini slučajeva koriste stupnjeve za uglove, na primjer GetPlayerFacingAngle. Stoga ćete najvjerojatnije htjeti koristiti način rada pod uglom 'stupnjeva', a ne radijane. Takođe imajte na umu da su uglovi u GTA suprotno kazaljki na satu; 270° je istok, a 90° zapad. Jug je i dalje 180°, a sjever još uvijek 0° / 360°. ::: ## Srodne Funkcije - [floatsin](floatsin): Uzmite sinus iz određenog ugla. - [floattan](floattan): Dobijte tangentu iz određenog ugla.
openmultiplayer/web/docs/translations/bs/scripting/functions/floatcos.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/floatcos.md", "repo_id": "openmultiplayer", "token_count": 600 }
359
--- title: fread description: Pročitajte jedan redak iz datoteke. tags: [] --- :::warning Ova funkcija započinje malim slovom. ::: ## Deskripcija Pročitajte jedan redak iz datoteke. | Ime | Deskripcija | | ------ | ----------------------------------------------------------------- | | handle | Upravitelj datoteke za upotrebu, otvorila je fopen () | | string | String niza za čuvanje pročitanog teksta, proslijeđen referencom. | | size | Broj bajtova za čitanje. | | pack | Da li bi niz trebao biti spakovan? true/false. | ## Returns Dužina niza (pročitani tekst) kao cijeli broj. ## Primjeri ```c // Otvori "file.txt" u "read only" modu (samo čitanje) new File:handle = fopen("file.txt", io_read), // Inicijalizirajte "buf" buf[128]; // Provjerite je li datoteka otvorena if (handle) { // Uspješno // Čitajte cijelu datoteku while(fread(handle, buf)) print(buf); // Zatvori fajl/datoteku fclose(handle); } else { // Error print("The file \"file.txt\" does not exists, or can't be opened."); } // Otvorite "file.txt" u "read and write" načinu (čitanje i pisanje) new File:handle = fopen("file.txt"), // Inicijalizirajte "buf" buf[128]; // Provjeri da li je fajl/datoteka otvoren/a if (handle) { // Uspješno // Čitajte cijelu datoteku while(fread(handle, buf)) print(buf); // Postavite pokazivač datoteke na prvi bajt fseek(handle, _, seek_begin); // Upiši "I just wrote here!" u ovaj fajl fwrite(handle, "I just wrote here!"); // Zatvori fajl/datoteku fclose(handle); } else { // Error print("File \"file.txt\" ne postoji, ili ne može biti otvoren."); } ``` ## Zabilješke :::warning Korištenje nevaljanog upravitelja srušit će vaš server! Nabavite važeći upravitelj pomoću fopen ili ftemp. ::: ## 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/fread.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/fread.md", "repo_id": "openmultiplayer", "token_count": 1298 }
360
--- title: memcpy description: Kopirajte bajtove s jedne lokacije na drugu. tags: [] --- :::warning Ova funkcija započinje malim slovom. ::: ## Deskripcija Kopirajte bajtove s jedne lokacije na drugu. | Ime | Deskripcija | | --------------------- | --------------------------------------------------------------------------- | | dest[] | Niz u koji se kopiraju bajtovi iz izvora. | | const source[] | Izvorni niz. | | index | Početni indeks u bajtovima u odredišnom nizu u koji treba kopirati podatke. | | numbytes | Broj bajtova (ne ćelija) za kopiranje. | | maxlength=sizeof dest | Maksimalan broj ćelija koje se uklapaju u odredišni međuspremnik. | ## Returns True/tačno pri uspješnom, false/netačno pri grešci. ## Primjeri ```c //Spojite dva stinga s memcpy new destination[64] = "Ovo je ", source[] = "niz u 32-bitnom nizu"; memcpy(destination, source, strlen(destination) * 4, sizeof source * 4, sizeof destination); print(destination); //Izlaz: Ovo je niz u 32-bitnom nizu ``` ## Srodne Funkcije - [strcmp](strcmp): Uporedite dva stringa da biste vidjeli jesu li isti. - [strfind](strfind): Potražite podstring u stringu. - [strdel](strdel): Izbriši dio/cijeli string. - [strins](strins): Stavite string u drugi string. - [strlen](strlen): Provjeri dužinu stringa. - [strmid](strmid): Izdvoji znakove iz stringa. - [strpack](strpack): Spakujte string u odredište. - [strval](strval): Pronađi vrijednost strina. - [strcat](strcat): Spoji dva stringa.
openmultiplayer/web/docs/translations/bs/scripting/functions/memcpy.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/memcpy.md", "repo_id": "openmultiplayer", "token_count": 886 }
361
--- title: strmid description: Izvuci niz znakova iz stringa. tags: [] --- :::warning Ova funkcija započinje malim slovom. ::: ## Deskripcija Izvuci niz znakova iz stringa. | Ime | Deskripcija | | --------------------- | -------------------------------------------------------------- | | dest[] | String za pohraniti izdvojene karaktere. | | const source[] | String iz kojeg se izdvajaju karakteri. | | start | Pozicija prvog karaktera. | | end | Pozicija posljednjeg karaktera. | | maxlength=sizeof dest | Dužina odredišta. (Biće veličina dest-a po zadanim postavkama) | ## Returns Broj karaktera pohranjenih u dest[] ## Primjeri ```c strmid(string, "Extract 'HELLO' without the !!!!: HELLO!!!!", 34, 39); //string sadrži "HELLO" ``` ## Srodne Funkcije - [strcmp](strcmp): Uporedi dva stringa kako bi provjerio da li su isti. - [strfind](strfind): Pretraži string u drugom stringu. - [strins](../function/strins): Unesi tekst u string. - [strlen](../function/strlen): Dobij dužinu stringa. - [strpack](strpack): Upakuj string u odredišni string. - [strval](strval): Pretvori string u cijeli broj. - [strcat](strcat): Spojite dva stringa u odredišnu referencu. - [strdel](strdel): Obriši dio stringa.
openmultiplayer/web/docs/translations/bs/scripting/functions/strmid.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/strmid.md", "repo_id": "openmultiplayer", "token_count": 721 }
362
--- title: Stilovi Rezanja Kamere --- :::info Stilove rezanja kamere koriste nativi kao npr [SetPlayerCameraLookAt](../functions/SetPlayerCameraLookAt), [InterpolateCameraPos](../functions/InterpolateCameraPos) i [InterpolateCameraLookAt](../functions/InterpolateCameraLookAt). ::: ## Stilovi Rezanja | ID | Stil | Deskripcija | | --- | ----------- | ----------------------------------------------------------------------- | | 1 | CAMERA_MOVE | The camera position and/or target will move to its new value over time. | | 2 | CAMERA_CUT | The camera position and/or target will move to its new value instantly. |
openmultiplayer/web/docs/translations/bs/scripting/resources/cameracutstyles.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/resources/cameracutstyles.md", "repo_id": "openmultiplayer", "token_count": 258 }
363
--- title: OnFilterScriptExit description: Wird aufgerufen wenn ein Filterscript deaktiviert wird. tags: [] --- ## Beschreibung Wird aufgerufen wenn ein Filterscript deaktiviert wird. Wird nur im entsprechenden Filterscript ausgeführt. ## Beispiele ```c public OnFilterScriptExit() { print("\n--------------------------------------"); print(" Filterscript herausgeladen"); print("--------------------------------------\n"); return 1; } ``` ## Ähnliche Callbacks - [OnFilterScriptInit](OnFilterScriptInit): Wird aufgerufen wenn ein Filterscript geladen wird. - [OnGameModeInit](OnGameModeInit): Wird aufgerufen wenn ein Gamemode gestartet wird. - [OnGameModeExit](OnGameModeExit): Wird aufgerufen wenn ein Gamemode gestoppt wird.
openmultiplayer/web/docs/translations/de/scripting/callbacks/OnFilterScriptExit.md/0
{ "file_path": "openmultiplayer/web/docs/translations/de/scripting/callbacks/OnFilterScriptExit.md", "repo_id": "openmultiplayer", "token_count": 275 }
364
--- título: OnClientCheckResponse descripción: Este callback se llama cuando una función SendClientCheck es completada. tags: [] --- ## Descripción Este callback se llama cuando una función SendClientCheck es completada. | Nombre | Descripción | | ------------- | --------------------------------- | | playerid | El ID del jugador verificado. | | actionid | El tipo de chequeo realizado. | | memaddr | La dirección requerida. | | retndata | El resultado del chequeo. | ## Devoluciones Siempre se llama primero en filterscripts. ## Ejemplos ```c public OnPlayerConnect(playerid) { SendClientCheck(playerid, 0x48, 0, 0, 2); return 1; } public OnClientCheckResponse(playerid, actionid, memaddr, retndata) { if(actionid == 0x48) // or 72 { print("ADVERTENCIA: El jugador no parece estar usando una computadora normal!"); Kick(playerid); } return 1; } ``` ## Notas :::warning Este callback sólo se llama cuando está en un filterscript. ::: ## Funciones Relacionadas - [SendClientCheck](../functions/SendClientCheck): Realiza un chequeo de memoria en el cliente.
openmultiplayer/web/docs/translations/es/scripting/callbacks/OnClientCheckResponse.md/0
{ "file_path": "openmultiplayer/web/docs/translations/es/scripting/callbacks/OnClientCheckResponse.md", "repo_id": "openmultiplayer", "token_count": 490 }
365
--- título: OnPlayerConnect descripción: Este callback se llama cuando un jugador se conecta al servidor. tags: ["player"] --- ## Descripción Este callback se llama cuando un jugador se conecta al servidor. | Nombre | Descripción | | -------- | ------------------------------------ | | playerid | El ID del jugador que se conectó. | ## Devoluciones 1 - Prevendrá a otros filterscripts de recibir este callback. 0 - Indica que este callback será pasado al siguiente filterscript. Siempre se llama primero en filterscripts. ## Ejemplos ```c public OnPlayerConnect(playerid) { new string[64], playerName[MAX_PLAYER_NAME]; GetPlayerName(playerid, playerName, MAX_PLAYER_NAME); format(string, sizeof string, "%s ingresó al servidor. Bienvenido!", playerName); SendClientMessageToAll(0xFFFFFFAA, string); return 1; } ``` ## Notas <TipNPCCallbacksES /> ## Funciones Relacionadas
openmultiplayer/web/docs/translations/es/scripting/callbacks/OnPlayerConnect.md/0
{ "file_path": "openmultiplayer/web/docs/translations/es/scripting/callbacks/OnPlayerConnect.md", "repo_id": "openmultiplayer", "token_count": 368 }
366
--- título: OnPlayerLeaveRaceCheckpoint descripcion: Este callback se llama cuando un jugador sale de un checkpoint de carreras. tags: ["player", "checkpoint", "racecheckpoint"] --- ## Descripción Este callback se llama cuando un jugador sale de un checkpoint de carreras. | Nombre | Descripción | | -------- | ------------------------------------------------------- | | playerid | El ID del jugador que salió del checkpoint de carreras. | ## Devoluciones Siempre se llama primero en filterscripts. ## Ejemplos ```c public OnPlayerLeaveRaceCheckpoint(playerid) { printf("El jugador %d salió de un checkpoint de carreras!", playerid); return 1; } ``` ## Notas <TipNPCCallbacksES /> ## Funciones Relacionadas - [SetPlayerCheckpoint](../functions/SetPlayerCheckpoint): Crear un checkpoint a un jugador. - [DisablePlayerCheckpoint](../functions/DisablePlayerCheckpoint): Deshabilitar el checkpoint actual de un jugador. - [IsPlayerInCheckpoint](../functions/IsPlayerInCheckpoint): Comprobar si el jugador está en un checkpoint. - [SetPlayerRaceCheckpoint](../functions/SetPlayerRaceCheckpoint): Crear un checkpoint de carreras a un jugador. - [DisablePlayerRaceCheckpoint](../functions/DisablePlayerRaceCheckpoint): Deshabilitar el checkpoint de carreras actual del jugador. - [IsPlayerInRaceCheckpoint](../functions/IsPlayerInRaceCheckpoint): Comprobar si el jugador está en un checkpoint de carreras.
openmultiplayer/web/docs/translations/es/scripting/callbacks/OnPlayerLeaveRaceCheckpoint.md/0
{ "file_path": "openmultiplayer/web/docs/translations/es/scripting/callbacks/OnPlayerLeaveRaceCheckpoint.md", "repo_id": "openmultiplayer", "token_count": 477 }
367
--- título: OnRconCommand descripción: Este callback se llama cuando un comando es enviado mediante la consola del servidor, RCON remoto, o vía el juego usando "/rcon command". tags: [] --- ## Descripción Este callback se llama cuando un comando es enviado mediante la consola del servidor, RCON remoto, o vía el juego usando "/rcon command". | Nombre | Descripción | | ------- | -------------------------------------------------------------------------------------- | | cmd[] | Un string conteniendo el comando que fue escrito, así como cualquier parámetro pasado. | ## Devoluciones 1 - Prevendrá a otros filterscripts de recibir este callback. 0 - Indica que este callback será pasado al siguiente filterscript. Siempre se llama primero en filterscripts. ## Ejemplos ```c public OnRconCommand(cmd[]) { printf("[RCON]: Escribiste '/rcon %s'!", cmd); return 0; } public OnRconCommand(cmd[]) { if (!strcmp(cmd, "hello", true)) { SendClientMessageToAll(0xFFFFFFAA, "Hello World!"); print("You said hello to the world."); // Esto le aparecerá al jugador que escribió el comando rcon en el chat en blanco. return 1; } return 0; } ``` ## Notas :::tip "/rcon " no está incluido en "cmd" cuando un jugador esribe un comando. Si usas la función "print" acá, esta enviará un mensaje al jugador que escribió el comando en el juego así como en el log de la consola. Este callback no se llama cuando el jugador no está logeado como un admin RCON. Cuando el jugador no está logeado como RCON y usa /rcon login, este callback no va a ser llamado y OnRconLoginAttempt es llamado en su lugar. Sin embargo, cuando el jugador está logeado como RCON, el uso de este comando llamará este callback. ::: :::warning Necesitarás incluir este callback en un filterscript cargado para que funcione en el gamemode! ::: ## Funciones Relacionadas - [IsPlayerAdmin](../functions/IsPlayerAdmin): Comprueba si un jugador está logeado como RCON. - [OnRconLoginAttempt](OnRconLoginAttempt): Se llama cuando hay un intento de identificarse como RCON.
openmultiplayer/web/docs/translations/es/scripting/callbacks/OnRconCommand.md/0
{ "file_path": "openmultiplayer/web/docs/translations/es/scripting/callbacks/OnRconCommand.md", "repo_id": "openmultiplayer", "token_count": 820 }
368
--- title: Problemas Comunes --- ## El servidor se bloquea instantáneamente al iniciarse Lo más común es que se deba a un error en tu archivo server.cfg o a la falta de un gamemode. Verifica el archivo server_log.txt y la razón debería estar ubicada en la parte inferior. Si no está ahí, verifica el archivo crashinfo.txt. La mejor solución para descubrir qué está causando el bloqueo es utilizar el plugin Crash Detect de Zeex/0x5A656578 ([clic aquí para acceder](https://github.com/Zeex/samp-plugin-crashdetect)), que proporcionará más información, como números de línea, nombres de función, valores de parámetros, etc. Si el script está compilado en modo de depuración (-d3 flag) para que el compilador incluya información adicional en el archivo .amx de salida. ## El servidor no funciona: el firewall está desactivado Necesitarás redirigir tus puertos para permitir que los jugadores se unan a tu servidor. Puedes redirigir tus puertos utilizando PF Port Checker. Descárgalo desde: www.portforward.com. Si los puertos no están redirigidos, significa que deberás abrirlos en tu enrutador. Puedes consultar la lista de enrutadores en [http://portforward.com/english/routers/port_forwarding/routerindex.htm](http://portforward.com/english/routers/port_forwarding/routerindex.htm). Allí encontrarás toda la información sobre cómo redirigir los puertos. ## 'Packet was modified' El error comúnmente se muestra como: ``` [hh:mm:ss] Packet was modified, sent by id: <id>, ip: <ip>:<port> ``` Esto ocurre cuando un jugador tiene problemas de conexión o está experimentando un timeout. ## 'Warning: client exceeded 'messageslimit' (1) <ip>:<port> (<count>) Limit: x/sec' El error comúnmente se muestra como: ``` Warning: client exceeded 'messageslimit' (1) <ip>:<port> (<count>) Limit: x/sec ``` Esto ocurre cuando el número de mensajes por segundo que un cliente envía al servidor se excede. ## 'Warning: client exceeded 'ackslimit' <ip>:<port> (<count>) Limit: x/sec' El error comúnmente se muestra como: ``` Warning: client exceeded 'ackslimit' <ip>:<port> (<count>) Limit: x/sec ``` Esto ocurre cuando se supera el límite de acks. ## 'Warning: client exceeded messageholelimit' El error comúnmente se muestra como: ``` Warning: client exceeded messageholelimit ``` Esto ocurre cuando se excede el "message hole" límite. ## 'Warning: Too many out-of-order messages' El error comúnmente se muestra como: ``` Warning: Too many out-of-order messages ``` Ocurre cuando los 'mensajes fuera de orden' reutilizan la configuración de límite de hueco de mensajes. Para obtener más información al respecto, consulta [este enlace](https://open.mp/docs/server/ControllingServer#RCON_Commands). ## Jugadores reciben constantemente el error de "Nombre de usuario inaceptable" aunque sea válido Si estás seguro de que estás usando un nombre de usuario aceptable y el servidor se está ejecutando en Windows, intenta cambiar la opción de compatibilidad del samp-server.exe a Windows 98 y el problema debería resolverse después de reiniciar el servidor. Los servidores de Windows con un tiempo de actividad prolongado también pueden causar este problema. Esto se ha observado después de aproximadamente 50 días de actividad del servidor. Para resolverlo, es necesario reiniciar el servidor. ## `MSVCR___.dll`/`MSVCP___.dll` no se encuentra Este problema ocurre regularmente en servidores de Windows al intentar cargar un complemento desarrollado con una versión más reciente de las bibliotecas de Visual C++ de las que están instaladas actualmente en tu computadora. Para solucionarlo, descarga las bibliotecas apropiadas de Visual C++ de Microsoft. Ten en cuenta que el servidor SA-MP es de 32 bits, por lo que también deberás descargar la versión de 32 bits (x86) de las bibliotecas, independientemente de la arquitectura. La versión específica de las bibliotecas se indica por los números en el nombre del archivo (consulta la tabla a continuación), aunque no está de más instalar todas ellas. Estas bibliotecas no se acumulan, o en otras palabras: no obtendrás las bibliotecas para las versiones de 2013 y anteriores si solo instalas la versión de 2015. | Número de Versión | Runtime | | ------------------ | --------------------------------------------- | | 10.0 | Microsoft Visual C++ 2010 x86 Redistribuible | | 11.0 | Microsoft Visual C++ 2012 x86 Redistribuible | | 12.0 | Microsoft Visual C++ 2013 x86 Redistribuible | | 14.0 | Microsoft Visual C++ 2015 x86 Redistribuible |
openmultiplayer/web/docs/translations/es/server/CommonServerIssues.md/0
{ "file_path": "openmultiplayer/web/docs/translations/es/server/CommonServerIssues.md", "repo_id": "openmultiplayer", "token_count": 1687 }
369
--- title: strcmp description: دو رشته را مقایسه می کند تا ببینید آیا یکسان هستند. tags: ["string"] --- <div dir="rtl" style={{ textAlign: "right" }}> :::warning این تابع با یک حرف کوچک شروع می شود. ::: ## توضیحات دو رشته را مقایسه می کند تا ببینید آیا یکسان هستند. | اسم | توضیح | | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | | string1 | اولین رشته برای مقایسه | | string2 | دومین رشته برای مقایسه | | ignorecase (اختیاری) | وقتی روی true تنظیم شد، حالت مهم نیست - HeLLo همان Hello است. هنگامی که false است، آنها یکسان نیستد(به صورت پیشفرض false میباشد). | | length (اختیاری) | وقتی این طول تعیین شود ، اولین کاراکترهای x مقایسه می شوند - با انجام "Hello" و "Hell No" با طول 4 ، این همان رشته است. | ## مقادیر برگشتی اگر رشته ها با طول مشخص شده با هم مطابقت داشته باشند 0 بر می گرداند; اگر برخی از کاراکتر ها با هم مطابقت نداشته باشند: string1 [i] - string2 [i] ('i' شاخص کاراکتر را از 0 نشان می دهد) 1 یا -1 برمی گرداند؛ تفاوت در تعداد کاراکتر ها اگر یک رشته باشد فقط با بخشی از رشته دیگر مطابقت دارد. ## مثال ها </div> ```c new string1[] = "Hello World"; new string2[] = "Hello World"; // Barresi kardan baraye moshabeh boodan reshte ha if (!strcmp(string1, string2)) new string3[] = "Hell"; // Barresi kardan baraye motabeghat dashtane 4 character avval if (!strcmp(string2, string3, false, 4)) // Barresi kardane reshte haye khali ba isnull() if (!strcmp(string1, string2) && !isnull(string1) && !isnull(string2)) // Tarife isnull(): #if !defined isnull #define isnull(%1) ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1])))) #endif ``` <div dir="rtl" style={{ textAlign: "right" }}> ## نکته ها :::warning اگر هر رشته خالی باشد ، این تابع 0 را برمی گرداند. رشته های null را با isnull () بررسی کنید. اگر رشته ها را از یک فایل متنی مقایسه می کنید ، باید هنگام استفاده از fread ، کاراکتر های خاص "carriage return" و "خط جدید" را در نظر بگیرید (n \r\) ، همانطور که در آنها گنجانده شده است. ::: ## تابع های مرتبط - [strfind](strfind): جست و جو کردن رشته ای در رشته دیگر - [strdel](strdel): بخشی از رشته را حذف کردن. - [strins](../function/strins): قرارد دادن متن در یک رشته. - [strlen](../function/strlen): گرفتن طول یک رشته. - [strmid](strmid): استخراج کردن بخشی از رشته به رشته دیگر. - [strpack](strpack): قرار دادن یک رشته به رشته مقصد. - [strval](strval): تبدیل کردن یک رشته به عدد صحیح. - [strcat](strcat): پیوند دادن دو رشته در یک مرجع مقصد. - http://www.compuphase.com/pawn/String_Manipulation.pdf </div>
openmultiplayer/web/docs/translations/fa/scripting/functions/strcmp.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fa/scripting/functions/strcmp.md", "repo_id": "openmultiplayer", "token_count": 2319 }
370
--- title: OnFilterScriptInit description: This callback is called when a filterscript is initialized (loaded). tags: [] --- ## Deskripsyon Ang callback na ito ay natatawag kapag ang filterscript ay naload na sa server. ## Mga Halimbawa ```c public OnFilterScriptInit() { print("\n--------------------------------------"); print("The filterscript is loaded."); print("--------------------------------------\n"); return 1; } ``` ## Mga Kaugnay na Functions
openmultiplayer/web/docs/translations/fil/scripting/callbacks/OnFilterScriptInit.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fil/scripting/callbacks/OnFilterScriptInit.md", "repo_id": "openmultiplayer", "token_count": 143 }
371
--- title: OnPlayerCommandText description: This callback is called when a player enters a command into the client chat window. tags: ["player"] --- ## Description Ang callback na ito ay itinatawag kapag ang player ay nag-input ng command sa client chat window. Ang command ay lahat ng mensahe na itinatype sa client chat window na nagsisimula s aforward slash '/', e.g. /help. | Name | Description | | --------- | ----------------------------------------------------------- | | playerid | Ang ID ng player na nagtype ng command. | | cmdtext[] | Ang command na itinype. (kasama dito ang forward slash '/') | ## Returns Ito ay palaging itinatawag una sa mga filterscript, kaya ang pag return ng 1 ay ipinagbabawal ang ibang script na makita ito. ## Examples ```c public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/help", true)) { SendClientMessage(playerid, -1, "SERVER: Ito ang /help command."); return 1; // Ang pag return ng 1 ay nagsasabi na ang command ay na-iprocess na. // Ang OnPlayerCommandText ay hindi matatawag sa ibang script. } return 0; // Ang pag return ng 0 ay nagsasabi na ang command ay hindi na-process ng script. // Ang OnPlayerCommandText ay tatawagin sa ibang script hanggang mayroong isa na mag return 1. // Kung walang script ang mag return 1, may lalabas na mensahe na 'SERVER: Unknown command.'. } ``` ## Notes <TipNPCCallbacks /> ## Related Functions - [SendRconCommand](../functions/SendRconCommand.md): Mag send ng RCON command gamit ang script.
openmultiplayer/web/docs/translations/fil/scripting/callbacks/OnPlayerCommandText.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fil/scripting/callbacks/OnPlayerCommandText.md", "repo_id": "openmultiplayer", "token_count": 590 }
372
--- title: AddPlayerClassEx description: Ang function na ito ay eksaktong kapareho ng AddPlayerClass function, kasama ang pagdaragdag ng isang parameter ng koponan. tags: ["player"] --- ## Description Ang function na ito ay eksaktong kapareho ng AddPlayerClass function, kasama ang pagdaragdag ng isang parameter ng koponan. | Name | Description | | ------------- | --------------------------------------------------------------------------- | | teamid | Ang koponan na gusto mong ipanganak ng manlalaro. | | modelid | Ang koponan na gusto mong ipanganak ng manlalaro. | | Float:spawn_x | Ang X coordinate ng posisyon ng spawn ng klase. | | Float:spawn_y | Ang Y coordinate ng posisyon ng spawn ng klase. | | Float:spawn_z | Ang Z coordinate ng posisyon ng spawn ng klase. | | Float:z_angle | Ang direksyon kung saan haharapin ang manlalaro pagkatapos ng pangingitlog. | | weapon1 | Ang unang spawn-weapon para sa player. | | weapon1_ammo | Ang dami ng bala para sa unang spawn weapon. | | weapon2 | Ang pangalawang spawn-weapon para sa player. | | weapon2_ammo | Ang dami ng bala para sa pangalawang spawn weapon. | | weapon3 | Ang ikatlong spawn-weapon para sa player. | | weapon3_ammo | Ang dami ng bala para sa ikatlong spawn weapon. | ## Returns Ang ID ng klase na kakadagdag lang. 319 kung naabot ang limitasyon ng klase (320). Ang pinakamataas na posibleng class ID ay 319. ## Examples ```c public OnGameModeInit() { // Ang mga manlalaro ay maaaring mag-spawn bilang alinman sa: // CJ Skin (ID 0) sa team 1. // The Truth skin (ID 1) sa team 2. AddPlayerClassEx(1, 0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0); // CJ AddPlayerClassEx(2, 1, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0); // The Truth return 1; } ``` ## Notes :::tip Ang maximum class ID ay 319 (simula sa 0, kaya ang kabuuang 320 na klase). Kapag naabot na ang limitasyong ito, papalitan ng anumang klase na idaragdag ang ID 319. ::: ## Related Functions - [AddPlayerClass](AddPlayerClass): Magdagdag ng klase. - [SetSpawnInfo](SetSpawnInfo): Itakda ang setting ng spawn para sa isang player. - [SetPlayerTeam](SetPlayerTeam): Magtakda ng koponan ng manlalaro. - [SetPlayerSkin](SetPlayerSkin): Itakda ang balat ng isang manlalaro.
openmultiplayer/web/docs/translations/fil/scripting/functions/AddPlayerClassEx.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fil/scripting/functions/AddPlayerClassEx.md", "repo_id": "openmultiplayer", "token_count": 1233 }
373
--- title: AttachObjectToObject description: Maaari mong gamitin ang function na ito upang ilagay ang mga object sa iba pang mga object. tags: [] --- ## Description Maaari mong gamitin ang function na ito upang ilagay ang mga object sa iba pang mga object. | Name | Description | | ------------- | ----------------------------------------------------------------------- | | objectid | Ang object na ikakabit sa isa pang object. | | attachtoid | Ang object na ikakabit sa object. | | Float:OffsetX | Ang distansya sa pagitan ng pangunahing object at object sa direksyon ng X.| | Float:OffsetY | Ang distansya sa pagitan ng pangunahing object at object sa direksyon ng Y.| | Float:OffsetZ | Ang distansya sa pagitan ng pangunahing object at object sa direksyon ng Z.| | Float:RotX | Ang pag-ikot ng X sa pagitan ng object at ng pangunahing object | | Float:RotY | Ang pag-ikot ng Y sa pagitan ng object at ng pangunahing object. | | Float:RotZ | Ang pag-ikot ng Z sa pagitan ng object at ng pangunahing object. | | SyncRotation | Kung nakatakda sa 0, ang pag-ikot ng objectid ay hindi magbabago sa attachtoid's.| ## Returns 1: Matagumpay na naisakatuparan ang function. 0: Nabigo ang function na isagawa. Nangangahulugan ito na ang unang object (objectid) ay wala. Walang mga panloob na pagsusuri upang i-verify na ang pangalawang object (attachtoid) ay umiiral. ## Examples ```c new gObjectId = CreateObject(...); new gAttachToId = CreateObject(...); AttachObjectToObject(gObjectId, gAttachToId, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1); ``` ## Notes :::tip Ang parehong object ay kailangang gawin bago subukang ilakip ang mga ito. Walang player-object na bersyon ng function na ito (AttachPlayerObjectToObject), ibig sabihin ay hindi ito susuportahan ng mga streamer. ::: ## Related Functions - [AttachObjectToPlayer](AttachObjectToPlayer): Maglagay ng isang object sa isang manlalaro. - [AttachObjectToVehicle](AttachObjectToVehicle): Ikabit ang isang object sa isang sasakyan. - [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): Maglagay ng object ng player sa isang player. - [CreateObject](CreateObject): Gumawa ng object. - [DestroyObject](DestroyObject): Sirain ang object. - [IsValidObject](IsValidObject): Sinusuri kung wasto ang object. - [MoveObject](MoveObject): Ilipat ang object. - [StopObject](StopObject): Itigil ang paglipat ng object. - [SetObjectPos](SetObjectPos): I-set ang posisyon ng object. - [SetObjectRot](SetObjectRot): I-set ang rotasyon ng object. - [GetObjectPos](GetObjectPos): Hanpin ang object. - [GetObjectRot](GetObjectRot): Tignan ang rotasyon ng object. - [CreatePlayerObject](CreatePlayerObject): Gumawa ng object para lamang sa isang manlalaro. - [DestroyPlayerObject](DestroyPlayerObject): Sirain ang player object. - [IsValidPlayerObject](IsValidPlayerObject): Tignan kung valid ang isang object ng player. - [MovePlayerObject](MovePlayerObject): Ilipat ang player object. - [StopPlayerObject](StopPlayerObject): Itigil ang paglipat ng player object. - [SetPlayerObjectPos](SetPlayerObjectPos): I-set ang posisyon ng player object. - [SetPlayerObjectRot](SetPlayerObjectRot): I-set ang rotasyon ng player object. - [GetPlayerObjectPos](GetPlayerObjectPos): Hanapin ang player object. - [GetPlayerObjectRot](GetPlayerObjectRot): Tignan ang rotasyon ng player object.
openmultiplayer/web/docs/translations/fil/scripting/functions/AttachObjectToObject.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fil/scripting/functions/AttachObjectToObject.md", "repo_id": "openmultiplayer", "token_count": 1239 }
374
--- title: FindModelFileNameFromCRC description: Maghanap ng umiiral nang custom skin o simple object model file. tags: [] --- <VersionWarn version='SA-MP 0.3.DL R1' /> ## Description Maghanap ng umiiral nang custom skin o simple object model file. Ang mga file ng model ay matatagpuan sa folder ng server ng mga models bilang default (setting ng artpath). | Name | Description | | ----------- | --------------------------------------------------------------------- | | crc | Ang checksum ng CRC ng custom na file ng model. | | retstr[] | Isang array kung saan iimbak ang .dff file name, na ipinasa sa pamamagitan ng reference. | | retstr_size | Ang haba ng string na dapat itabi. | ## Returns 1: Matagumpay na naisakatuparan ang function. 0: Nabigo ang function na isagawa. ## Related Functions - [OnPlayerFinishedDownloading](../callbacks/OnPlayerFinishedDownloading): Tinatawag kapag natapos ng player ang pag-download ng mga custom model.
openmultiplayer/web/docs/translations/fil/scripting/functions/FindModelFileNameFromCRC.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fil/scripting/functions/FindModelFileNameFromCRC.md", "repo_id": "openmultiplayer", "token_count": 416 }
375
--- title: PutPlayerInVehicle description: Puts a player in a vehicle. tags: ["player", "vehicle"] --- ## Paglalarawan Inilalagay ang isang manlalaro sa isang sasakyan. | Name | Description | | --------- | ------------------------------------------------- | | playerid | Ang ID ng player na ilalagay sa isang sasakyan. | | vehicleid | Ang ID ng sasakyan kung saan ilalagay ang player. | | seatid | Ang ID ng upuan kung saan ilalagay ang player. | ## Returns 1: Matagumpay na naisakatuparan ang function. 0: Nabigong maisagawa ang function. Ang manlalaro o sasakyan ay wala. ## Halimbawa ng Paggamit ```c public OnPlayerEnterVehicle(playerid, vehicleid, ispassanger) { PutPlayerInVehicle(playerid, vehicleid, 0); return 1; } ``` ``` 0 - Driver 1 - Front passenger 2 - Back-left passenger 3 - Back-right passenger 4+ - Passenger seats (coach etc.) ``` ## Mga Dapat Unawain :::tip - Maaari mong gamitin ang GetPlayerVehicleSeat sa isang loop upang tingnan kung ang isang upuan ay inookupahan ng sinumang manlalaro. ::: :::warning - Kung ang upuan ay hindi wasto o kinuha, ay magdudulot ng pag-crash kapag LUMABAS sila sa sasakyan. ::: ## Mga Kaugnay na Functions - [RemovePlayerFromVehicle](./RemovePlayerFromVehicle): Itapon ang isang manlalaro sa labas ng kanilang sasakyan. - [GetPlayerVehicleID](./GetPlayerVehicleID): Kunin ang ID ng sasakyan kung saan nakasakay ang player. - [GetPlayerVehicleSeat](./GetPlayerVehicleSeat): Suriin kung saan nakaupo ang isang manlalaro. - [OnPlayerEnterVehicle](../callbacks/OnPlayerEnterVehicle): Tinatawag kapag nagsimulang pumasok ang isang manlalaro sa isang sasakyan.
openmultiplayer/web/docs/translations/fil/scripting/functions/PutPlayerInVehicle.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fil/scripting/functions/PutPlayerInVehicle.md", "repo_id": "openmultiplayer", "token_count": 648 }
376
--- title: StartRecordingPlayback description: Ito ay mag ru-run ng .rec file na kailangang i-save sa npcmodes/recordings folder. Ang mga file na ito ay nagpapahintulot sa NPC na sundin ang ilang mga aksyon. Ang kanilang mga aksyon ay maaaring maitala nang manu-mano. Para sa karagdagang impormasyon, tingnan ang mga kaugnay na function. tags: [] --- ## Description Ito ay mag ru-run ng .rec file na kailangang i-save sa npcmodes/recordings folder. Ang mga file na ito ay nagpapahintulot sa NPC na sundin ang ilang mga aksyon. Ang kanilang mga aksyon ay maaaring maitala nang manu-mano. Para sa karagdagang impormasyon, tingnan ang mga kaugnay na function. | Name | Description | | ------------ | --------------------------------------------------------------- | | playbacktype | Ang [type](../resources/recordtypes) ng recording na i-loload. | | recordname[] | Ang filename na i-loload, nang walang .rec extension. | ## Examples ```c public OnNPCEnterVehicle(vehicleid, seatid) { StartRecordingPlayback(PLAYER_RECORDING_TYPE_DRIVER, "at400_lv_to_sf_x1"); } ``` ## Related Functions - [StopRecordingPlayerData](StopRecordingPlayerData): Humihinto sa pagre-record ng data ng player.
openmultiplayer/web/docs/translations/fil/scripting/functions/StartRecordingPlayback.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fil/scripting/functions/StartRecordingPlayback.md", "repo_id": "openmultiplayer", "token_count": 473 }
377
--- title: OnEnterExitModShop description: Cette callback est appelée quand un joueur entre / sort d'un modshop. tags: [modshop, vehicle, véhicule, enterexit, interiorid, interior, intérieur] --- ## Paramètres Cette callback est appelée quand un joueur entre / sort d'un modshop. | Nom | Description | | ---------------- | ----------------------------------------------------------------------------------- | | `int` playerid | ID du joueur qui entre / sort du modshop | | `int` enterexit | 1 si le joueur entre, 0 si le joueur sort | | `int` interiorid | ID de l'intérieur du modshop dans lequel le joueur est entré _(0 si le joueur sort) | ## 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 OnEnterExitModShop(playerid, enterexit, interiorid) { if (enterexit == 0) // Si enterexit = 0, cela veut dire que les joueurs sortent { SendClientMessage(playerid, COLOR_WHITE, "Superbe voiture! Vous payez une redevance de 100$."); GivePlayerMoney(playerid, -100); } return 1; } ``` ## Notes :::warning Bug(s) connus : Les joueurs entrent en collision lorsqu'ils entrent dans le même magasin de mods ::: ## Fonctions connexes - [AddVehicleComponent](../functions/AddVehicleComponent.md): Ajoute un composant à un véhicule.
openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnEnterExitModShop.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnEnterExitModShop.md", "repo_id": "openmultiplayer", "token_count": 707 }
378
--- title: OnPlayerClickGangZone description: Ce rappel est appelé lorsqu'un joueur clique sur une zone de gang sur la carte du menu de pause (en cliquant avec le bouton droit). tags: ["player", "gangzone"] --- <VersionWarn name='callback' version='omp v1.1.0.2612' /> ## Description Ce rappel est appelé lorsqu'un joueur clique sur une zone de gang sur la carte du menu de pause (en cliquant avec le bouton droit). | Nom | Description | | --------- | ----------------------------------------------------------------------------- | | playerid | L'ID du joueur qui a cliqué sur une zone de gang | | zoneid | L'ID de la zone de gang sur laquelle le joueur a cliqué | ## Retours Ce rappel ne gère pas les retours. Il est toujours appelé en premier dans le gamemode. ## Exemples ```c public OnPlayerClickGangZone(playerid, zoneid) { new string[128]; format(string, sizeof(string), "Vous avez cliqué sur la zone de gang %i", zoneid); SendClientMessage(playerid, 0xFFFFFFFF, string); return 1; } ``` ## Fonctions Relatives Les fonctions suivantes peuvent être utiles, car elles sont liées à ce rappel d'une manière ou d'une autre. - [GangZoneCreate](../functions/GangZoneCreate): Créer une zone de gang (zone radar colorée). - [GangZoneDestroy](../functions/GangZoneDestroy): Détruire une zone de gang.
openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnPlayerClickGangZone.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnPlayerClickGangZone.md", "repo_id": "openmultiplayer", "token_count": 578 }
379
--- title: OnPlayerEnterVehicle description: Cette callback est appelée quand un joueur commence à sortir d'un véhicule. tags: ["player", "vehicle"] --- ## Paramètres Cette callback est appelée quand un joueur commence à sortir d'un véhicule. | Nom | Description | | ----------------- | ------------------------------------ | | `int` playerid | ID du joueur qui sort du véhicule | | `int` vehicleid | ID du véhicule duquel le joueur sort | ## Valeur 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 OnPlayerExitVehicle(playerid, vehicleid) { new string[128]; format(string, sizeof(string), "Vous sortez du véhicule ID : %i", vehicleid); SendClientMessage(playerid, 0xFFFFFFFF, string); return 1; } ``` ## Astuces :::tip Cette callback n'est pas appelée en cas de chute d'une moto ou si le joueur est sorti du véhicule par un autre moyen que la touche F, par exemple avec SetPlayerPos. Il faudra utiliser [OnPlayerStateChange](OnPlayerStateChange) et vérifier si l'ancien état du joueur est `PLAYER_STATE_DRIVER` ou `PLAYER_STATE_PASSENGER` et que son nouvel état est `PLAYER_STATE_ONFOOT`. ::: ## Fonctions connexes - [RemovePlayerFromVehicle](../functions/RemovePlayerFromVehicle): Sort de force un joueur du véhicule. - [GetPlayerVehicleSeat](../functions/GetPlayerVehicleSeat): Vérifie la place du joueur dans le véhicule.
openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnPlayerExitVehicle.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnPlayerExitVehicle.md", "repo_id": "openmultiplayer", "token_count": 616 }
380
--- title: OnPlayerRequestSpawn description: Appelée lorsqu'un joueur clique sur le bouton "spawn" lors de la sélection de classe. tags: ["player"] --- ## Paramètres Appelée lorsqu'un joueur clique sur le bouton "spawn" lors de la sélection de classe. | Nom | Description | | -------------- | --------------------------------- | | `int` playerid | ID du joueur qui demande le spawn | ## Valeur de retour Retourner **0** dans cette callback empêchera le joueur d'apparaître. ## Exemple ```c public OnPlayerRequestSpawn(playerid) { if (!IsPlayerAdmin(playerid)) { SendClientMessage(playerid, -1, "Vous ne pouvez pas spawn."); return 0; } return 1; } ``` ## Astuces <TipNPCCallbacks /> :::tip Pour éviter que les joueurs spawn avec une certaine classe, la classe dernièrement vue doit être sauvegardée dans une variable dans OnPlayerRequestClass. ::: ## Fonctions connexes
openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnPlayerRequestSpawn.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnPlayerRequestSpawn.md", "repo_id": "openmultiplayer", "token_count": 377 }
381
--- title: OnUnoccupiedVehicleUpdate description: Cette callback est appelée quand un le client d'un joueur update/synchronise la position d'un véhicule qui n'est pas conduit. tags: ["vehicle"] --- ## Paramètres Cette callback est appelée quand un le client d'un joueur update/synchronise la position d'un véhicule qui n'est pas conduit. Cela arrive en dehors du véhicule ou quand le joueur est en passager et qu'il n'y a pas de conducteur. | Nom | Description | | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | `int` vehicleid | ID du véhicule dont la position est mise à jour | | `int` playerid | ID du joueur | | `int` passenger_seat | ID du siège si le joueur est passager. 0=pas dans le véhicule, 1=passager avant, 2=arrière-gauche 3=arrière-droit, 4+= pour les bus, etc. | | `int` new_x | Nouvelle coordonnée X du véhicule | | `int` new_y | Nouvelle coordonnée Y du véhicule | | `int` new_z | Nouvelle coordonnée Z du véhicule | | `int` vel_x | Nouvelle vélocité X du véhicule | | `int` vel_y | Nouvelle vélocité Y du véhicule | | `int` vel_z | Nouvelle vélocité Z du véhicule | ## Valeur de retour Retourner **0** peut empêcher l'update. ## Exemple ```c public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z) { // Vérifie si le veh est loin if (GetVehicleDistanceFromPoint(vehicleid, new_x, new_y, new_z) > 50.0) { // Rejette l'update return 0; } return 1; } ``` ## Astuces :::warning Cette callback est appelée très fréquemment par seconde et par véhicule. Vous devez vous abstenir d'implémenter des calculs intensifs ou des opérations d'écriture / lecture de fichiers intensives dans cette callback. ::: ## Fonctions connexes
openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnUnoccupiedVehicleUpdate.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnUnoccupiedVehicleUpdate.md", "repo_id": "openmultiplayer", "token_count": 1761 }
382
--- title : "Contrôle d'un serveur" description : Commandes utiles pour contrôler un serveur. --- ## Changer de mode de jeu ### Exécution d'un mode de jeu personnalisé/téléchargé - Ouvrez le répertoire dans lequel vous avez installé le serveur (par exemple : /Rockstar Games/GTA San Andreas/server) - Prenez le fichier .amx téléchargé/compilé et placez-le dans le dossier gamemodes où vous avez installé le serveur - Utilisez RCON pour changer de mode comme décrit ci-dessus (2.1) - Alternativement, vous pouvez ajouter le nouveau mode à une rotation, également décrit ci-dessus (2.3) ### Utiliser des scripts de filtrage Identique à l'exécution d'un mode de jeu personnalisé, sauf : - Placez le .amx dans un dossier appelé `filterscripts` - Ajoutez ce qui suit à server.cfg : `filterscripts <scriptname>` ## Mot de passe de votre serveur - Si vous souhaitez ajouter un mot de passe pour que seuls vos amis puissent vous rejoindre, ajoutez-le à [server.cfg](server.cfg) : ``` mot de passe quel qu'il soit ``` - Cela rendra votre serveur protégé par un mot de passe avec le mot de passe défini comme "quel que soit" - changez-le en ce que vous voulez. - Vous pouvez également changer le mot de passe pendant le jeu en utilisant `/rcon password newpasswordhere` - Vous pouvez supprimer le mot de passe en utilisant `/rcon password 0`, ou en redémarrant le serveur. ## Utilisation de RCON ### Se connecter Vous pouvez vous connecter pendant le jeu en tapant `/rcon login password` ou hors jeu en utilisant le mode RCON dans la [Remote Console] (RemoteConsole). Le mot de passe est le même que celui que vous avez défini dans [server.cfg](server.cfg) ### Ajout d'interdictions ##### samp.ban samp.ban est le fichier utilisé pour stocker les interdictions, y compris les informations suivantes sur l'interdiction : -IP - Date - Temps - Nom (Nom de la personne ou un motif, voir [BanEx](../../functions/BanEx)) - Type d'interdiction Pour ajouter une interdiction, ajoutez simplement une ligne comme ceci : ``` IP_HERE [28/05/09 | 13:37:00] JOUEUR - RAISON DU BAN ``` Où `IP_HERE` est, c'est là que vous mettez l'adresse IP que vous souhaitez interdire. ##### Fonction Ban() La fonction [Ban](../scripting/functions/Ban) peut être utilisée pour bannir un joueur d'un script. La fonction [BanEx](../scripting/functions/BanEx) ajoutera une raison facultative comme ceci : ``` 13.37.13.37 [28/05/09 | 13:37:00] Tricheur - INGAME BAN ``` ##### Commande d'interdiction RCON La commande RCON ban, exécutée en tapant /rcon ban in-game ou en tapant "ban" dans la console, est utilisée pour bannir un joueur spécifique qui se trouve sur votre serveur, pour bannir une IP voir la section suivante. Tapez simplement : ``` # En jeu: /rcon ban PLAYERID # Console: interdire PLAYERID ``` ##### banip La commande RCON banip, exécutée en tapant /rcon banip en jeu ou en tapant "banip" dans la console, permet de bannir une adresse IP spécifique, de bannir un joueur sur votre serveur par ID, voir la section précédente. Acceptera les caractères génériques pour les interdictions de plage. Tapez simplement : ``` # En jeu: /rcon banip IP # Console: banip IP ``` ### Suppression des interdictions Une fois que quelqu'un est banni, il y a deux façons de le débannir. - Supprimer de samp.ban - La commande RCON `unbanip` #### samp.ban samp.ban se trouve dans le répertoire de votre serveur sa-mp, il contient des lignes avec les informations suivantes sur chaque interdiction : - IP - Date - Temps - Nom (Nom de la personne ou un motif (voir [BanEx](../scripting/functions/BanEx))) - Type d'interdiction (INGAME, IP BAN etc,) Exemples: ``` 127.8.57.32 [13/06/09 | 69:69:69] AUCUN - INTERDICTION IP 13.37.13.37 [28/05/09 | 13:37:00] Kyeman - INTERDICTION DE JEU ``` Pour les débannir, supprimez simplement la ligne, puis exécutez la commande RCON reloadbans pour que le serveur relise samp.ban. #### unbanip La commande RCON unbanip peut être utilisée dans le jeu ou depuis la console du serveur (boîte noire). Pour débannir une adresse IP, tapez simplement `/rcon unbanip IP_HERE` dans le jeu ou `unbanip IP_HERE` dans la console. Exemple: ``` 13.37.13.37 [28/05/09 | 13:37:00] Kyeman - INTERDICTION DE JEU ``` ``` # En jeu: /rcon unbanip 13.37.13.37 # Console unbanip 13.37.13.37 ``` Pour les débannir, utilisez simplement la commande `unbanip`, puis exécutez la commande RCON `reloadbans` pour que le serveur relise samp.ban. #### reloadbans `samp.ban` est un fichier qui contient les informations sur les adresses IP actuellement bannies du serveur. Ce fichier est lu au démarrage du serveur, donc si vous débloquez une adresse IP/personne, vous DEVEZ taper la commande RCON `reloadbans` pour que le serveur lise à nouveau `samp.ban` et lui permette de rejoindre le serveur. ### Commandes RCON Tapez cmdlist pour les commandes (ou varlist pour les variables) en utilisant le RCON en jeu (`/rcon cmdlist`). Voici les fonctions que vous pouvez utiliser en tant qu'administrateur : | Commande | Descriptif | | --------------------------------- | -------------------------------------------------- -------------------------------------------------- ------------------------------------------------- | | `/rcon cmdlist` | Affiche une liste avec des commandes. | | `/rcon varlist` | Affiche une liste avec les variables actuelles.
openmultiplayer/web/docs/translations/fr/server/ControllingServer.md/0
{ "file_path": "openmultiplayer/web/docs/translations/fr/server/ControllingServer.md", "repo_id": "openmultiplayer", "token_count": 2021 }
383
--- title: OnPlayerClickMap description: OnPlayerClickMap akan terpanggil ketika pemain menaruh target/waypoint saat jeda map menu (dengan cara klik kanan). tags: ["player"] --- ## Deskripsi OnPlayerClickMap akan terpanggil ketika pemain menaruh target/waypoint saat jeda map menu (dengan cara klik kanan). | Nama | Deskripsi | | -------- | -------------------------------------------------------------------------------- | | playerid | ID dari pemain yang menaruh target/waypoint | | Float:fX | Koordinasi float X dimana pemain mengklik | | Float:fY | Koordinasi float Y dimana pemain mengklik | | Float:fZ | Koordinasi float Z dimana pemain mengklik (tidak akurat - lihat catatan dibawah) | ## Returns 0 - Akan melarang filterscript lain untuk menerima callback ini. 1 - Mengindikasikan bahwa callback ini akan dilanjutkan ke filtercript lain. Selalu terpanggil pertama di filterscripts. ## Contoh ```c public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ) { SetPlayerPostFindZ(playerid, fX, fY, fZ); return 1; } ``` ## Catatan :::tip Nilai Z akan berubah menjadi 0 (invalid) jika sangat jauh dari pemain, gunakan MapAndreas plugin untuk mendapatkan koordinat Z yang akurat. ::: ## Fungsi Terkait
openmultiplayer/web/docs/translations/id/scripting/callbacks/OnPlayerClickMap.md/0
{ "file_path": "openmultiplayer/web/docs/translations/id/scripting/callbacks/OnPlayerClickMap.md", "repo_id": "openmultiplayer", "token_count": 639 }
384
--- title: OnPlayerSpawn description: Callback ini akan terpanggil ketika pemain spawn. tags: ["player"] --- ## Deskripsi Callback ini akan terpanggil ketika pemain spawn. (misalnya saat sudah memanggil fungsi SpawnPlayer) | Nama | Deskripsi | | -------- | ----------------------------- | | playerid | ID dari pemain yang di spawn. | ## Returns 0 - Akan melarang filterscript lain untuk menerima callback ini. 1 - Mengindikasikan bahwa callback ini akan dilanjutkan ke filtercript lain. Selalu terpanggil pertama di filterscripts. ## Contoh ```c public OnPlayerSpawn(playerid) { new PlayerName[MAX_PLAYER_NAME], string[40]; GetPlayerName(playerid, PlayerName, sizeof(PlayerName)); format(string, sizeof(string), "%s telah sukses terspawn.", PlayerName); SendClientMessageToAll(0xFFFFFFFF, string); return 1; } ``` ## Catatan :::tip Terkadang game akan mengurangi \$100 dari pemain setelah spawn. ::: ## Fungsi Terkait - [SpawnPlayer](../functions/SpawnPlayer.md): Memaksa pemain untuk spawn. - [AddPlayerClass](../functions/AddPlayerClass.md): Menambahkan kelas. - [SetSpawnInfo](../functions/SetSpawnInfo.md): Menambahkan pengaturan spawn untuk pemain.
openmultiplayer/web/docs/translations/id/scripting/callbacks/OnPlayerSpawn.md/0
{ "file_path": "openmultiplayer/web/docs/translations/id/scripting/callbacks/OnPlayerSpawn.md", "repo_id": "openmultiplayer", "token_count": 458 }
385
--- title: CreateVehicle description: Membuat kendaraan di dunia. tags: ["vehicle"] --- ## Deskripsi Membuat kendaraan di dunia. Dapat digunakan sebagai pengganti AddStaticVehicleEx kapan saja dalam skrip. | Nama | Deskripsi | | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | | Tipe Kendaraan | Model dari Kendaraan | | Float:X | Kordinat x dari kendaraan | | Float:Y | Kordinat y dari kendaraan | | Float:Z | Kordinat z dari kendaraan | | Float:rotation | Sudut menghadap dari kendaraan | | [color1](../resources/vehiclecolorid) |ID warna primer kendaraan | | [color2](../resources/vehiclecolorid) | ID warna sekunder | | respawn_delay | Penundaan hingga mobil respawn tanpa pengemudi dalam hitungan detik. Menggunakan -1 akan mencegah kendaraan dari respawning. | | bool:addsiren | Ditambahkan di 0.3.7; Tidak akan berfungsi di versi sebelumnya. Memiliki nilai bawaan 'false'. Memungkinkan kendaraan memiliki sirine, asalkan kendaraan memiliki klakson. | ## Returns ID kendaraan dari kendaraan yang dibuat (1 hingga MAX_VEHICLES). INVALID_VEHICLE_ID (65535) jika kendaraan tidak dibuat (batas kendaraan terlewati atau ID model kendaraan tidak valid). 0 jika kendaraan tidak dibuat (IDs 538 or 537 berhasil, yaitu kereta api). ## Contoh ```c public OnGameModeInit() { // Menambahkan Hydra (520) ke game dengan waktu respon 60 detik CreateVehicle(520, 2109.1763, 1503.0453, 32.2887, 82.2873, -1, -1, 60); return 1; } ``` ## Catatan :::peringatan Kereta api hanya bisa ditambahkan dengan AddStaticVehicle dan AddStaticVehicleEx. ::: ## Fungsi Terkait - [DestroyVehicle](DestroyVehicle): Menghancurkan kendaraan. - [AddStaticVehicle](AddStaticVehicle): Menambahkan kendaraan statis. - [AddStaticVehicleEx](AddStaticVehicleEx): Menambahkan kendaraan statis dengan custom waktu respawn. - [GetVehicleParamsSirenState](GetVehicleParamsSirenState): Mengecek apakah sirine kendaraan hidup atau mati. - [OnVehicleSpawn](../callbacks/OnVehicleSpawn): Memanggil ketika kendaraan respawn. - [OnVehicleSirenStateChange](../callbacks/OnVehicleSirenStateChange): Memanggil ketika sirine kendaraan beralih hidup/mati.
openmultiplayer/web/docs/translations/id/scripting/functions/CreateVehicle.md/0
{ "file_path": "openmultiplayer/web/docs/translations/id/scripting/functions/CreateVehicle.md", "repo_id": "openmultiplayer", "token_count": 2028 }
386
--- title: strdel description: Menghapus bagian dari sebuah string. tags: ["string"] --- <LowercaseNote /> ## Deskripsi Menghapus bagian dari sebuah string. | Nama | Deskripsi | | -------- | ---------------------------------------- | | string[] | Bagian string yang akan dihapus. | | start | Posisi karakter awal yang akan dihapus. | | end | Posisi karakter akhir yang akan dihapus. | ## Returns Fungsi ini tidak me-return value yang spesifik. ## Contoh ```c new string[42] = "We will delete everything apart from this"; strdel(string, 0, 37); // string menjadi "this" ``` ## Fungsi Terkait - [strcmp](strcmp): Membanding dua string untuk mengecek apakah mereka sama. - [strfind](strfind): Mencari sebuah string di string lainnya. - [strins](strins): Memasukkan teks kedalam sebuah string. - [strlen](strlen): Mendapatkan panjang dari sebuah string. - [strmid](strmid): Mengekstrak bagian dari sebuah string ke string lainnya. - [strpack](strpack): Membungkus sebuah string menjadi string baru. - [strval](strval): Mengkonversi sebuah string menjadi integer. - [strcat](strcat): Menggabungkan dua buah string menjadi sebuah string.
openmultiplayer/web/docs/translations/id/scripting/functions/strdel.md/0
{ "file_path": "openmultiplayer/web/docs/translations/id/scripting/functions/strdel.md", "repo_id": "openmultiplayer", "token_count": 472 }
387
--- id: objecteditionresponsetypes title: Tipe Respon Penyuntingan Objek --- Digunakan di [OnPlayerEditObject](../callbacks/OnPlayerEditObject.md) dan [OnPlayerEditAttachedObject](../callbacks/OnPlayerEditAttachedObject.md). ```c 0 - EDIT_RESPONSE_CANCEL // pemain membatalkannnya (menekan tombol ESC) 1 - EDIT_RESPONSE_FINAL // pemain menekan pada tombol "save" 2 - EDIT_RESPONSE_UPDATE // pemain memindahkan objek (penyuntingan tidak berhenti) ```
openmultiplayer/web/docs/translations/id/scripting/resources/objecteditionresponsetypes.md/0
{ "file_path": "openmultiplayer/web/docs/translations/id/scripting/resources/objecteditionresponsetypes.md", "repo_id": "openmultiplayer", "token_count": 174 }
388
--- id: weaponstates title: Keadaan Senjata description: Konstanta Keadaan Senjata --- | ID | Definisi | Deskripsi | | --- | ------------------------ | -------------------------------------------------- | | -1 | WEAPONSTATE_UNKNOWN | Tidak diketahui (Diatur ketika di dalam kendaraan) | | 0 | WEAPONSTATE_NO_BULLETS | Senjata tidak memiliki peluru yang tersisa | | 1 | WEAPONSTATE_LAST_BULLET | Senjata memiliki sisa 1 peluru | | 2 | WEAPONSTATE_MORE_BULLETS | Senjata memiliki banyak peluru | | 3 | WEAPONSTATE_RELOADING | Pemain sedang memuat ulang senjatanya | ## Fungsi Terkait - [GetPlayerWeaponState](../functions/GetPlayerWeaponState): Memeriksa keadaan senjatanya pemain.
openmultiplayer/web/docs/translations/id/scripting/resources/weaponstates.md/0
{ "file_path": "openmultiplayer/web/docs/translations/id/scripting/resources/weaponstates.md", "repo_id": "openmultiplayer", "token_count": 386 }
389
--- title: AddCharModel description: Dodaje nowy model postaci do pobrania. tags: [] --- <VersionWarn version='SA-MP 0.3.DL R1' /> ## Opis Dodaje niestandardowy model postaci do pobrania. Pliki modelu będą przechowywane w ścieżce Dokumenty\GTA San Andreas User Files\SAMP\cache w katalogu nazwanym adresem IP oraz portem serwera, z nazwami w formie sum kontrolnych CRC. | Nazwa | Opis | | ------- | ------------------------------------------------------------------------------------------------------------------- | | baseid | Bazowe ID skina (nowy skin oddziedziczy po nim zachowanie, a jeżeli pobieranie się nie uda, to także wygląd). | | newid | Nowe ID skina z zakresu od 20000 do 30000 (10000 slotów), używane później w SetPlayerSkin. | | dffname | Nazwa pliku .dff z kolizjami modelu, znajdującego się domyślnie w serwerowym katalogu models (ustawienie artpath). | | txdname | Nazwa pliku .txd z teksturami modelu, znajdującego się domyślnie w serwerowym katalogu models (ustawienie artpath). | ## Zwracane wartości 1: Funkcja wykonała się prawidłowo. 0: Funkcja nie wykonała się prawidłowo. ## Przykłady ```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"); ``` ## Uwagi :::tip useartwork musi być włączone w ustawieniach serwera, aby ta funkcja działała. ::: :::warning Aktualnie nie ma żadnych restrykcji co do wywoływania tej funkcji, ale miej na uwadze, że jeżeli nie wywołasz jej w OnFilterScriptInit/OnGameModeInit, to gracze, którzy są już na serwerze, mogą nie mieć pobranych modeli. ::: ## Powiązane funkcje - [SetPlayerSkin](SetPlayerSkin.md): Ustawia skin gracza.
openmultiplayer/web/docs/translations/pl/scripting/functions/AddCharModel.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pl/scripting/functions/AddCharModel.md", "repo_id": "openmultiplayer", "token_count": 967 }
390
--- title: Attach3DTextLabelToVehicle description: Przyczepia tekst 3D do konkretnego pojazdu. tags: ["vehicle", "3dtextlabel"] --- ## Opis Przyczepia tekst 3D do konkretnego pojazdu. | Nazwa | Opis | | --------- | ----------------------------------------------------------------- | | Text3D:textid | Tekst 3D, który chcesz przyczepić. | | vehicleid | Pojazd, do którego chcesz przyczepić tekst 3D. | | OffsetX | Offset X od koordynatów pojazdu gracza (pojazd to 0.0, 0.0, 0.0). | | OffsetY | Offset Y od koordynatów pojazdu gracza (pojazd to 0.0, 0.0, 0.0). | | OffsetZ | Offset Z od koordynatów pojazdu gracza (pojazd to 0.0, 0.0, 0.0). | ## Zwracane wartości Ta funkcja nie zwraca żadnych konkretnych wartości. ## Przykłady ```c new Text3D:gVehicle3dText[MAX_VEHICLES], // Tworzymy tekst 3D do późniejszego użytku gVehicleId; public OnGameModeInit ( ) { gVehicleId = CreateVehicle(510, 0.0. 0.0, 15.0, 5, 0, 120); // Tworzymy pojazd. gVehicle3dText[gVehicleId] = Create3DTextLabel("Przykładowy tekst", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1); Attach3DTextLabelToVehicle(gVehicle3dText[gVehicleId], vehicle_id, 0.0, 0.0, 2.0); // Przyczepiamy tekst 3D do pojazdu. } public OnGameModeExit ( ) { Delete3DTextLabel(gVehicle3dText[gVehicleId]); return true; } ``` ## Powiązane funkcje - [Create3DTextLabel](Create3DTextLabel.md): Tworzy tekst 3D. - [Delete3DTextLabel](Delete3DTextLabel.md): Kasuje tekst 3D. - [Attach3DTextLabelToPlayer](Attach3DTextLabelToPlayer.md): Przyczepia tekst 3D do gracza. - [Update3DTextLabelText](Update3DTextLabelText.md): Zmienia treść tekstu 3D. - [CreatePlayer3DTextLabel](CreatePlayer3DTextLabel.md): Tworzy tekst 3D dla jednego gracza. - [DeletePlayer3DTextLabel](DeletePlayer3DTextLabel.md): Kasuje tekst 3D danego gracza. - [UpdatePlayer3DTextLabelText](UpdatePlayer3DTextLabel.md): Zmienia treść tekstu 3D danego gracza.
openmultiplayer/web/docs/translations/pl/scripting/functions/Attach3DTextLabelToVehicle.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pl/scripting/functions/Attach3DTextLabelToVehicle.md", "repo_id": "openmultiplayer", "token_count": 984 }
391
--- title: Cliente description: Essa categoria contém informações sobre o cliente do SA-MP, incluindo funções e suporte. --- Essa categoria contém informações sobre o cliente do SA-MP, incluindo funções e suporte.
openmultiplayer/web/docs/translations/pt-BR/client/_.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/client/_.md", "repo_id": "openmultiplayer", "token_count": 88 }
392
--- title: OnNPCEnterVehicle description: Essa callback é executada quando o NPC entra em um veículo. tags: [] --- ## Descrição Essa callback é executada quando o NPC entra em um veículo. | Nome | Descrição | | ------------ | ------------------------------------------------------- | | vehicleid | ID do veículo que o NPC entrou. | | seatid | O assento que o NPC está usando. | ## Exemplos ```c public OnNPCEnterVehicle(vehicleid, seatid) { printf("Um NPC entrou no veículo de ID: %d, no Assento: %d", vehicleid, seatid); return 1; } ``` ## Callbacks Relacionadas - [OnNPCExitVehicle](../callbacks/OnNPCExitVehicle): Executada quando um NPC sai de um veículo.
openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnNPCEnterVehicle.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnNPCEnterVehicle.md", "repo_id": "openmultiplayer", "token_count": 353 }
393
--- title: OnPlayerEnterCheckpoint description: Esta callback é chamada quando um jogador entre em um checkpoint colocado para aquele jogador. tags: ["player", "checkpoint"] --- ## Descrição Esta callback é chamada quando um jogador entre em um checkpoint colocado para aquele jogador. | Nome | Descrição | | -------- | ----------------------------------- | | playerid | O jogador que entrou no checkpoint. | ## Retorno Sempre é chamada primeiro em filterscripts. ## Exemplos ```c //Neste exemplo o checkpoint é criado para o jogador quando spawna, //o qual cria um veículo e desativa o 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; } ``` ## Notas <TipNPCCallbacksPT /> ## Funções Relacionadas - [SetPlayerCheckpoint](../functions/SetPlayerCheckpoint.md): Cria o checkpoint para um jogador. - [DisablePlayerCheckpoint](../functions/DisablePlayerCheckpoint.md): Desativa o atual checkpoint do jogador. - [IsPlayerInCheckpoint](../functions/IsPlayerInRaceCheckpoint.md): Verifica se o jogador está em checkpoint. - [SetPlayerRaceCheckpoint](../functions/SetPlayerRaceCheckpoint.md): Cria um checkpoint de corrida. - [DisablePlayerRaceCheckpoint](../functions/DisablePlayerRaceCheckpoint.md): Desativa o atual checkpoint de corrida do jogador. - [IsPlayerInRaceCheckpoint](../functions/IsPlayerInRaceCheckpoint.md): Verifica se o jogador está em um checkpoint de corrida.
openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnPlayerEnterCheckpoint.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnPlayerEnterCheckpoint.md", "repo_id": "openmultiplayer", "token_count": 576 }
394
--- title: OnPlayerRequestSpawn description: Chamada quando um jogador tenta spawnar através da seleção de classe pressionando SHIFT ou clicando no botão 'Spawn'. tags: ["player"] --- ## Descrição Chamada quando um jogador tenta spawnar através da seleção de classe pressionando SHIFT ou clicando no botão 'Spawn'. | Nome | Descrição | | -------- | -------------------------------------- | | playerid | O ID do jogador que solicitou o spawn. | ## Retorno Sempre é chamada primeiro em Filterscripts. ## Exemplos ```c public OnPlayerRequestSpawn(playerid) { if (!IsPlayerAdmin(playerid)) { SendClientMessage(playerid, -1, "Talvez você não spawne."); return 0; } return 1; } ``` ## Notas <TipNPCCallbacksPT /> :::tip Para previnir jogadores de spawnar em determinadas classes, a última classe vista deve ser salva em uma variavel em OnPlayerRequestClass. ::: ## Funções Relacionadas
openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnPlayerRequestSpawn.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnPlayerRequestSpawn.md", "repo_id": "openmultiplayer", "token_count": 372 }
395
--- title: OnVehicleMod description: Essa callback é executada quando um veículo é modificado. tags: ["vehicle"] --- ## Descrição Essa callback é executada quando um veículo é modificado. | Nome | Descrição | | ----------- | ------------------------------------------------------- | | playerid | ID do motorista do veículo. | | vehicleid | ID do veículo modificado. | | componentid | ID do componente que foi adicionado ao veículo. | ## Retornos Sempre executada primeiro no gamemode, retornar 0 irá impedir outros filterscripts de acessar a mesma. ## Exemplos ```c public OnVehicleMod(playerid, vehicleid, componentid) { printf("O veículo %d foi modificado pelo ID %d com o componente %d",vehicleid, playerid,componentid); if (GetPlayerInterior(playerid) == 0) { BanEx(playerid, "Tuning Hacks"); // Anti-tuning hacks script return 0; // Previne modificação maliciosa ser carregada para outros jogadores... //(Testada! Funciona até em servidores que permitem a modificação de veículos usando comandos, menus, dialogs, etc.. } return 1; } ``` ## Notas :::tip Essa callback NÃO É EXECUTADA ao utilizar a função AddVehicleComponent. ::: ## Funções Relacionadas - [AddVehicleComponent](../functions/AddVehicleComponent): Adiciona um componente ao veículo. ## Callbacks Relacionadas - [OnEnterExitModShop](OnEnterExitModShop): Executada quando um veículo entra/sai de um modshop. - [OnVehiclePaintjob](OnVehiclePaintjob): Executada quando a paintjob de um veículo é alterada. - [OnVehicleRespray](OnVehicleRespray): Executada quando um veículo é pintado/repintado.
openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnVehicleMod.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnVehicleMod.md", "repo_id": "openmultiplayer", "token_count": 720 }
396
--- title: AddVehicleComponent description: Adiciona um 'componente' (frequentemente chamado de 'mod' (modificação)) a um veículo. tags: ["vehicle"] --- ## Descrição Adiciona um 'componente' (frequentemente chamado de 'mod' (modificação)) a um veículo. Componentes válidos podem ser encontrados aqui. | Name | Descrição | | --------------------------------------------- | ----------------------------------------------------------------------- | | vehicleid | O ID do veículo a adicionar um componente. Não confundir com o modelid. | | [componentid](../resources/carcomponentid.md) | O ID do componente a adicionar ao veículo. | ## Retorno 0 - O componente não foi adicionar porque o veículo não existe. 1 - O componente foi adicionar com sucesso ao veículo. ## Exemplos ```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 foi adicionado ao Taxi."); } } return 1; } ``` ## Notas :::warning Usar um ID de componente inválido causa um crash no jogador. Não existe verificação interna para isso. ::: ## Funções Relacionadas - [RemoveVehicleComponent](RemoveVehicleComponent.md): Remove um componente de um veículo. - [GetVehicleComponentInSlot](GetVehicleComponentInSlot.md): Verifica quais componentes o veículo tem. - [GetVehicleComponentType](GetVehicleComponentType.md): Verifica o tipo de componente pelo ID. - [OnVehicleMod](../callbacks/OnVehicleMod.md): É chamado quando o veículo é modificado/tem componentes. - [OnEnterExitModShop](../callbacks/OnEnterExitModShop.md): É chamado quando um veículo entra ou sai de uma loja de tunning.
openmultiplayer/web/docs/translations/pt-BR/scripting/functions/AddVehicleComponent.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/functions/AddVehicleComponent.md", "repo_id": "openmultiplayer", "token_count": 923 }
397
--- title: DestroyObject description: Destrói (remove) um objeto que foi criado usando CreateObject. tags: [] --- ## Descrição Destrói (remove) um objeto que foi criado usando CreateObject. | Nome | Descrição | | -------- | ----------------------------------------------------------- | | objectid | O ID do objeto a ser destruído. Retornado por CreateObject. | ## Retorno Esta função não retorna nenhum valor específico. ## Exemplos ```c public OnObjectMoved(objectid) { DestroyObject(objectid); return 1; } ``` ## Funções relacionadas - [CreateObject](CreateObject): Cria um objeto. - [IsValidObject](IsValidObject): Verifica se um determinado objeto é válido. - [MoveObject](MoveObject): Move um objeto. - [StopObject](StopObject): Pare a movimentação de um objeto. - [SetObjectPos](SetObjectPos): Define a posição de um objeto. - [SetObjectRot](SetObjectRot): Define a rotação de um objeto. - [GetObjectPos](GetObjectPos): Localize a posição de um objeto. - [GetObjectRot](GetObjectRot): Localize a rotação de um objeto. - [AttachObjectToPlayer](AttachObjectToPlayer): Anexa um objeto a um jogador. - [CreatePlayerObject](CreatePlayerObject): Cria um objeto para apenas um jogador. - [DestroyPlayerObject](DestroyPlayerObject): Destrua um objeto do jogador. - [IsValidPlayerObject](IsValidPlayerObject): Verifica se um determinado objeto player é válido. - [MovePlayerObject](MovePlayerObject): Move um objeto do jogador. - [StopPlayerObject](StopPlayerObject): Pare a movimentação de um objeto do jogador. - [SetPlayerObjectPos](SetPlayerObjectPos): Define a posição de um objeto do jogador. - [SetPlayerObjectRot](SetPlayerObjectRot): Defina a rotação de um objeto do jogador. - [GetPlayerObjectPos](GetPlayerObjectPos): Localize a posição de um objeto do jogador. - [GetPlayerObjectRot](GetPlayerObjectRot): Localize a rotação de um objeto do jogador. - [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): Anexa um objeto de jogador a um jogador.
openmultiplayer/web/docs/translations/pt-BR/scripting/functions/DestroyObject.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/functions/DestroyObject.md", "repo_id": "openmultiplayer", "token_count": 703 }
398
--- title: GetObjectModel description: Obtém o ID do modelo de um objeto (CreateObject). tags: [] --- Esta função foi implementada no SA-MP 0.3.7 e não funcionará em versões anteriores. ## Descrição Obtém o ID do modelo de um objeto (CreateObject). | Nome | Descrição | | -------- | --------------------------------------------- | | objectid | O ID do objeto do qual deseja obter o modelo. | ## Retorno O modelo ID do objeto. -1 se o objeto não existir. ## Exemplos ```c new objectid = CreateObject(1234, 0, 0, 0, 0, 0, 0); new modelid = GetObjectModel(objectid); ``` ## Funções Relacionadas - [GetPlayerObjectModel](GetPlayerObjectModel): Obtém o modelo ID de um objeto de jogador (player-object).
openmultiplayer/web/docs/translations/pt-BR/scripting/functions/GetObjectModel.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/functions/GetObjectModel.md", "repo_id": "openmultiplayer", "token_count": 297 }
399
--- title: SetSpawnInfo description: Esta função pode ser usada para mudar as informações de spawn de um jogador específico. tags: [] --- ## Descrição Esta função pode ser usada para mudar as informações de spawn de um jogador específico. Permite definir automaticamente no spawn, as armas, time, skin, e posição de um jogador, é normalmente usado em minijogos ou sistemas automáticos de spawn. Esta função é mais segura contra crashes do que usar SetPlayerSkin em OnPlayerSpawn e/ou OnPlayerRequestClass, embora isso tenha sido corrigido na versão 0.2. | Nome | Descrição | | -------------- | ------------------------------------------------------------------ | | playerid | O ID do jogador de quem você quer definir as informações de spawn. | | team | O ID do time do jogador escolhido. | | skin | A skin com o qual o jogador irá spawnar. | | Float:X | A coordenada-X da posição de spawn do jogador. | | Float:Y | A coordenada-Y da posição de spawn do jogador. | | Float:Z | A coordenada-Z da posição de spawn do jogador. | | Float:rotation | A direção na qual o jogador precisa estar olhando depois do spawn. | | weapon1 | A primeira arma de spawn para o jogador. | | weapon1_ammo | A quantidade de munição para a primeira arma de spawn. | | weapon2 | A segunda arma de spawn para o jogador. | | weapon2_ammo | A quantidade de munição para a segunda arma de spawn. | | weapon3 | A terceira arma de spawn para o jogador. | | weapon3_ammo | A quantidade de munição para a terceira arma de spawn. | ## Retorno Esta função não retorna nenhum valor específico. ## Exemplos ```c public OnPlayerRequestClass(playerid, classid) { // Este exemplo simples demonstra como spawnar cada jogador automaticamente com // a skin do CJ, que é o número 0. O jogador irá spawnar em Las Venturas, com // 36 munições de Sawnoff-Shotgun e 150 munições de Tec9. SetSpawnInfo( playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 ); } ``` ## Funções Relacionadas - [SetPlayerSkin](SetPlayerSkin.md): Define a skin de um jogador. - [SetPlayerTeam](SetPlayerTeam.md): Define o time de um jogador. - [SpawnPlayer](SpawnPlayer.md): Força o spawn a um jogador.
openmultiplayer/web/docs/translations/pt-BR/scripting/functions/SetSpawnInfo.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/functions/SetSpawnInfo.md", "repo_id": "openmultiplayer", "token_count": 1158 }
400
--- title: Slots de Componentes --- :::info Para ser usado com a função [GetVehicleComponentInSlot](../functions/GetVehicleComponentInSlot) ::: --- | Slot | Nome | | ---- | ----------------------- | | 0 | CARMODTYPE_SPOILER | | 1 | CARMODTYPE_HOOD | | 2 | CARMODTYPE_ROOF | | 3 | CARMODTYPE_SIDESKIRT | | 4 | CARMODTYPE_LAMPS | | 5 | CARMODTYPE_NITRO | | 6 | CARMODTYPE_EXHAUST | | 7 | CARMODTYPE_WHEELS | | 8 | CARMODTYPE_STEREO | | 9 | CARMODTYPE_HYDRAULICS | | 10 | CARMODTYPE_FRONT_BUMPER | | 11 | CARMODTYPE_REAR_BUMPER | | 12 | CARMODTYPE_VENT_RIGHT | | 13 | CARMODTYPE_VENT_LEFT | ---
openmultiplayer/web/docs/translations/pt-BR/scripting/resources/Componentslots.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/resources/Componentslots.md", "repo_id": "openmultiplayer", "token_count": 372 }
401
--- title: Probleme comune --- ## Cuprins ## Client ### Am primit eroarea "GTA San Andreas nu poate fi găsit" San Andreas Multiplayer (SA:MP) **nu poate** sa funcționeze de unul singur și, prin urmare, trebuie să instalați GTA San Andreas pentru PC. De asemenea, versiunea jocului trebuie să fie **EU / US v1.0**, alte versiuni precum v2.0 sau versiunile de pe Steam/Direct2Drive nu vor funcționa. [Faceți clic aici pentru a descărca un patch care o să vă facă downgrade la versiunea GTA:SA 1.0](http://grandtheftauto.filefront.com/file/GTA_SA_Downgrader_Patch;74661) ### Nu pot vedea niciun server în browserul SA:MP În primul rând, asigurați-vă că ați urmat procedurile stabilite în [ghidul de inceput](https://team.sa-mp.com/wiki/Getting_Started). Dacă ați urmat ceea ce scrie acolo și încă nu puteți vedea niciun server, trebuie să permiteți accesul SA:MP-ului prin firewall-ul dumneavoastră. Din păcate, datorită numărului mare de programe firewall care există, nu putem oferi asistență suplimentară în acest sens - vă sugerăm să consultați site-ul web al producătorilor sau să încercați să căutați pe Google. De asemenea, asigurați-vă că ați instalat cea mai recentă versiune de SA:MP! ### Se deschide jocul singleplayer în loc de SA:MP :::warning Nu ar trebui să vedeți opțiunile pentru singleplayer (new game, load game, etc.) când intrați pe un server - SA-MP ar trebui să se încarce singur și să nu afișeze aceste opțiuni. Dacă vedeți "new game" inseamna ca s-a incarcat modul singleplayer, nu San Andreas Multiplayer. ::: Modul singleplayer se poate încărca din 2 motive - ați instalat SA: MP în folderul greșit sau aveți versiunea greșită de GTA San Andreas. Dacă aveți o versiune greșită, acest lucru se poate remedia ușor. Click [aici](http://grandtheftauto.filefront.com/file/GTA_SA_Downgrader_Patch;74661) pentru a descărca patch-ul de downgrade. Uneori este posibil sa vedeți meniul din singleplayer, chiar dacă SA:MP s-a încărcat corect. Pentru a remedia acest lucru, trebuie pur și simplu să selectați un element din meniu, apoi să apăsați ESC până când ieșiți cu totul din meniu. După ce faceți asta, SA:MP va rula corespunzător. ### Primesc "Unacceptable Nickname" când mă conectez la un server Asigurați-vă că numele dvs. nu conține caractere interzise (utilizați numai 0-9, a-z, \[\], (), \ \$, @,., \ \_ și =) și că nu depășește 20 de caractere. Totuși, acest lucru se poate întâmpla și atunci când un alt jucător care are numele dvs. este conectat pe server în acel moment (sau atunci când încercați să vă reconectați pe un server imediat după ce ați luat crash). De asemenea, un server care a rulat pentru mai mult de 50 de zile încontinuu, poate uneori să cauzeze această problemă. ### Ecranul se blochează la "Connecting to IP:Port..." Serverul pe care încercați să vă conectați ar putea fi offline, dar dacă nu vă puteți conecta la niciun server, încercați să vă dezactivați firewall-ul. Dacă nu merge nici așa, trebuie să vă reconfigurați programul firewall pe care îl folosiți - accesați site-ul web al acestuia pentru a afla cum. De asemenea, s-ar putea să aveți o versiune veche de SA:MP, descărcați cea mai recentă versiune din [pagina de descarcare SA-MP](http://sa-mp.com/download.php). ### Mi-am instalt moduri în GTA San Andreas și acum SA:MP nu se mai deschide Dacă nu se deschide, eliminați modurile și încercați din nou. ### GTA San Andreas nu mai pornește după ce am instalat SA:MP Ștergeți gta_sa.set din GTA San Andreas User Files și asigurați-vă că nu aveți niciun cheat / mod în fișierele jocului. ### Jocul se blochează când explodează un vehicul Dacă aveți 2 monitoare, atunci există 3 moduri de a rezolva acest lucru: 1. Dezactivați al doilea monitor când jucați SA:MP. (poate nu este cea mai bună opțiune când aveți nevoie de celălalt monitor) 2. Setați Visual FX la low. (ESC > Options > Display Setup > Advanced) 3. Redenumiți folderul GTA San Andreas (de exemplu, în "GTA San Andreas2", acest lucru funcționează de obicei, însă poate să nu mai funcționeze a doua oară, așa că va trebui să îl redenumiți în altceva.) ### Mouse-ul meu nu mai funcționează după ce ies din meniul de pauză Dacă mouse-ul pare să nu mai functioneze în joc în timp ce funcționează (parțial) în meniul de pauză, atunci ar trebui să dezactivați opțiunea multicore [sa-mp.cfg](../../../client/ClientCommands#file-sa-mpcfg "Sa-mp.cfg") (setați la 0). O altă metodă care ar putea să funcționeze este să spamați tasta ESC până când mouse-ul începe să funcționeze din nou. ### Fișierul dinput8.dll lipsește Această eroare este posibil să apară atunci când DirectX nu este instalat corect, încercați să îl reinstalați și și să reporniți computerul. Dacă problema nu dispare, mergeți la C:\\Windows\\System32 și dați copy-paste fișierului dinput.dll în folderul unde aveți instalat GTA San Andreas, acest lucru ar trebui să rezolve problema. ### Nu pot vedea nametag-urile celorlalți jucători! Vă rugăm să rețineți că unele servere pot avea nametag-urile dezactivate de tot. Totuși, această problemă apare adesea pe computerele cu procesoare grafice integrate Intel HD (care oricum nu sunt destinate jocurilor). Din păcate, cauza exactă este necunoscută și nu pare să existe nicio soluție universală disponibilă în prezent. O soluție pe termen lung ar fi cumpărarea unei plăci grafice dedicate, dacă acest lucru este posibil și dacă bugetul dvs. o permite. Laptopurile, desigur, nu pot fi actualizate.
openmultiplayer/web/docs/translations/ro/client/CommonClientIssues.md/0
{ "file_path": "openmultiplayer/web/docs/translations/ro/client/CommonClientIssues.md", "repo_id": "openmultiplayer", "token_count": 2511 }
402
--- title: OnPlayerClickPlayer description: Apelat atunci când un jucător dă dublu clic pe un jucător de pe scoreboard. tags: ["player"] --- ## Descriere Apelat atunci când un jucător dă dublu clic pe un jucător de pe scoreboard. | Nume | Descriere | | --------------- | ---------------------------------------------------------------- | | playerid | ID-ul jucătorului care a apăsat pe un jucător de pe scoreboard. | | clickedplayerid | ID-ul jucătorului pe care a apăsat . | | source | [source](../resources/clicksources) clicului jucătorului. | ## Returnări 1 - Va împiedica alte filterscript-uri să primească acest callback. 0 - Indică faptul că acest callback va fi transmis următorului filterscript. Este întotdeauna numit primul în filterscript. ## Exemple ```c public OnPlayerClickPlayer(playerid, clickedplayerid, CLICK_SOURCE:source) { new message[32]; format(message, sizeof(message), "Ai apăsat pe jucătorul %d", clickedplayerid); SendClientMessage(playerid, 0xFFFFFFFF, message); return 1; } ``` ## Note :::tip În prezent, există o singură „sursă” (0 - CLICK_SOURCE_SCOREBOARD). Existența acestui argument sugerează că mai multe surse pot fi susținute în viitor. ::: ## Funcții similare - [OnPlayerClickTextDraw](OnPlayerClickTextDraw): Apelat atunci când un jucător dă clic pe un textdraw.
openmultiplayer/web/docs/translations/ro/scripting/callbacks/OnPlayerClickPlayer.md/0
{ "file_path": "openmultiplayer/web/docs/translations/ro/scripting/callbacks/OnPlayerClickPlayer.md", "repo_id": "openmultiplayer", "token_count": 641 }
403
--- title: OnPlayerGiveDamageActor description: Acest callback este apelat atunci când un jucător dă daune unui actor. tags: ["player"] --- <VersionWarn name='callback' version='SA-MP 0.3.7' /> ## Descriere Acest callback este apelat atunci când un jucător dă daune unui actor. | Nume | Descriere | |-----------------|--------------------------------------------------------| | playerid | ID-ul jucătorului care a provocat daune. | | damaged_actorid | ID-ul actorului care a primit daune. | | Float:amount | Cantitatea de HP/armură pierduta de actor. | | WEAPON:weaponid | Motivul care a cauzat dauna. | | bodypart | [body part](../resources/bodyparts) care a fost lovită | ## Returnări 1 - Callback-ul nu va fi apelat în alte filterscript-uri. 0 - Permite apelarea acestui callback în alte filterscript-uri. Este întotdeauna numit primul în filterscript-uri, astfel încât returnarea 1 acolo blochează alte filterscript-uri să-l vadă. ## Exemple ```c public OnPlayerGiveDamageActor(playerid, damaged_actorid, Float:amount, WEAPON:weaponid, bodypart) { new string[128], attacker[MAX_PLAYER_NAME]; new weaponname[24]; GetPlayerName(playerid, attacker, sizeof (attacker)); GetWeaponName(weaponid, weaponname, sizeof (weaponname)); format(string, sizeof(string), "%s a facut %.0f daune actorului cu ID %d, arma: %s", attacker, amount, damaged_actorid, weaponname); SendClientMessageToAll(0xFFFFFFFF, string); return 1; } ``` ## Note :::tip Această funcție nu este apelată dacă actorul este setat invulnerabil (CARE ESTE IMPLICIT). Vezi [SetActorInvulnerable](../functions/SetActorInvulnerable). ::: ## Funcții similare - [CreateActor](../functions/CreateActor): Creați un actor (NPC static). - [SetActorInvulnerable](../functions/SetActorInvulnerable): Set actor invulnerabil. - [SetActorHealth](../functions/SetActorHealth): Stabiliți HP-ul a unui actor. - [GetActorHealth](../functions/GetActorHealth): Obține HP-ul unui actor. - [IsActorInvulnerable](../functions/IsActorInvulnerable): Verificați dacă actorul este invulnerabil. - [IsValidActor](../functions/IsValidActor): Verificați dacă ID-ul actorului este valid. ## Callbacks similare - [OnActorStreamOut](OnActorStreamOut): Apelat atunci când un actor este transmis în flux de către un jucător. - [OnPlayerStreamIn](OnPlayerStreamIn): Apelat atunci când un jucător transmite în flux pentru alt jucător.
openmultiplayer/web/docs/translations/ro/scripting/callbacks/OnPlayerGiveDamageActor.md/0
{ "file_path": "openmultiplayer/web/docs/translations/ro/scripting/callbacks/OnPlayerGiveDamageActor.md", "repo_id": "openmultiplayer", "token_count": 1017 }
404
--- title: OnPlayerTakeDamage description: Acest callback este apelat atunci când un jucător primește daune. tags: ["player"] --- ## Descriere Acest callback este apelat atunci când un jucător primește daune. | Nume | Descriere | |-----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------| | playerid | ID-ul jucătorului care a suferit daune. | | issuerid | ID-ul jucătorului care a cauzat prejudiciul. INVALID_PLAYER_ID dacă este autoprovocat. | | Float:amount | Cantitatea de daune suferite de jucător (sănătate și armură combinate). | | WEAPON:weaponid | ID-ul armei/motivul pagubei. | | bodypart | [partea corpului](../resources/bodyparts) care a fost lovită. | ## Returnări 1 - Callback-ul nu va fi apelat în alte filterscript-uri. 0 - Permite apelarea acestui apel invers în alte filterscript-uri. Este întotdeauna numit primul în filterscript-uri, astfel încât returnarea 1 acolo blochează alte filterscript-uri să-l vadă. ## Exemple ```c public OnPlayerTakeDamage(playerid, issuerid, Float:amount, WEAPON:weaponid, bodypart) { if (issuerid != INVALID_PLAYER_ID) // Dacă nu se autoprovoca { new infoString[128], weaponName[24], victimName[MAX_PLAYER_NAME], attackerName[MAX_PLAYER_NAME]; GetPlayerName(playerid, victimName, sizeof (victimName)); GetPlayerName(issuerid, attackerName, sizeof (attackerName)); GetWeaponName(weaponid, weaponName, sizeof (weaponName)); format(infoString, sizeof(infoString), "%s a provocat %.0f daune lui %s, armă: %s, partea corpului: %d", attackerName, amount, victimName, weaponName, bodypart); SendClientMessageToAll(-1, infoString); } return 1; } ``` ```c public OnPlayerTakeDamage(playerid, issuerid, Float:amount, WEAPON:weaponid, bodypart) { if (issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9) { // O lovitură în cap pentru a ucide cu pușca de lunetist SetPlayerHealth(playerid, 0.0); } return 1; } ``` ## Note :::tip Armă va returna 37 (aruncător de flăcări) din orice sursă de foc (de exemplu, molotov, 18). Armă va returna 51 de la orice armă care creează o explozie (de exemplu, RPG, grenadă) playerid este singurul care poate apela înapoi. Suma este întotdeauna dauna maximă pe care o poate face armele, chiar și atunci când sănătatea rămasă este mai mică decât dauna maximă. Deci, atunci când un jucător are 100,0 de sănătate și este împușcat cu un Vultur deșert care are o valoare a daunelor de 46,2, este nevoie de 3 lovituri pentru a ucide acel jucător. Toate cele 3 lovituri vor arăta o sumă de 46,2, chiar dacă atunci când lovește ultima lovitură, jucătorului mai are doar 7,6 de sănătate. ::: :::warning GetPlayerHealth și GetPlayerArmour vor returna vechile sume ale jucătorului înainte de acest apel invers. Verificați întotdeauna dacă issuerid este valid înainte de a-l folosi ca index de matrice. :::
openmultiplayer/web/docs/translations/ro/scripting/callbacks/OnPlayerTakeDamage.md/0
{ "file_path": "openmultiplayer/web/docs/translations/ro/scripting/callbacks/OnPlayerTakeDamage.md", "repo_id": "openmultiplayer", "token_count": 1869 }
405
--- title: OnVehicleStreamIn description: Apelat atunci când un vehicul este transmis în flux la clientul unui jucător. tags: ["vehicle"] --- ## Descriere Numit atunci când un vehicul este transmis în flux la clientul unui jucător. | Nume | Descriere | | ----------- | ------------------------------------------------------ | | vehicleid | ID-ul vehiculului care a transmis în flux pentru jucător. | | forplayerid | ID-ul jucătorului pentru care vehiculul a fost transmis în flux. | ## Returnari Acesta este întotdeauna numit primul în filterscripts. ## Exemple ```c public OnVehicleStreamIn(vehicleid, forplayerid) { new string[32]; format(string, sizeof(string), "Acum poti sa vezi vehiculul %d.", vehicleid); SendClientMessage(forplayerid, 0xFFFFFFFF, string); return 1; } ``` ## Notite <TipNPCCallbacks /> ## Functii Relatate
openmultiplayer/web/docs/translations/ro/scripting/callbacks/OnVehicleStreamIn.md/0
{ "file_path": "openmultiplayer/web/docs/translations/ro/scripting/callbacks/OnVehicleStreamIn.md", "repo_id": "openmultiplayer", "token_count": 376 }
406
--- title: "Cuvant: Operatori" --- ## `char` char returnează numărul de celule necesare pentru a deține numărul dat de caractere dintr-un șir împachetat. Adică numărul de celule de 4 octeți necesare pentru a deține un număr dat de octeți. De exemplu: ```c 4 char ``` Returnează 1. ```c 3 char ``` Returnează 1 (nu poti avea 3/4 dintr-o variabila). ```c 256 char ``` Returnează 64 (256 impartit la 4). Acest lucru este utilizat în general în declarațiile variabile. ```c new someVar[40 char]; ``` Va face o matrice de 10 celule mari. Pentru mai multe informații despre șirurile împachetate, citiți pawn-lang.pdf. ## `defined` Verifică dacă există un simbol. Utilizat în general în declarațiile #if: ```c new someVar = 5; #if defined someVar printf("%d", someVar); #else #error The variable 'someVar' isn't defined #endif ``` Cel mai frecvent este folosit pentru a verifica dacă este definită o definire și pentru a genera cod în consecință: ```c #define FILTERSCRIPT #if defined FILTERSCRIPT public OnFilterScriptInit() { return 1; } #else public OnGameModeInit() { return 1; } #endif ``` ## `sizeof` Returnează dimensiunea în ELEMENTE a unui tablou: ```c new someVar[10]; printf("%d", sizeof (someVar)); ``` Ieșire: ```c 10 ``` și: ```c new someVar[2][10]; printf("%d %d", sizeof (someVar), sizeof (someVar[])); ``` Dă: ```c 2 10 ``` ## `state` Acest lucru este din nou legat de codul autonom PAWN și, prin urmare, nu este acoperit aici. ## `tagof` Aceasta returnează un număr care reprezintă eticheta unei variabile: ```c new someVar, Float:someFloat; printf("%d %d", tagof (someVar), tagof (someFloat)); ``` Dă: ```c -./,),(-*,( -1073741820 ``` Ceea ce este o mică eroare, dar practic înseamnă: ```c 0x80000000 0xC0000004 ``` Pentru a verifica, de exemplu, dacă o variabilă este float (cu eticheta „Float:”): ```c new Float: fValue = 6.9; new tag = tagof (fValue); if (tag == tagof (Float:)) { print("float"); } else { print("not a float"); } ```
openmultiplayer/web/docs/translations/ro/scripting/language/Operators.md/0
{ "file_path": "openmultiplayer/web/docs/translations/ro/scripting/language/Operators.md", "repo_id": "openmultiplayer", "token_count": 974 }
407
--- title: Lista crime description: Lista de crime se foloseste in functia [PlayCrimeReportForPlayer](../functions/PlayCrimeReportForPlayer). sidebar_label: Lista crime --- Se foloseste in functia [PlayCrimeReportForPlayer](../functions/PlayCrimeReportForPlayer). | ID Crima | zece-cod | Descriere | | -------- | -------- | ------------------------------------------------------------------------ | | 3 | 10-71 | Recomandați natura incendiului (dimensiunea, tipul, conținutul clădirii) | | 4 | 10-47 | Sunt necesare reparații de urgență la drum | | 5 | 10-81 | Raport Breatherlizer | | 6 | 10-24 | Temă finalizată | | 7 | 10-21 | Sunați () prin telefon | | 8 | 10-21 | Sunați () prin telefon | | 9 | 10-21 | Sunați () prin telefon | | 10 | 10-17 | Faceți cunoștință cu reclamantul | | 11 | 10-81 | Raport Breatherlizer | | 12 | 10-91 | Ridică prizonierul / subiectul | | 13 | 10-28 | Informații despre înmatricularea vehiculului | | 14 | 10-81 | Aparat de etilotest | | 15 | 10-28 | Informații despre înmatricularea vehiculului | | 16 | 10-91 | Ridică prizonierul / subiectul | | 17 | 10-34 | Riot | | 18 | 10-37 | (Investigați) vehicul suspect | | 19 | 10-81 | Aparat de etilotest | | 21 | 10-7 | In afara serviciului | | 22 | 10-7 | In afara serviciului |
openmultiplayer/web/docs/translations/ro/scripting/resources/crimelist.md/0
{ "file_path": "openmultiplayer/web/docs/translations/ro/scripting/resources/crimelist.md", "repo_id": "openmultiplayer", "token_count": 1585 }
408
--- title: Sistem de variabile pe jucător description: Sistemul de variabile per jucător (pe scurt, PVar) este un nou mod de a crea variabile de jucător într-o metodă eficientă creată dinamic la nivel global, ceea ce înseamnă că pot fi folosite în modul de joc al serverului și în scripturile filtrelor în același timp. --- Sistemul de variabile per jucător (pe scurt, PVar) este un nou mod de a crea variabile de jucător într-o metodă eficientă creată dinamic la nivel global, ceea ce înseamnă că pot fi folosite în modul de joc al serverului și în scripturile filtrelor în același timp. Sunt similare cu [SVars](servervariablesystem), dar sunt pe bază de jucător. Vedeți ultimele 2 postări din acest thread pentru a citi despre diferența dintre proprietățile amanetului și PVars. ## Avantaje Noul sistem introdus în serverul SA-MP 0.3a R5 actualizat are câteva avantaje majore față de crearea unei matrice de dimensiuni MAX_PLAYERS. - PVars pot fi partajate / accesate prin scripturi de moduri de joc și scripturi de filtre, ceea ce face mai ușoară modularizarea codului. - PVars sunt șterse automat atunci când un jucător părăsește serverul (după OnPlayerDisconnect), ceea ce înseamnă că nu trebuie să resetați manual variabilele pentru următorul jucător care se alătură. - Nu este nevoie reală de structuri complexe de informații despre jucători. - Salvează memoria nealocând elemente de matrice de pioni pentru player-uri care probabil nu vor fi folosite niciodată. - Puteți enumera și imprima cu ușurință / stoca lista PVar. Acest lucru facilitează atât depanarea, cât și stocarea informațiilor despre jucători. - Chiar dacă un PVar nu a fost creat, acesta va întoarce în continuare o valoare implicită de 0. - PVars pot conține șiruri foarte mari folosind memorie alocată dinamic. - Puteți seta, obține, crea jocul PVars. ## Dezavantaje - PVars sunt de câteva ori mai lente decât variabilele obișnuite. În general, este mai favorabil comerțul cu memoria pentru viteză, mai degrabă decât invers. ## Funcții Funcțiile pentru setarea și recuperarea variabilelor playerului sunt: - [SetPVarInt](../scripting/functions/SetPVarInt) Setați un număr întreg pentru o variabilă de jucător. - [GetPVarInt](../scripting/functions/GetPVarInt) Obțineți numărul întreg setat anterior de la o variabilă de jucător. - [SetPVarString](../scripting/functions/SetPVarString) Setați un șir pentru o variabilă de jucător. - [GetPVarString](../scripting/functions/GetPVarString) Obțineți șirul stabilit anterior de la o variabilă de jucător. - [SetPVarFloat](../scripting/functions/SetPVarFloat) Setați un float pentru o variabilă de jucător. - [GetPVarFloat](../scripting/functions/GetPVarFloat) Obțineți floatul setat anterior de la o variabilă de jucător. - [DeletePVar](../scripting/functions/GetPVarFloat) Ștergeți o variabilă de jucător. ```c #define PLAYER_VARTYPE_NONE (0) #define PLAYER_VARTYPE_INT (1) #define PLAYER_VARTYPE_STRING (2) #define PLAYER_VARTYPE_FLOAT (3) ```
openmultiplayer/web/docs/translations/ro/tutorials/perplayervariablesystem.md/0
{ "file_path": "openmultiplayer/web/docs/translations/ro/tutorials/perplayervariablesystem.md", "repo_id": "openmultiplayer", "token_count": 1337 }
409
--- title: AddPlayerClassEx description: Аналог функции AddPlayerClass, только с дополнительным параметром teamid. tags: ["player"] --- ## Описание Функция такая же самая как AddPlayerClass, только с дополнительным параметром teamid - установка команды, при выборе класса. | Параметр | Описание | | ------------- | ------------------------------------------------------------- | | teamid | Команда в которой игрок появиться. | | modelid | Скин с которым игрок появиться | | Float:spawn_x | Координаты X, для точки появляения данного класса. | | Float:spawn_y | Координаты Y, для точки появляения данного класса. | | Float:spawn_z | Координаты Z, для точки появляения данного класса. | | Float:z_angle | Угол направление игрока | | weapon1 | Первое оружие игрока | | weapon1_ammo | Патроны для первого оружия | | weapon2 | Второе оружие игрока | | weapon2_ammo | Патроны для второго оружия | | weapon3 | Третье оружие игрока | | weapon3_ammo | Патроны для третьего оружия | ## Возвращаемые данные ID класса который был создан. 319 если лимит (320) исчерпан. Самый высокий ID для класса это 319. ## Примеры ```c public OnGameModeInit() { // Игроки смогут выбрать появиться: // Со скином 0 (CJ) в команде номер 1. // Со скином 1 (The Truth) в команде номер 2. AddPlayerClassEx(1, 0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0); // CJ AddPlayerClassEx(2, 1, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0); // The Truth return 1; } ``` ## Примечания :::tip Максимальный ID класса 319 ( начинается с 0, что значит можно создать всего 320 классов ). В случае превышения лимита, добавленный класс будет заменять класс 319. ::: ## Связанные функции - [AddPlayerClass](AddPlayerClass.md): Добавляет класс. - [SetSpawnInfo](SetSpawnInfo.md): Установка информации для спавна игрока. - [SetPlayerTeam](SetPlayerTeam.md): Устанавливает команду игрока. - [SetPlayerSkin](SetPlayerSkin.md): Устанавливает скин игрока.
openmultiplayer/web/docs/translations/ru/scripting/functions/AddPlayerClassEx.md/0
{ "file_path": "openmultiplayer/web/docs/translations/ru/scripting/functions/AddPlayerClassEx.md", "repo_id": "openmultiplayer", "token_count": 1916 }
410
--- title: OnActorStreamIn description: Ta "callback" se pokliče, ko se "actor" pojavi v igralčevi "client". tags: [] --- :::warning Ta funkcijo je bila dodana v SA-MP 0.3.7 in ne deluje v nižjih različicah! ::: ## Opis Ta "callback" se pokliče, ko se "actor" pojavi v igralčevi "client". | Ime | Opis | | ----------- | ---------------------------------------------- | | actorid | ID "actor" ki se prikaže v igralčevi "client". | | forplayerid | ID igralec, v katerem se "actor" pojavi. | ## Returns Vedno je bila povabljena prva v "filterscript". ## Primeri ```c public OnActorStreamIn(actorid, forplayerid) { new string[40]; format(string, sizeof(string), "Actor %d pojavil v vaši "client".", actorid); SendClientMessage(forplayerid, 0xFFFFFFFF, string); return 1; } ``` ## Opombe :::tip Ta "callback" bo poklical tudi NPC. ::: ## Povezane Funkcijo
openmultiplayer/web/docs/translations/sl/scripting/callbacks/OnActorStreamIn.md/0
{ "file_path": "openmultiplayer/web/docs/translations/sl/scripting/callbacks/OnActorStreamIn.md", "repo_id": "openmultiplayer", "token_count": 417 }
411
--- title: OnActorStreamIn description: Овај колбек је позван када се актор појави у играчевом клијенту. tags: [] --- :::warning Овај колбек је додан у верзији SA-MP 0.3.7 и неће радити у ранијим верзијама! ::: ## Опис Овај колбек се позове када се актор појави у играчевом клијенту. | Име | Опис | | ----------- | --------------------------------- | | actorid | ID актора који се појавио играчу. | | forplayerid | ID играћа коме се актор појавио. | ## Узвраћања Увек се позива први у филтерскриптама. ## Примери ```c public OnActorStreamIn(actorid, forplayerid) { new string[40]; format(string, sizeof(string), "Actor %d is now streamed in for you.", actorid); SendClientMessage(forplayerid, 0xFFFFFFFF, string); return 1; } ``` ## Белешке :::tip Овај колбек такође може бити позван и од стране NPC-а. ::: ## Сродне функције
openmultiplayer/web/docs/translations/sr/scripting/callbacks/OnActorStreamIn.md/0
{ "file_path": "openmultiplayer/web/docs/translations/sr/scripting/callbacks/OnActorStreamIn.md", "repo_id": "openmultiplayer", "token_count": 671 }
412
--- title: SetPlayerCheckpoint description: Postavlja checkpoint (crveni krug) za igraca. tags: ["player", "checkpoint"] --- ## Description Postavlja checkpoint (crveni krug) za igraca. Takodje pokazuje crvenu kocku na mapi. Kada igrac udje u checkpoint, OnPlayerEnterCheckpoint se poziva i izvrsava se ono sto je u njemu. | Name | Description | | ---------- | -------------------------------------- | | playerid | ID igraca kome se postavlja checkpoint | | Float:x | X koordinata checkpointa. | | Float:y | Y koordinata checkpointa. | | Float:z | Z koordinata checkpointa. | | Float:size | Velicina checkpointa | ## Returns 1: Funkcija je uspesno izvrsena. 0: Funkcija nije uspesno izvrsena. To znaci da navedeni igrac ne postoji. ## Examples ```c // U ovom primeru se checkpoint postavlja kada se igrac spawna // Kada udju u checkpoint dobijaju 1000$ i checkpoint se gasi new bool: gOnCheck[MAX_PLAYERS]; public OnPlayerSpawn(playerid) { SetPlayerCheckpoint(playerid, 1982.6150, -220.6680, -0.2432, 3.0); gOnCheck[playerid] = true; return 1; } public OnPlayerEnterCheckpoint(playerid) { if (gOnCheck[playerid]) // Ako je uslov ispunjen { GivePlayerMoney(playerid, 1000); DisablePlayerCheckpoint(playerid); gOnCheck[playerid] = false; } return 1; } ``` ## Notes :::warning Checkpointi su asinhroni, sto znaci da samo jedan moze da se prikaze u isto vreme. Da bi se checkpoint 'streamovao' (samo se prikaze kada je igrac dovoljno blizu), koristiti checkpoint streamer. ::: ## Related Functions - [DisablePlayerCheckpoint](DisablePlayerCheckpoint.md): Gasi trenutno aktivni checkpoint igracu. - [IsPlayerInCheckpoint](IsPlayerInCheckpoint.md): Proverava da li je igrac u checkpointu. - [SetPlayerRaceCheckpoint](SetPlayerRaceCheckpoint.md): Kreiraj Race Checkpoint za igraca. - [DisablePlayerRaceCheckpoint](DisablePlayerRaceCheckpoint.md): Gasi trenutno aktivni race checkpoint igracu. - [IsPlayerInRaceCheckpoint](IsPlayerInRaceCheckpoint.md): Proverava da li je igrac u race chekcpointu. - [OnPlayerEnterCheckpoint](../callbacks/OnPlayerEnterCheckpoint.md): Poziva se kada igrac udje u checkpoint. - [OnPlayerLeaveCheckpoint](../callbacks/OnPlayerLeaveCheckpoint.md): Poziva se kada igrac izadje iz checkpointa. - [OnPlayerEnterRaceCheckpoint](../callbacks/OnPlayerEnterRaceCheckpoint.md): Poziva se kada igrac udje u race checkpoint. - [OnPlayerLeaveRaceCheckpoint](../callbacks/OnPlayerLeaveRaceCheckpoint.md): Poziva se kada igrac izadje iz race checkpointa.
openmultiplayer/web/docs/translations/sr/scripting/functions/SetPlayerCheckpoint.md/0
{ "file_path": "openmultiplayer/web/docs/translations/sr/scripting/functions/SetPlayerCheckpoint.md", "repo_id": "openmultiplayer", "token_count": 1016 }
413
--- title: OnPlayerClickPlayerTextDraw description: This callback is called when a player clicks on a player-textdraw. tags: ["player", "textdraw", "playertextdraw"] --- ## คำอธิบาย This callback is called when a player clicks on a player-textdraw. It is not called when player cancels the select mode (ESC) - however, OnPlayerClickTextDraw is. | Name | Description | | ------------ | ------------------------------------------------------- | | playerid | The ID of the player that selected a textdraw | | playertextid | The ID of the player-textdraw that the player selected. | ## ส่งคืน It is always called first in filterscripts so returning 1 there also blocks other scripts from seeing it. ## ตัวอย่าง ```c new PlayerText:gPlayerTextDraw[MAX_PLAYERS]; public OnPlayerConnect(playerid) { // Create the textdraw gPlayerTextDraw[playerid] = CreatePlayerTextDraw(playerid, 10.000000, 141.000000, "MyTextDraw"); PlayerTextDrawTextSize(playerid, gPlayerTextDraw[playerid], 60.000000, 20.000000); PlayerTextDrawAlignment(playerid, gPlayerTextDraw[playerid],0); PlayerTextDrawBackgroundColor(playerid, gPlayerTextDraw[playerid],0x000000ff); PlayerTextDrawFont(playerid, gPlayerTextDraw[playerid], 1); PlayerTextDrawLetterSize(playerid, gPlayerTextDraw[playerid], 0.250000, 1.000000); PlayerTextDrawColor(playerid, gPlayerTextDraw[playerid], 0xffffffff); PlayerTextDrawSetProportional(playerid, gPlayerTextDraw[playerid], 1); PlayerTextDrawSetShadow(playerid, gPlayerTextDraw[playerid], 1); // Make it selectable PlayerTextDrawSetSelectable(playerid, gPlayerTextDraw[playerid], 1); // Show it to the player PlayerTextDrawShow(playerid, gPlayerTextDraw[playerid]); return 1; } public OnPlayerKeyStateChange(playerid, KEY:newkeys, KEY:oldkeys) { if (newkeys == KEY_SUBMISSION) { SelectTextDraw(playerid, 0xFF4040AA); } return 1; } public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid) { if (playertextid == gPlayerTextDraw[playerid]) { SendClientMessage(playerid, 0xFFFFFFAA, "You clicked on a textdraw."); CancelSelectTextDraw(playerid); return 1; } return 0; } ``` ## บันทึก :::warning When a player presses ESC to cancel selecting a textdraw, OnPlayerClickTextDraw is called with a textdraw ID of 'INVALID_TEXT_DRAW'. OnPlayerClickPlayerTextDraw won't be called also. ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [PlayerTextDrawSetSelectable](../../scripting/functions/PlayerTextDrawSetSelectable.md): Sets whether a player-textdraw is selectable through SelectTextDraw - [OnPlayerClickTextDraw](../../scripting/callbacks/OnPlayerClickTextDraw.md): Called when a player clicks on a textdraw. - [OnPlayerClickPlayer](../../scripting/callbacks/OnPlayerClickPlayer.md): Called when a player click on another.
openmultiplayer/web/docs/translations/th/scripting/callbacks/OnPlayerClickPlayerTextDraw.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/callbacks/OnPlayerClickPlayerTextDraw.md", "repo_id": "openmultiplayer", "token_count": 1074 }
414
--- title: OnPlayerInteriorChange description: Called when a player changes interior. tags: ["player"] --- ## คำอธิบาย Called when a player changes interior. Can be triggered by SetPlayerInterior or when a player enter/exits a building. | Name | Description | | ------------- | -------------------------------------- | | playerid | The playerid who changed interior. | | newinteriorid | The interior the player is now in. | | oldinteriorid | The interior the player was in before. | ## ส่งคืน มันถูกเรียกในเกมโหมดก่อนเสมอ ## ตัวอย่าง ```c public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid) { new string[42]; format(string, sizeof(string), "You went from interior %d to interior %d!", oldinteriorid, newinteriorid); SendClientMessage(playerid, COLOR_ORANGE, string); return 1; } ``` ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [SetPlayerInterior](../../scripting/functions/SetPlayerInterior.md): Set a player's interior. - [GetPlayerInterior](../../scripting/functions/GetPlayerInterior.md): Get the current interior of a player. - [LinkVehicleToInterior](../../scripting/functions/LinkVehicleToInterior.md): Change the interior that a vehicle is seen in. - [OnPlayerStateChange](../../scripting/callbacks/OnPlayerStateChange.md): Called when a player changes state.
openmultiplayer/web/docs/translations/th/scripting/callbacks/OnPlayerInteriorChange.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/callbacks/OnPlayerInteriorChange.md", "repo_id": "openmultiplayer", "token_count": 564 }
415
--- title: OnPlayerText description: Called when a player sends a chat message. tags: ["player"] --- ## คำอธิบาย Called when a player sends a chat message. | Name | Description | | -------- | ---------------------------------------- | | playerid | The ID of the player who typed the text. | | text[] | The text the player typed. | ## ส่งคืน It is always called first in filterscripts so returning 0 there blocks other scripts from seeing it. ## ตัวอย่าง ```c public OnPlayerText(playerid, text[]) { new pText[144]; format(pText, sizeof (pText), "(%d) %s", playerid, text); SendPlayerMessageToAll(playerid, pText); return 0; // ignore the default text and send the custom one } ``` ## บันทึก :::tip NPC สามารถเรียก Callback นี้ได้ ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [SendPlayerMessageToPlayer](../../scripting/functions/SendPlayerMessageToPlayer.md): Force a player to send text for one player. - [SendPlayerMessageToAll](../../scripting/functions/SendPlayerMessageToAll.md): Force a player to send text for all players.
openmultiplayer/web/docs/translations/th/scripting/callbacks/OnPlayerText.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/callbacks/OnPlayerText.md", "repo_id": "openmultiplayer", "token_count": 494 }
416
--- title: OnVehicleStreamOut description: This callback is called when a vehicle is streamed out for a player's client (it's so far away that they can't see it). tags: ["vehicle"] --- ## คำอธิบาย This callback is called when a vehicle is streamed out for a player's client (it's so far away that they can't see it). | Name | Description | | ----------- | ------------------------------------------------------------ | | vehicleid | The ID of the vehicle that streamed out. | | forplayerid | The ID of the player who is no longer streaming the vehicle. | ## ส่งคืน มันถูกเรียกในฟิลเตอร์สคริปต์ก่อนเสมอ ## ตัวอย่าง ```c public OnVehicleStreamOut(vehicleid, forplayerid) { new string[48]; format(string, sizeof(string), "Your client is no longer streaming vehicle %d", vehicleid); SendClientMessage(forplayerid, 0xFFFFFFFF, string); return 1; } ``` ## บันทึก :::tip NPC สามารถเรียก Callback นี้ได้ ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน
openmultiplayer/web/docs/translations/th/scripting/callbacks/OnVehicleStreamOut.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/callbacks/OnVehicleStreamOut.md", "repo_id": "openmultiplayer", "token_count": 549 }
417
--- title: Attach3DTextLabelToPlayer description: Attach a 3D text label to a player. tags: ["player", "3dtextlabel"] --- ## คำอธิบาย Attach a 3D text label to a player. | Name | Description | | --------- | --------------------------------------------------------------------- | | Text3D:textid | The ID of the 3D text label to attach. Returned by Create3DTextLabel. | | playerid | The ID of the player to attach the label to. | | OffsetX | The X offset from the player. | | OffsetY | The Y offset from the player. | | OffsetZ | The Z offset from the player. | ## ส่งคืน 1: The function executed successfully. 0: The function failed to execute. This means the player and/or label do not exist. ## ตัวอย่าง ```c public OnPlayerConnect(playerid) { new Text3D:label = Create3DTextLabel("Hello, I am new here!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0); Attach3DTextLabelToPlayer(label, playerid, 0.0, 0.0, 0.7); return 1; } ``` ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [Create3DTextLabel](../../scripting/functions/Create3DTextLabel.md): Create a 3D text label. - [Delete3DTextLabel](../../scripting/functions/Delete3DTextLabel.md): Delete a 3D text label. - [Attach3DTextLabelToVehicle](../../scripting/functions/Attach3DTextLabelToVehicle.md): Attach a 3D text label to a vehicle. - [Update3DTextLabelText](../../scripting/functions/Update3DTextLabelText.md): Change the text of a 3D text label. - [CreatePlayer3DTextLabel](../../scripting/functions/CreatePlayer3DTextLabel.md): Create A 3D text label for one player. - [DeletePlayer3DTextLabel](../../scripting/functions/DeletePlayer3DTextLabel.md): Delete a player's 3D text label. - [UpdatePlayer3DTextLabelText](../../scripting/functions/UpdatePlayer3DTextLabel.md): Change the text of a player's 3D text label.
openmultiplayer/web/docs/translations/th/scripting/functions/Attach3DTextLabelToPlayer.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/Attach3DTextLabelToPlayer.md", "repo_id": "openmultiplayer", "token_count": 876 }
418
--- title: CancelSelectTextDraw description: Cancel textdraw selection with the mouse. tags: ["textdraw"] --- ## คำอธิบาย Cancel textdraw selection with the mouse | Name | Description | | -------- | ------------------------------------------------------------------- | | playerid | The ID of the player that should be the textdraw selection disabled | ## ส่งคืน This function does not return any specific values. ## ตัวอย่าง ```c public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/cancelselect", true)) { CancelSelectTextDraw(playerid); SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: TextDraw selection disabled!"); return 1; } return 0; } ``` ## บันทึก :::warning \*This function calls OnPlayerClickTextDraw with INVALID_TEXT_DRAW (65535). Using this function inside OnPlayerClickTextDraw without catching this case will cause clients to go into an infinite loop. ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [SelectTextDraw](../functions/SelectTextDraw.md): Enables the mouse, so the player can select a textdraw - [TextDrawSetSelectable](../functions/TextDrawSetSelectable.md): Sets whether a textdraw is selectable through SelectTextDraw - [OnPlayerClickTextDraw](../callbacks/OnPlayerClickTextDraw.md): Called when a player clicks on a textdraw.
openmultiplayer/web/docs/translations/th/scripting/functions/CancelSelectTextDraw.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/CancelSelectTextDraw.md", "repo_id": "openmultiplayer", "token_count": 540 }
419
--- title: CreateVehicle description: Creates a vehicle in the world. tags: ["vehicle"] --- ## คำอธิบาย Creates a vehicle in the world. Can be used in place of AddStaticVehicleEx at any time in the script. | Name | Description | | -------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | | [modelid](../resources/vehicleid) | The model for the vehicle. | | Float:spawnX | The X coordinate for the vehicle. | | Float:spawnY | The Y coordinate for the vehicle. | | Float:spawnZ | The Z coordinate for the vehicle. | | Float:angle | The facing angle for the vehicle. | | [colour1](../resources/vehiclecolorid) | The primary color ID. | | [colour2](../resources/vehiclecolorid) | The secondary color ID. | | respawnDelay | The delay until the car is respawned without a driver in seconds. Using -1 will prevent the vehicle from respawning. | | bool:addSiren | Has a default value 'false'. Enables the vehicle to have a siren, providing the vehicle has a horn. | ## ส่งคืน The vehicle ID of the vehicle created (1 to MAX_VEHICLES). INVALID_VEHICLE_ID (65535) if vehicle was not created (vehicle limit reached or invalid vehicle model ID passed). 0 if vehicle was not created (IDs 538 or 537 passed, which is trains). ## ตัวอย่าง ```c public OnGameModeInit() { // Add a Hydra (520) to the game with a respawn time of 60 seconds CreateVehicle(520, 2109.1763, 1503.0453, 32.2887, 82.2873, -1, -1, 60); return 1; } ``` ## บันทึก :::warning Trains can only be added with AddStaticVehicle and AddStaticVehicleEx. ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [DestroyVehicle](DestroyVehicle): Destroy a vehicle. - [AddStaticVehicle](AddStaticVehicle): Add a static vehicle. - [AddStaticVehicleEx](AddStaticVehicleEx): Add a static vehicle with custom respawn time. - [GetVehicleParamsSirenState](GetVehicleParamsSirenState): Check whether a vehicle's siren is on or off. - [SetVehicleSpawnInfo](SetVehicleSpawnInfo): Adjusts vehicle model, spawn location, colours, respawn delay and interior. - [GetVehicleSpawnInfo](GetVehicleSpawnInfo): Gets the vehicle spawn location and colours. - [ChangeVehicleColours](ChangeVehicleColours): Change a vehicle's primary and secondary colors. - [GetVehicleColours](GetVehicleColours): Gets the vehicle colours. - [SetVehicleRespawnDelay](SetVehicleRespawnDelay): Set the respawn delay of a vehicle. - [GetVehicleRespawnDelay](GetVehicleRespawnDelay): Get the respawn delay of a vehicle. ## Related Callbacks - [OnVehicleSpawn](../callbacks/OnVehicleSpawn): Called when a vehicle respawns. - [OnVehicleSirenStateChange](../callbacks/OnVehicleSirenStateChange): Called when a vehicle's siren is toggled on/off. ## Related Resources - [Vehicle Models](../resources/vehicleid): Comprehensive list of all vehicle models available in game. - [Vehicle Colour IDs](../resources/vehiclecolorid): List of all vehicle colour IDs.
openmultiplayer/web/docs/translations/th/scripting/functions/CreateVehicle.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/CreateVehicle.md", "repo_id": "openmultiplayer", "token_count": 1864 }
420
--- title: DisablePlayerCheckpoint description: Disables (hides/destroys) a player's set checkpoint. tags: ["player", "checkpoint"] --- ## คำอธิบาย Disables (hides/destroys) a player's set checkpoint. Players can only have a single checkpoint set at a time. Checkpoints don't need to be disabled before setting another one. | Name | Description | | -------- | ------------------------------------------------- | | playerid | The ID of the player whose checkpoint to disable. | ## ส่งคืน 1: The function executed successfully. Success is also returned if the player doesn't have a checkpoint shown already. 0: The function failed to execute. This means the player is not connected. ## ตัวอย่าง ```c public OnPlayerEnterCheckpoint(playerid) { GivePlayerMoney(playerid, 10000); DisablePlayerCheckpoint(playerid); return 1; } ``` ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [SetPlayerCheckpoint](../../scripting/functions/SetPlayerCheckpoint.md): Create a checkpoint for a player. - [IsPlayerInCheckpoint](../../scripting/functions/IsPlayerInCheckpoint.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. - [OnPlayerEnterCheckpoint](../../scripting/callbacks/OnPlayerEnterCheckpoint.md): Called when a player enters a checkpoint. - [OnPlayerLeaveCheckpoint](../../scripting/callbacks/OnPlayerLeaveCheckpoint.md): Called when a player leaves a checkpoint. - [OnPlayerLeaveRaceCheckpoint](../../scripting/callbacks/OnPlayerLeaveRaceCheckpoint.md): Called when a player leaves a race checkpoint. - [OnPlayerEnterRaceCheckpoint](../../scripting/callbacks/OnPlayerEnterRaceCheckpoint.md): Called when a player enters a race checkpoint.
openmultiplayer/web/docs/translations/th/scripting/functions/DisablePlayerCheckpoint.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/DisablePlayerCheckpoint.md", "repo_id": "openmultiplayer", "token_count": 669 }
421
--- title: GameTextForAll description: Shows 'game text' (on-screen text) for a certain length of time for all players. tags: [] --- ## คำอธิบาย Shows 'game text' (on-screen text) for a certain length of time for all players. | Name | Description | | -------------- | ----------------------------------------------------- | | const string[] | The text to be displayed. | | time | The duration of the text being shown in milliseconds. | | style | The style of text to be displayed. | ## ส่งคืน This function always returns 1. ## ตัวอย่าง ```c public OnPlayerDeath(playerid, killerid, WEAPON:reason) { // This example shows a large, white text saying "[playerName] has // passed away" on everyone's screen, after a player has died or // has been killed. It shows in text-type 3, for 5 seconds (5000 ms) new name[ 24 ], string[ 64 ]; GetPlayerName( playerid, name, 24 ); // Format the passed-away message properly, and show it to everyone: format( string, sizeof(string), "~w~%s has passed away", name ); GameTextForAll( string, 5000, 3 ); return 1; } ``` ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [GameTextForPlayer](../functions/GameTextForPlayer): Display gametext to a player. - [TextDrawShowForAll](../functions/TextDrawShowForAll): Show a textdraw for all players.
openmultiplayer/web/docs/translations/th/scripting/functions/GameTextForAll.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/GameTextForAll.md", "repo_id": "openmultiplayer", "token_count": 594 }
422
--- title: GetActorVirtualWorld description: Get the virtual world of an actor. tags: [] --- :::warning ฟังก์ชั่นนี้ถูกเพิ่มใน SA-MP 0.3.7 และจะไม่ทำงานในเวอร์ชั่นก่อนหน้านี้! ::: ## คำอธิบาย Get the virtual world of an actor. | Name | Description | | ------- | ------------------------------------------------ | | actorid | The ID of the actor to get the virtual world of. | ## ส่งคืน The virtual world of the actor. By default this is 0. Also returns 0 if actor specified does not exist. ## ตัวอย่าง ```c new MyActor; public OnGameModeInit() { MyActor = CreateActor(...); SetActorVirtualWorld(MyActor, 69); return 1; } // Somewhere else if (GetActorVirtualWorld(MyActor) == 69) { // Do something } ``` ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [SetActorVirtualWorld](../functions/SetActorVirtualWorld): Set the virtual world of an actor.
openmultiplayer/web/docs/translations/th/scripting/functions/GetActorVirtualWorld.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/GetActorVirtualWorld.md", "repo_id": "openmultiplayer", "token_count": 492 }
423