text stringlengths 1 2.83M | id stringlengths 16 152 | metadata dict | __index_level_0__ int64 0 949 |
|---|---|---|---|
---
title: AddMenuItem
description: Dodaje stavku/item u određeni meniju.
tags: ["menu"]
---
## Deskripcija
Dodaje stavku/item u određeni meniju.
| Ime | Deskripcija |
| ------- | --------------------------------------- |
| menuid | ID menija u kojem dodajete stavku/item. |
| column | Rubrika u koju dodajete stavku/item. |
| title[] | Naslov nove stavke/itema. |
## Returns
Indeks reda u koji je dodana ova stavka/item.
## Primjeri
```c
new Menu:gExampleMenu;
public OnGameModeInit()
{
gExampleMenu = CreateMenu("Your Menu", 2, 200.0, 100.0, 150.0, 150.0);
AddMenuItem(gExampleMenu, 0, "item 1");
AddMenuItem(gExampleMenu, 0, "item 2");
return 1;
}
```
## Zabilješke
:::tip
Crashuje kada se proslijedi nevažeći ID menija. Možete imati samo 12 stavki/itema po meniju (13i ide na desnu stranu zaglavlja od imena rubrike (obojeno), 14i i više se neće uopće pojavljivati). možete koristiti samo 2 rubrike (0 i 1). Možete dodati samo 8 kodova boja po jednoj stavci/itemu (~r~, ~g~ itd.). Maksimalna dužina teksta stavke/itema je 31 simbol.
:::
## Srodne Funkcije
- [CreateMenu](CreateMenu.md): Kreira meni.
- [SetMenuColumnHeader](SetMenuColumnHeader.md): Postavite zaglavlje za jedan od stupaca u izborniku.
- [DestroyMenu](DestroyMenu.md): Uništi meni.
- [OnPlayerSelectedMenuRow](../callbacks/OnPlayerSelectedMenuRow.md): Pozvano kada igrač selektuje red u meniju.
- [OnPlayerExitedMenu](../callbacks/OnPlayerExitedMenu.md): Pozvano kada igrač napusti meni.
| openmultiplayer/web/docs/translations/bs/scripting/functions/AddMenuItem.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/AddMenuItem.md",
"repo_id": "openmultiplayer",
"token_count": 666
} | 338 |
---
title: AttachCameraToObject
description: Možete koristiti ovu funkciju da prikvačite kameru igrača za objekt.
tags: []
---
## Deskripcija
Možete koristiti ovu funkciju da prikvačite kameru igrača za objekt.
| Ime | Deskripcija |
| -------- | -------------------------------------------------------------------- |
| playerid | ID igrača koji će imati kameru prikvačenu za objekat. |
| objectid | ID objekta za kojeg želite prikvačiti kameru igrača. |
## Returns
Ova funkcija ne returna(vraća) nikakve posebne vrijednosti.
## Primjeri
```c
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/attach", false))
{
new objectId = CreateObject(1245, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0);
AttachCameraToObject(playerid, objectId);
SendClientMessage(playerid, 0xFFFFFFAA, "Your camera is attached on object now.");
return 1;
}
return 0;
}
```
## Zabilješke
:::tip
Prvo morate stvoriti objekt, prije nego što pokušate za to prikvačiti kameru igrača.
:::
## Srodne Funkcije
- [AttachCameraToPlayerObject](AttachCameraToPlayerObject): Prikvači kameru igrača za player objekat.
| openmultiplayer/web/docs/translations/bs/scripting/functions/AttachCameraToObject.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/AttachCameraToObject.md",
"repo_id": "openmultiplayer",
"token_count": 574
} | 339 |
---
title: ChangeVehiclePaintjob
description: Promjena paintjob-a vozila (za obične boje pogledajte ChangeVehicleColor).
tags: ["vehicle"]
---
## Deskripcija
Promjena paintjob-a vozila (za obične boje pogledajte ChangeVehicleColor).
| Name | Description |
| ---------- | --------------------------------------------------------------------- |
| vehicleid | ID vozila kojem se mijenja paintjob |
| paintjobid | ID paintjob-a koji se postavlja na vozilo. 3 za uklanjanje paintjob-a |
## Returns
This function always returns 1 (success), even if the vehicle passed is not created.
:::warning
Ukoliko je boja vozila crna, paintjob može da bude nevidljiv. Bolje je napraviti vozilo sa bijelom bojom prije postavljanja paintjob-a korištenjem ChangeVehicleColor(vehicleid,1,1);
:::
## Primjeri
```c
new rand = random(3); // biće ili 0 1 ili 2 (sve važeće)
ChangeVehicleColor(GetPlayerVehicleID(playerid),1,1); // pazimo da li je bijela za bolji rezultat
ChangeVehiclePaintjob(GetPlayerVehicleID(playerid), rand); // mijenja paintjob igračevog trenutnog vozila u nasumičan
```
## Srodne Funkcije
- [ChangeVehicleColor](ChangeVehicleColor): Promjena boje vozila.
- [OnVehiclePaintjob](../callbacks/OnVehiclePaintjob): Poziva se kada se paintjob vozila promijeni.
| openmultiplayer/web/docs/translations/bs/scripting/functions/ChangeVehiclePaintjob.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/ChangeVehiclePaintjob.md",
"repo_id": "openmultiplayer",
"token_count": 559
} | 340 |
---
title: DeletePVar
description: Briše prethodno postavljenu varijablu igrača.
tags: ["pvar"]
---
## Deskripcija
Briše prethodno postavljenu varijablu igrača.
| Ime | Deskripcija |
| -------- | ------------------------------------------ |
| playerid | ID igrača kojem brišemo varijablu |
| varname | Ime varijable koju brišemo |
## Returns
1: Funkcija uspješno izvršena.
0: Funkcija neuspješno izvršena. Ili navedeni igrač nije konektovan ili nema postavljene varijable sa tim imenom.
## Primjeri
```c
SetPVarInt(playerid, "SomeVarName", 69);
// Kasnije, kada varijabla nije više potrebna...
DeletePVar(playerid, "SomeVarName");
```
## Zabilješke
:::tip
Jednom kada se varijabla izbriše, pokušavajući vratiti vrijednost vratiti će 0 (za integere i floatove i NULL za stringove).
:::
## Srodne Funkcije
- [SetPVarInt](SetPVarInt): Postavlja tip integer za varijablu igrača.
- [GetPVarInt](GetPVarInt): Uzima prethodni postavljeni integer za varijablu igrača.
- [SetPVarString](SetPVarString): Postavlja tip string za varijablu igrača.
- [GetPVarString](GetPVarString): Uzima prethodni postavljeni string za varijablu igrača.
- [SetPVarFloat](SetPVarFloat): Postavlja tip float za varijablu igrača.
- [GetPVarFloat](GetPVarFloat): Uzima prethodni postavljeni float za varijablu igrača.
| openmultiplayer/web/docs/translations/bs/scripting/functions/DeletePVar.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/DeletePVar.md",
"repo_id": "openmultiplayer",
"token_count": 615
} | 341 |
---
title: DisableRemoteVehicleCollisions
description: Igraču onemogućava sudare između zauzetih vozila.
tags: ["vehicle"]
---
:::warning
Ova funkcija je dodana u SA-MP 0.3.7 i ne radi u nižim verzijama!
:::
## Deskripcija
Igraču onemogućava sudare između zauzetih vozila.
| Ime | Deskripcija |
| -------- | ------------------------------------------------ |
| playerid | ID igrača kojem želite da onemogućite sudaranje. |
| disable | 1 da onemogućite sudare, 0 da omogućite sudare. |
## Returns
1: Funkcija uspješno izvršena.
0: Funkcija neuspješno izvršena. Navedeni igrač ne postoji.
## Primjeri
```c
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/collision", true))
{
new string[64];
format(string, sizeof(string), "Sudar vozila za vas je sada '%s'", (GetPVarInt(playerid, "vehCollision") != 1) ? ("Disabled") : ("Enabled"));
SendClientMessage(playerid, 0xFFFFFFFF, string);
SetPVarInt(playerid, "vehCollision", !GetPVarInt(playerid, "vehCollision"));
DisableRemoteVehicleCollisions(playerid, GetPVarInt(playerid, "vehCollision"));
return 1;
}
return 0;
}
```
## Srodne Funkcije
| openmultiplayer/web/docs/translations/bs/scripting/functions/DisableRemoteVehicleCollisions.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/DisableRemoteVehicleCollisions.md",
"repo_id": "openmultiplayer",
"token_count": 555
} | 342 |
---
title: GangZoneCreate
description: Kreiraj gangzonu (radarsko područje u boji).
tags: ["gangzone"]
---
## Deskripcija
Kreiraj gangzonu (radarsko područje u boji).
| Ime | Deskripcija |
| ---- | ---------------------------------------- |
| minx | X kordinata za zapadnu stranu gangzone. |
| miny | Y kordinata za južnu stranu gangzone. |
| maxx | X kordinata za istočnu stranu gangzone. |
| maxy | Y kordinata za sjevernu stranu gangzone. |
## Returns
ID kreirane zone, returna/vraća -1 ako nije kreirana.
## Primjeri
```c
new gangzone;
gangzone = GangZoneCreate(1248.011, 2072.804, 1439.348, 2204.319);
```
```p
MinY
v
MinX > *-------------
| |
| gangzone |
| center |
| |
-------------* < MaxX
^
MaxY
```
## Zabilješke
:::tip
Ova funkcija samo STVARA gangzonu, za prikaz morate koristiti GangZoneShowForPlayer ili GangZoneShowForAll.
:::
:::warning
Postoji ograničenje od 1024 gangzone. Stavljanje parametara u pogrešan redoslijed rezultira glitchy ponašanjem.
:::
## Srodne Funkcije
- [GangZoneDestroy](GangZoneDestroy): Uništi gang zonu.
- [GangZoneShowForPlayer](GangZoneShowForPlayer): Prikaži gang zonu za igrača.
- [GangZoneShowForAll](GangZoneShowForAll): Prikaži gang zonu za sve igrače.
- [GangZoneHideForPlayer](GangZoneHideForPlayer): Sakrij gangzonu za igrača.
- [GangZoneHideForAll](GangZoneHideForAll): Sakrij gangzonu za sve igrače.
- [GangZoneFlashForPlayer](GangZoneFlashForPlayer): Kreiraj bljeskalicu gang zone za igrača.
- [GangZoneFlashForAll](GangZoneFlashForAll): Kreiraj bljeskalicu gang zone za sve igrače.
- [GangZoneStopFlashForPlayer](GangZoneStopFlashForPlayer): Zaustavi gang zonu da bljeska za igrača.
- [GangZoneStopFlashForAll](GangZoneStopFlashForAll): Zaustavi gang zonu da bljeska za sve igrače.
| openmultiplayer/web/docs/translations/bs/scripting/functions/GangZoneCreate.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/GangZoneCreate.md",
"repo_id": "openmultiplayer",
"token_count": 924
} | 343 |
---
title: GetConsoleVarAsBool
description: Dobij bool(ean) vrijednost varijable iz konzole.
tags: []
---
## Deskripcija
Dobij bool(ean) vrijednost varijable iz konzole.
| Ime | Deskripcija |
| --------------- | ----------------------------------------------------- |
| const varname[] | Ime boolean varijable za dobijanje vrijednosti. |
## Returns
Vrijednost navedene console varijable. 0 ako navedena console varijabla nije boolean ili ne postoji.
## Primjeri
```c
public OnGameModeInit()
{
new queryEnabled = GetConsoleVarAsBool("query");
if (!queryEnabled)
{
print("UPOZORENJE: Querying je onemogućen. Server će biti van mreže (offline) u pretraživaču servera.");
}
return 1;
}
```
## Zabilješke
:::tip
Upišite 'varlist' u konzolu servera da biste prikazali listu dostupnih console varijabli i njihove tipove.
:::
## Srodne Funkcije
- [GetConsoleVarAsString](GetConsoleVarAsString): Dobij string vrijednost varijable iz konzole.
- [GetConsoleVarAsInt](GetConsoleVarAsInt): Dobij cjelobrojnu (integer) vrijednost varijable iz konzole.
| openmultiplayer/web/docs/translations/bs/scripting/functions/GetConsoleVarAsBool.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/GetConsoleVarAsBool.md",
"repo_id": "openmultiplayer",
"token_count": 492
} | 344 |
---
title: GetPlayerMarkerForPlayer
description: Dobij boju igračovog nametag-a i radara za drugog igrača.
tags: ["player"]
---
<VersionWarn version='omp v1.1.0.2612' />
## Deskripcija
Dobij boju igračovog **nametag-a** i **radara** za drugog igrača.
| Ime | Deskripcija |
| -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| playerid | Igrač koji može vidjeti igračevu promijenjenu boju blipa/nametag-a |
| targetid | Igrač čija je boja promijenjena. |
## Return-ovi
Boja **nametag-a** i **radara** target igrača.
## Primjeri
```c
// Napraviti da igrač 42 vidi igrača 1 kao crveni marker
SetPlayerMarkerForPlayer(42, 1, 0xFF0000FF);
new markerColour = GetPlayerMarkerForPlayer(42, 1);
// markerColour = 0xFF0000FF
```
## Srodne Funkcije
- [ShowPlayerMarkers](ShowPlayerMarkers): Odluči da li server treba da prikazuje markere na radaru.
- [LimitPlayerMarkerRadius](LimitPlayerMarkerRadius): Ograniči radijus markera igrača.
- [SetPlayerColor](SetPlayerColor): Postavi boju igrača.
- [ShowPlayerNameTagForPlayer](ShowPlayerNameTagForPlayer): Prikaži ili sakrij nametag određenog igrača.
- [SetPlayerMarkerForPlayer](SetPlayerMarkerForPlayer): Postavi marker igrača za određenog igrača.
| openmultiplayer/web/docs/translations/bs/scripting/functions/GetPlayerMarkerForPlayer.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/GetPlayerMarkerForPlayer.md",
"repo_id": "openmultiplayer",
"token_count": 803
} | 345 |
---
title: GetPlayerWeapon
description: Vraća ID oružja kojeg igrač trenutno drži.
tags: ["player"]
---
## Deskripcija
Vraća ID oružja kojeg igrač trenutno drži.
| Ime | Deskripcija |
| -------- | ------------------------------------ |
| playerid | ID igrača za dobiti trenutno oružje. |
## Returns
ID igračevog trenutnog oružja. Returna/vraća -1 ako navedeni igrač ne postoji.
## Primjeri
```c
public OnPlayerDeath(playerid, killerid, WEAPON:reason)
{
// Provjeri ako je killerid nevažeći igrač (da li je konektovan).
if (killerid != INVALID_PLAYER_ID)
{
// WEAPON_MINIGUN konstanta je prethodno definisana u standardom library-u/biblioteci i jednaka je 38.
if (GetPlayerWeapon(killerid) == WEAPON_MINIGUN)
{
// Banuj ako ima minigun
Ban(killerid);
}
}
return 1;
}
```
## Zabilješke
:::tip
Kada je stanje igrača PLAYER_STATE_DRIVER ili PLAYER_STATE_PASSENGER, ova funkcija vraća oružje koje je igrač držao prije nego što je ušao u vozilo. Ako se varalica koristi za stvaranje municije u vozilu, ova funkcija to neće prijaviti.
:::
:::warning
Ponekad rezultat može biti -1 što je nevažeći ID oružja. Okolnosti ovoga još nisu poznate, ali najbolje je odbaciti informacije kada je vraćeno oružje -1.
:::
## Srodne Funkcije
- [GetPlayerWeaponData](GetPlayerWeaponData): Saznajte informacije o oružju koje igrač ima.
- [GivePlayerWeapon](GivePlayerWeapon): Daj igraču oružje.
- [ResetPlayerWeapons](ResetPlayerWeapons): Ukloni sva oružja igrača.
| openmultiplayer/web/docs/translations/bs/scripting/functions/GetPlayerWeapon.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/GetPlayerWeapon.md",
"repo_id": "openmultiplayer",
"token_count": 743
} | 346 |
---
title: GetVehicleDamageStatus
description: Dohvatite status oštećenja vozila.
tags: ["vehicle"]
---
:::tip
Za neke korisne funkcije za rad sa vrijednostima oštećenja vozila pogledajte [ovdje](../resources/damagestatus).
:::
## Deskripcija
Dohvatite status oštećenja vozila.
| Ime | Deskripcija |
| --------------------------- | ------------------------------------------------------------------------------ |
| vehicleid | ID vozila za dobiti status oštećenja. |
| VEHICLE_PANEL_STATUS:panels | Varijabla za pohraniti podatke o oštećenjima panela, proslijeđeno referencom. |
| VEHICLE_DOOR_STATUS:doors | Varijabla za pohraniti podatke o oštećenjima vrata, proslijeđeno referencom. |
| VEHICLE_LIGHT_STATUS:lights | Varijabla za pohraniti podatke o oštećenjima svjetla, proslijeđeno referencom. |
| VEHICLE_TIRE_STATUS:tires | Varijabla za pohraniti podatke o oštećenjima guma, proslijeđeno referencom. |
## Returns
1: Funkcija uspješno izvršena.
0: Funkcija neuspješno izvršena. Ovo znači da navedeno vozilo ne postoji.
## Primjeri
```c
new
VEHICLE_PANEL_STATUS:panels,
VEHICLE_DOOR_STATUS:doors,
VEHICLE_LIGHT_STATUS:lights,
VEHICLE_TIRE_STATUS:tires;
GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
printf("Vehicle Status: [Paneli]: %d - [Vrata]: %d - [Svjetla]: %d - [Gume]: %d", panels, doors, lights, tires);
```
## Srodne Funkcije
- [UpdateVehicleDamageStatus](UpdateVehicleDamageStatus): Ažurirajte štetu na vozilu.
- [SetVehicleHealth](SetVehicleHealth): Postavi helte vozila.
- [GetVehicleHealth](GetVehicleHealth): Provjeri helte vozila.
- [RepairVehicle](RepairVehicle): U potpunosti popravite vozilo.
## Srodne Callbacks
- [OnVehicleDamageStatusUpdate](../callbacks/OnVehicleDamageStatusUpdate): Pozvano kada se stanje oštećenja vozila promijeni.
## Srodne Resources
- [Damage Status](../resources/damagestatus)
- [Vehicle Panel Status](../resources/vehicle-panel-status)
- [Vehicle Door Status](../resources/vehicle-door-status)
- [Vehicle Light Status](../resources/vehicle-light-status)
- [Vehicle Tire Status](../resources/vehicle-tire-status)
| openmultiplayer/web/docs/translations/bs/scripting/functions/GetVehicleDamageStatus.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/GetVehicleDamageStatus.md",
"repo_id": "openmultiplayer",
"token_count": 976
} | 347 |
---
title: GetWeaponName
description: Dobij ime oružja.
tags: []
---
## Deskripcija
Dobij ime oružja.
| Ime | Deskripcija |
| -------------- | -------------------------------------------------------------------- |
| weaponid | ID oružja za dobiti ime. |
| const weapon[] | Niz za pohraniti ime oružja, proslijeđeno referencom. |
| len | Maksimalna dužina imena oružja za pohraniti. Should be sizeof(name). |
## Returns
1: Funkcija uspješno izvršena.
0: Funkcija neuspješno izvršena. Navedeno oružje ne postoji.
Ime oružja pohranjeno je u navedenom nizu.
## Primjeri
```c
public OnPlayerDeath(playerid, killerid, WEAPON:reason)
{
// Deklaracije varijabli, s killerName koji ima zadanu vrijednost "World".
new
weaponName[32],
string[64],
playerName[MAX_PLAYER_NAME + 1],
killerName[MAX_PLAYER_NAME + 1] = "World";
// Uzmite oružje / razlog i ime igrača
GetWeaponName(reason, weaponName, sizeof(weaponName));
GetPlayerName(playerid, playerName, sizeof(playerName));
// Provjerite je li igrača ubio drugi igrač ili je to bilo zbog okoline
if (killerid != INVALID_PLAYER_ID)
{
// Ispraznjujemo killerName string postavljanjem prvog indeksa na EOS (Kraj stringa)
killerName[0] = EOS;
// Dobij ime ubice
GetPlayerName(killerid, killerName, sizeof(killerName));
}
// Pošaljite poruku javnom chatu da je X uzrokovao smrt Y, a razlog Z
format(string, sizeof(string), "%s (%i) je ubio %s (%i) koristeći %s.", killerName, killerid, playerName, playerid, weaponName);
SendClientMessageToAll(0xFFFFFFAA, string);
return 1;
}
```
## Srodne Funkcije
- [GetPlayerWeapon](GetPlayerWeapon): Provjeri koje oružje igrač trenutno drži.
- [AllowInteriorWeapons](AllowInteriorWeapons): Odredi da li oružja mogu da se koriste u enterijerima.
- [GivePlayerWeapon](GivePlayerWeapon): Daj igraču oružje.
| openmultiplayer/web/docs/translations/bs/scripting/functions/GetWeaponName.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/GetWeaponName.md",
"repo_id": "openmultiplayer",
"token_count": 937
} | 348 |
---
title: IsPlayerInCheckpoint
description: Provjerite je li igrač trenutno u checkpointu/markeru, ovo bi se moglo koristiti, na primjer, za svojstva ili teleport tačke.
tags: ["player", "checkpoint"]
---
## Deskripcija
Provjerite je li igrač trenutno u checkpointu/markeru, ovo bi se moglo koristiti, na primjer, za svojstva ili teleport tačke.
| Ime | Deskripcija |
| -------- | ----------------------------------- |
| playerid | Igrač za kojeg želite znati status. |
## Returns
false/lažno ako igrač nije u checkpointu/markeru, uostalom true/tačno
## Primjeri
```c
if (IsPlayerInCheckpoint(playerid))
{
SetPlayerHealth(playerid, 100.0);
}
```
## Srodne Funkcije
- [SetPlayerCheckpoint](SetPlayerCheckpoint): Kreiraj checkpoint za igrača.
- [DisablePlayerCheckpoint](DisablePlayerCheckpoint): Onemogući igračev trenutni checkpoint.
- [SetPlayerRaceCheckpoint](SetPlayerRaceCheckpoint): Kreiraj race checkpoint za igrača.
- [DisablePlayerRaceCheckpoint](DisablePlayerRaceCheckpoint): Onemogući igračev trenutni race checkpoint.
- [IsPlayerInRaceCheckpoint](IsPlayerInRaceCheckpoint): Provjeri da li je igrač u race checkpointu.
- [OnPlayerEnterCheckpoint](../callbacks/OnPlayerEnterCheckpoint): Pozvano kada igrač uđe u checkpoint.
- [OnPlayerLeaveCheckpoint](../callbacks/OnPlayerLeaveCheckpoint): Pozvano kada igrač napusti checkpoint.
- [OnPlayerEnterRaceCheckpoint](../callbacks/OnPlayerEnterRaceCheckpoint): Pozvano kada igrač uđe u race checkpoint.
- [OnPlayerLeaveRaceCheckpoint](../callbacks/OnPlayerLeaveRaceCheckpoint): Pozvano kada igrač napusti race checkpoint.
| openmultiplayer/web/docs/translations/bs/scripting/functions/IsPlayerInCheckpoint.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/IsPlayerInCheckpoint.md",
"repo_id": "openmultiplayer",
"token_count": 579
} | 349 |
---
title: KillTimer
description: Ubija (stopira) pokrenuti tajmer.
tags: []
---
## Deskripcija
Ubija (stopira) pokrenuti tajmer.
| Ime | Deskripcija |
| ------- | ------------------------------------------------------------------- |
| timerid | ID tajmera za ubiti (returnovan/vraćen od SetTimer ili SetTimerEx). |
## Returns
Ova funkcija uvijek returna/vraća 0.
## Primjeri
```c
new
gConnectTimer[MAX_PLAYERS] = {0, ...};
public OnPlayerConnect(playerid)
{
print("Starting timer...");
gConnectTimer[playerid] = SetTimerEx("WelcomeTimer", 5000, true, "i", playerid);
return 1;
}
public OnPlayerDisconnect(playerid)
{
KillTimer(gConnectTimer[playerid]);
gConnectTimer[playerid] = 0;
return 1;
}
forward WelcomeTimer(playerid);
public WelcomeTimer(playerid)
{
SendClientMessage(playerid, -1, "Welcome!");
}
```
## Srodne Funkcije
- [SetTimer](SetTimer): Postavi tajmer.
- [SetTimerEx](SetTimerEx): Postavi tajmer sa parametrima.
| openmultiplayer/web/docs/translations/bs/scripting/functions/KillTimer.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/KillTimer.md",
"repo_id": "openmultiplayer",
"token_count": 419
} | 350 |
---
title: PlayAudioStreamForPlayer
description: Reprodukujte 'audio stream' za igrač.
tags: ["player"]
---
## Deskripcija
Reprodukujte 'audio stream' za igrač. Uobičajene audio datoteke takođe rade (npr. MP3).
| Ime | Deskripcija |
| -------------- | -------------------------------------------------------------------------------------------------------------------- |
| playerid | ID igrača za puštanje audio streama. |
| url[] | URL za reprodukovati. Važeći formati su mp3 i ogg/vorbis. Veza do datoteke .pls (playlist) reproducirat će tu listu. |
| Float:PosX | X pozicija na kojoj će se pustiti zvuk. Zadano 0.0. Nema efekta sve dok se usepos ne stavi na 1. |
| Float:PosY | Y pozicija na kojoj će se pustiti zvuk. Zadano 0.0. Nema efekta sve dok se usepos ne stavi na 1. |
| Float:PosZ | Z pozicija na kojoj će se pustiti zvuk. Zadano 0.0. Nema efekta sve dok se usepos ne stavi na 1. |
| Float:distance | Udaljenost na kojoj će se zvuk čuti. Nema efekta sve dok se usepos ne stavi na 1. |
| usepos | Koristite navedene položaje i udaljenost. Zadano onemogućeno (0). |
## Returns
1: Funkcija uspješno izvršena.
0: Funkcija neuspješno izvršena. Navedeni igrač ne postoji.
## Primjeri
```c
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/radio", cmdtext, true) == 0)
{
PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls");
return 1;
}
if (strcmp("/radiopos", cmdtext, true) == 0)
{
new Float:X, Float:Y, Float:Z, Float:Distance = 5.0;
GetPlayerPos(playerid, X, Y, Z);
PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls", X, Y, Z, Distance, 1);
return 1;
}
return 0;
}
```
## Srodne Funkcije
- [StopAudioStreamForPlayer](StopAudioStreamForPlayer): Zaustavi reprodukovanje audio stream-a za igrača.
- [PlayerPlaySound](PlayerPlaySound): Reprodukujte zvuk za igrača.
| openmultiplayer/web/docs/translations/bs/scripting/functions/PlayAudioStreamForPlayer.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/PlayAudioStreamForPlayer.md",
"repo_id": "openmultiplayer",
"token_count": 1163
} | 351 |
---
title: PlayerTextDrawSetPreviewVehCol
description: Postavlja boju vozila prikaza modela u player-textdrawu (ako je prikazano vozilo).
tags: ["player", "textdraw", "playertextdraw"]
---
## Deskripcija
Postavlja boju vozila prikaza modela u player-textdrawu (ako je prikazano vozilo).
| Ime | Deskripcija |
| -------- | ------------------------------------------------ |
| playerid | ID igrača čiji player-textdraw treba izmijeniti. |
| text | ID igračevog player-textdrawaza izmijeniti. |
| color1 | Boja za postaviti primarnu boju vozila. |
| color2 | Boja za postaviti sekundarnu boju vozila. |
## Returns
Ova funkcija ne returna (vraća) nikakve posebne vrijednosti.
## Zabilješke
:::warning
Textdraw MORA koristiti font TEXT_DRAW_FONT_MODEL_PREVIEW i prikazivati vozilo kako bi ova funkcija imala efekta.
:::
## Srodne Funkcije
- [PlayerTextDrawSetPreviewModel](PlayerTextDrawSetPreviewModel): Postavlja ID modela 3D prikaza u player-textdrawu.
- [PlayerTextDrawSetPreviewRot](PlayerTextDrawSetPreviewRot): Postavlja rotaciju 3D prikaza u player-textdrawu.
- [PlayerTextDrawFont](PlayerTextDrawFont): Postavi font player-textdrawa.
- [OnPlayerClickPlayerTextDraw](../callbacks/OnPlayerClickPlayerTextDraw): Pozvano kada igrač klikne na player-textdraw.
| openmultiplayer/web/docs/translations/bs/scripting/functions/PlayerTextDrawSetPreviewVehCol.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/PlayerTextDrawSetPreviewVehCol.md",
"repo_id": "openmultiplayer",
"token_count": 534
} | 352 |
---
title: ResetPlayerMoney
description: Resetiraj igračev novac na $0.
tags: ["player"]
---
## Deskripcija
Resetiraj igračev novac na $0.
| Ime | Deskripcija |
| -------- | ------------------------------ |
| playerid | ID igrača za resetovati novac. |
## Returns
1: Funkcija uspješno izvršena.
0: Funkcija neuspješno izvršena. Ovo znači da igrač nije konektovan.
## Primjeri
```c
public OnPlayerDeath(playerid, killerid, WEAPON:reason)
{
SendClientMessage(playerid, 0xFFFFFFAA, "Umro si i izgubio si sav svoj novac!");
ResetPlayerMoney(playerid);
return 1;
}
```
## Srodne Funkcije
- [GetPlayerMoney](GetPlayerMoney): Provjeri koliko novca igrač ima.
- [GivePlayerMoney](GivePlayerMoney): Dajte igraču novac.
| openmultiplayer/web/docs/translations/bs/scripting/functions/ResetPlayerMoney.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/ResetPlayerMoney.md",
"repo_id": "openmultiplayer",
"token_count": 326
} | 353 |
---
title: SetActorVirtualWorld
description: Postavi virtualni svijet za aktora.
tags: []
---
:::warning
Ova funkcija je dodana u SA-MP 0.3.7 i ne radi u nižim verzijama!
:::
## Deskripcija
Postavi virtualni svijet za aktora. Samo igrači u istom virtualnom svijetu će ga vidjeti.
| Ime | Deskripcija |
| ------- | --------------------------------------------------------------------------- |
| actorid | ID aktora (returnovan/vraćen od CreateActor) za postaviti virtualni svijet. |
| vworld | Virtualni svijet za ubaciti aktora. |
## Returns
1: Funkcija uspješno izvršena.
0: Funkcija neuspješno izvršena. Navedeni aktor ne postoji.
## Primjeri
```c
new gMyActor;
public OnGameModeInit()
{
// Kreiraj aktora
gMyActor = CreateActor(69, 0.0, 0.0, 3.0, 0.0);
// Postavi mu virtualni svijet
SetActorVirtualWorld(gMyActor, 69);
return 1;
}
```
## Srodne Funkcije
- [GetActorVirtualWorld](GetActorVirtualWorld): Dobij virtualni svijet aktora.
- [CreateActor](CreateActor): Kreiraj aktora (statičnog NPC-a).
| openmultiplayer/web/docs/translations/bs/scripting/functions/SetActorVirtualWorld.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/SetActorVirtualWorld.md",
"repo_id": "openmultiplayer",
"token_count": 513
} | 354 |
---
title: SetPVarString
description: Čuva string player (igračevu) varijablu.
tags: ["pvar"]
---
## Deskripcija
Čuva string player (igračevu) varijablu.
| Ime | Deskripcija |
| ------------ | ---------------------------------------------------- |
| playerid | ID igrača čija će player varijabla biti postavljena. |
| varname | Ime player varijable. |
| string_value | String kojeg želite sačuvati u player varijablu. |
## Returns
Ova funkcija ne returna (vraća) nikakve posebne vrijednosti.
## Primjeri
```c
public OnPlayerConnect(playerid)
{
new h,m,s,str[50];
gettime(h,m,s); // Dobij vrijeme
format(str,50,"Connected: %d:%d:%d",h,m,s); // kreiraj string sa povezanim vremenom
SetPVarString(playerid,"timeconnected",str); // sačuvaj string u varijablu igrača
return 1;
}
```
## Zabilješke
:::tip
Varijable se resetiraju tek nakon što se pozove OnPlayerDisconnect, tako da su vrijednosti i dalje dostupne u OnPlayerDisconnect.
:::
## Srodne Funkcije
- [SetPVarInt](SetPVarInt): Postavi cijeli broj za igračevu varijablu.
- [GetPVarInt](GetPVarInt): Dobij prethodno postavljeni cijeli broj iz igračeve varijable.
- [GetPVarString](GetPVarString): Dobij prethodno postavljeni string 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/SetPVarString.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/SetPVarString.md",
"repo_id": "openmultiplayer",
"token_count": 699
} | 355 |
---
title: SetPlayerMapIcon
description: Postavi ikonu/marker na mapu igrača.
tags: ["player"]
---
## Deskripcija
Postavi ikonu/marker na mapu igrača. Može se koristiti da označite lokacije kao npr. banke i bolnice igračima.
| Ime | Deskripcija |
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| playerid | ID igrača za postaviti ikonicu na mapu. |
| iconid | ID ikonice, od 0 do 99. Ovo znači da postoji maksimalno 100 map ikonica. ID se može koristiti u [RemovePlayerMapIcon](/docs/scripting/functions/RemovePlayerMapIcon). |
| Float:x | X kordinata za postaviti map ikonicu. |
| Float:y | Y kordinata za postaviti map ikonicu. |
| Float:z | Z kordinata za postaviti map ikonicu. |
| markertype | [Ikonica](/docs/scripting/resources/mapicons) za postaviti. |
| color | Boja ikonice, kao cijeli broj ili hex u RGBA formatu. Ovo bi se trebalo koristiti samo sa ikonicom kocke (ID: 0). |
| style | [Stil](/docs/scripting/resources/mapiconstyles) ikonice. |
## Returns
1: Funkcija uspješno izvršena.
0: Funkcija neuspješno izvršena. Igrač nije konektovan.
## Primjeri
```c
public OnPlayerConnect( playerid )
{
// Ovaj primjer demonstrira kako kreirati dollar-ikonicu na vrh locirane 24/7 trgovine
// u Las Venturasu. Na ovaj način novi igrači znaju gdje da odu sa svojim novcem!
SetPlayerMapIcon(playerid, 12, 2204.9468, 1986.2877, 16.7380, 52, 0, MAPICON_LOCAL);
}
```
## Zabilješke
:::tip
Ako koristite nevažeći tip markera, stvorit će se ID 1 (Bijeli kvadrat). Ako koristite ID ikone koji se već koristi, on će zamijeniti trenutnu ikonu karte pomoću tog ID-a.
:::
:::warning
Možete imati samo 100 ikona mapa! Oznake tipa 1 (), 2 (), 4 () i 56 () uzrokovat će pad vaše igre ako ste tijekom pregledavanja karte omogućili legende karte.
:::
## Srodne Funkcije
- [RemovePlayerMapIcon](/docs/scripting/functions/RemovePlayerMapIcon): Ukloni ikonicu na mapi za igrača.
- [SetPlayerMarkerForPlayer](/docs/scripting/functions/SetPlayerMarkerForPlayer): Postavite marker/oznaku igrača.
| openmultiplayer/web/docs/translations/bs/scripting/functions/SetPlayerMapIcon.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/SetPlayerMapIcon.md",
"repo_id": "openmultiplayer",
"token_count": 1815
} | 356 |
---
title: SetPlayerSpecialAction
description: Ova funkcija dozvoljava da postavite igraču specijalnu akciju.
tags: ["player"]
---
## Deskripcija
Ova funkcija dozvoljava da postavite igraču specijalnu akciju.
| Ime | Deskripcija |
| -------- | ------------------------------------------------------------ |
| playerid | Igrač koji će vršiti specijalnu akciju. |
| actionid | [Akcija](../resources/specialactions) koja će biti izvedena. |
## Returns
1: Funkcija uspješno izvršena.
0: Funkcija neuspješno izvršena. Ovo znači da igrač nije konektovan.
## Primjeri
```c
if (strcmp(cmd, "/handsup", true) == 0)
{
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_HANDSUP);
return 1;
}
```
## Zabilješke
:::tip
Uklanjanjem jetpacks-a s igrača postavljanjem njihove posebne akcije na 0 zvuk ostaje do smrti.
:::
## Srodne Funkcije
- [GetPlayerSpecialAction](GetPlayerSpecialAction): Dobij igračevu trenutnu specijalnu akciju.
- [ApplyAnimation](ApplyAnimation): Primijeni animaciju na igrača.
| openmultiplayer/web/docs/translations/bs/scripting/functions/SetPlayerSpecialAction.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/SetPlayerSpecialAction.md",
"repo_id": "openmultiplayer",
"token_count": 479
} | 357 |
---
title: SetVehicleHealth
description: Postavlja helte (zdravlje/health) vozila.
tags: ["vehicle"]
---
## Deskripcija
Postavlja helte (zdravlje/health) vozila. Kada se health stanje vozila smanji, motor će stvoriti dim, a na kraju i vatru kada padne na manje od 250 (25%).
| Ime | Deskripcija |
| ------------ | -------------------------------------- |
| vehicleid | ID vozila za postaviti stanje healtha. |
| Float:health | Health, dat kao float vrijednost. |
## Returns
1: Funkcija uspješno izvršena.
0: Funkcija neuspješno izvršena. Ovo znači da vozilo ne postoji.
## Primjeri
```c
if (strcmp("/fixengine", cmdtext, true) == 0)
{
new
vehicleid = GetPlayerVehicleID(playerid);
SetVehicleHealth(vehicleid, 1000);
SendClientMessage(playerid, COLOUR_WHITE, "Motor vozila je u potpunosti popravljen.");
return 1;
}
```
## Zabilješke
:::tip
Ukupan health vozila je 1000. Veće vrijednosti su moguće. Za više informacija o vrijednostima healtha, pogledaj [ovu](../resources/vehiclehealth) stranicu.
:::
## Srodne Funkcije
- [GetVehicleHealth](GetVehicleHealth): Provjeri helte vozila.
- [RepairVehicle](RepairVehicle): U potpunosti popravite vozilo.
- [SetPlayerHealth](SetPlayerHealth): Postavlja igraču helte.
- [OnVehicleDeath](../callbacks/OnVehicleDeath): Pozvano kada vozilo biva uništeno.
| openmultiplayer/web/docs/translations/bs/scripting/functions/SetVehicleHealth.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/SetVehicleHealth.md",
"repo_id": "openmultiplayer",
"token_count": 582
} | 358 |
---
title: ShowPlayerDialog
description: Prikazuje igraču za sinkroni (samo jedan po jedan) dijaloški box.
tags: ["player"]
---
## Deskripcija
Prikazuje igraču za sinkroni (samo jedan po jedan) dijaloški box.
| Ime | Deskripcija |
| --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| playerid | ID igrača za prikazati dijalog. |
| dialogid | ID kojem treba dodijeliti ovaj dijalog, tako da se odgovori mogu obraditi. Maksimalni dialogid je 32767. Upotreba negativnih vrijednosti zatvorit će svaki otvoreni dijalog. |
| style | [Stil](../resources/dialogstyles) dijaloga. |
| caption[] | Naslov na vrhu dijaloga. Dužina opisa ne može premašiti više od 64 znaka prije nego što se počne odsjeći. |
| info[] | Tekst za prikaz u glavnom dijaloškom okviru. Koristite \n za započinjanje novog retka i \t za tabeliranje. |
| button1[] | Tekst na lijevom dugmetu. |
| button2[] | Tekst na desnom dugmetu. Ostavite ga praznog ( "" ) da ga sakrijete. |
## Returns
1: Funkcija uspješno izvršena.
0: Funkcija neuspješno izvršena. Ovo znači da igrač nije konektovan.
## Primjeri
```c
// Definiraj ID-eve dijaloga sa enumom
enum
{
DIALOG_NULL,
DIALOG_LOGIN,
DIALOG_WELCOME,
DIALOG_WEAPONS
}
// Alternativno, koristi macros:
#define DIALOG_NULL 0
#define DIALOG_LOGIN 1
#define DIALOG_WELCOME 2
#define DIALOG_WEAPONS 3
// Enums su preporučljivi, jer ne morate pratiti korištene ID-ove. Međutim, enumi koriste memoriju za pohranjivanje definicija, dok se definicije obrađuju u fazi 'pretprocesora' (kompajliranja).
// Primjer za DIALOG_STYLE_MSGBOX:
ShowPlayerDialog(playerid, DIALOG_WELCOME, DIALOG_STYLE_MSGBOX, "Notice", "Konektovan si na server", "Close", "");
// Primjer za DIALOG_STYLE_INPUT:
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login", "Unesite svoju lozinku ispod:", "Login", "Cancel");
// Primjer za DIALOG_STYLE_LIST:
ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Oruzja", "AK47\nM4\nSniper Rifle", "Option 1", "Option 2");
// Primjer za DIALOG_STYLE_PASSWORD:
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "Unesite svoju lozinku ispod:", "Login", "Cancel");
// Primjer za DIALOG_STYLE_TABLIST:
ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_TABLIST, "Kupi oruzje", "Deagle\t$5000\t100\nSawnoff\t$5000\t100\nPistol\t$1000\t50", "Select", "Cancel");
// Example for DIALOG_STYLE_TABLIST_HEADERS:
ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_TABLIST_HEADERS, "Kupi oruzje", "Weapon\tPrice\tAmmo\nDeagle\t$5000\t100\nSawnoff\t$5000\t100\nPistol\t$1000\t50", "Select", "Cancel");
```
## Zabilješke
:::tip
Preporučuje se upotreba enuma (vidi gore) ili definicija (#define) da bi se utvrdilo koji ID dijalozi imaju, kako bi se izbjegla zabuna u budućnosti. Nikada ne biste trebali koristiti doslovne brojeve za ID-ove - postaje zbunjujuće.
:::
:::tip
Koristite ugrađivanje boja za više boja u tekstu. Korišćenje -1 kao dijalogida zatvara sve dijaloge koji su trenutno prikazani na ekranu klijenta.
:::
## Srodne Funkcije
- [TextDrawShowForPlayer](TextDrawShowForPlayer): Prikaži textdraw za određenog igrača.
- [OnDialogResponse](../callbacks/OnDialogResponse): Pozvano kada igrač odgovori na dijalog.
| openmultiplayer/web/docs/translations/bs/scripting/functions/ShowPlayerDialog.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/ShowPlayerDialog.md",
"repo_id": "openmultiplayer",
"token_count": 2268
} | 359 |
---
title: TextDrawFont
description: Mijenja font teksta.
tags: ["textdraw"]
---
## Deskripcija
Mijenja font teksta.
| Ime | Deskripcija |
| ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| text | Textdraw za izmijeniti. |
| font | Postoje četiri stila fonrova koji su prikazani dole. Font vrijednosti 4 precizira da je to txd sprite; 5 precizira da je ovo textdraw koji može prikazati pregled modela. Vrijednost fonta veća od 5 se neće prikazati, a sve više od 16 će crashovati klijent. |
Dostupni stilovi:

Dostupni fontovi:

## Returns
Ova funkcija ne returna (vraća) nikakve posebne vrijednosti.
## Primjeri
```c
new Text: gMyTextdraw;
public OnGameModeInit()
{
gMyTextdraw = TextDrawCreate(320.0, 425.0, "Ovo je primjer textdrawa");
TextDrawFont(gMyTextdraw, 2);
return 1;
}
```
## Zabilješke
:::tip
Ukoliko želite promijeniti font textdrawa koji je već prikazan, ne morate ga ponovno kreirati. Prosto koristite TextDrawShowForPlayer/TextDrawShowForAll nakon uređivanja i promjena će biti vidljiva.
:::
## Srodne Funkcije
- [TextDrawCreate](TextDrawCreate): Kreiraj textdraw.
- [TextDrawDestroy](TextDrawDestroy): Uništi textdraw.
- [TextDrawColor](TextDrawColor): Postavi boju teksta u textdrawu.
- [TextDrawBoxColor](TextDrawBoxColor): Postavi boju boxa u textdrawu.
- [TextDrawBackgroundColor](TextDrawBackgroundColor): Postavi boju pozadine textdrawa.
- [TextDrawAlignment](TextDrawAlignment): Postavi poravnanje 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/TextDrawFont.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/TextDrawFont.md",
"repo_id": "openmultiplayer",
"token_count": 1466
} | 360 |
---
title: tickcount
description: Ova se funkcija može koristiti kao zamjena za GetTickCount, jer vraća broj milisekundi od pokretanja poslužitelja.
tags: []
---
:::warning
Ova funkcija započinje malim slovom.
:::
## Deskripcija
Ova se funkcija može koristiti kao zamjena za GetTickCount, jer vraća broj milisekundi od pokretanja poslužitelja.
| Ime | Deskripcija |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| &granularity=0 | Po povratku, ova vrijednost sadrži broj otkucaja koje će unutarnje sistemsko vrijeme otkucati u sekundi. Ova vrijednost stoga ukazuje na točnost povratne vrijednosti ove funkcije. |
## Returns
Broj milisekundi od pokretanja sistema. Za 32-bitnu ćeliju ovaj broj preplavljuje nakon približno 24 dana neprekidnog rada.
## Srodne Funkcije
- [GetTickCount](GetTickCount): Nabavite vrijeme rada stvarnog servera.
| openmultiplayer/web/docs/translations/bs/scripting/functions/Tickcount.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/Tickcount.md",
"repo_id": "openmultiplayer",
"token_count": 558
} | 361 |
---
title: db_query
description: Funkcija se koristi za izvršavanje SQL upita na otvorenoj bazi podataka SQLite.
keywords:
- sqlite
---
:::warning
Ova funkcija započinje malim slovom.
:::
## Deskripcija
Funkcija se koristi za izvršavanje SQL upita na otvorenoj bazi podataka SQLite.
| Ime | Deskripcija |
| ------- | ------------------------------ |
| DB:db | Upravitelj databaze do querya. |
| query[] | Query za izvršavanje. |
## Returns
Indeks rezultata querya (počinje sa 1) ako je uspješno, uostalom 0.
## Primjeri
```c
// entity_storage.inc
EntityStorage_SpawnAll(DB:connectionHandle)
{
// Select all entries in table "entities"
new DBResult:db_result_set = db_query(db_handle, "SELECT * FROM `entities`");
// Ako je upravitelj skupa rezultata baze podataka važeći
if (db_result_set)
{
// Radi nešto...
// Oslobodimo set rezultata
db_free_result(db_result_set);
}
}
```
```c
// mode.pwn
#include <entity_storage>
static DB:gDBConnectionHandle;
// ...
public OnGameModeInit()
{
// ...
// Kreiramo konekciju za databazu
gDBConnectionHandle = db_open("example.db");
// Ako konekcija za databazu postoji
if (gDBConnectionHandle)
{
// Uspješno kreirana konekcija do databaze
print("Uspješno stvorena veza s bazom podataka \"example.db\".");
EntityStorage_SpawnAll();
}
else
{
// Neuspješno kreirana konekcija do databaze
print("Otvaranje veze s bazom podataka nije uspjelo \"example.db\".");
}
// ...
return 1;
}
public OnGameModeExit()
{
// Zatvori konekciju sa databazom ako je otvorena
if (db_close(gDBConnectionHandle))
{
// Dodatno čišćenje
gDBConnectionHandle = DB:0;
}
// ...
return 1;
}
```
## Zabilješke
:::warning
Uvijek oslobađajte setove rezultata sa [db_free_result](db_free_result)!
:::
## Srodne Funkcije
- [db_open](db_open): Otvori konekciju do SQLite databaze.
- [db_close](b_close): Zatvori konekciju do SQLite databaze.
- [db_free_result](db_free_result): Oslobodite memoriju rezultata iz db_query.
- [db_num_rows](db_num_rows): Dobijte broj redaka u rezultatu.
- [db_next_row](db_next_row): Pređi na sljedeći red.
- [db_num_fields](db_num_fields): Dobij broj polja u rezultatu.
- [db_field_name](db_field_name): Return/vraća ime polja na posebnom indexu.
- [db_get_field](db_get_field): Preuzmite sadržaj polja iz db_query.
- [db_get_field_assoc](db_get_field_assoc): Dobij sadržaj polja kao string s navedenim imenom polja.
- [db_get_field_int](db_get_field_int): Dobijte sadržaj polja kao cijeli broj iz db_query.
- [db_get_field_assoc_int](db_get_field_assoc_int): Dobijte sadržaj polja kao cijeli broj s navedenim imenom iz trenutnog reda rezultata.
- [db_get_field_float](db_get_field_float): Dobijte sadržaj polja kao float broj s navedenim imenom iz trenutnog reda rezultata.
- [db_get_field_assoc_float](db_get_field_assoc_float): Dobij sadržaj polja kao float broj s navedenim imenom polja.
- [db_get_mem_handle](db_get_mem_handle): Dobij memorijski upravitelj za vezu SQLite databaze koja je otvorena s `db_open`.
- [db_get_result_mem_handle](db_get_result_mem_handle): Dobiva memorijski upravitelj za vezu SQLite databaze koja je dodijeljena sa s `db_query`.
- [db_debug_openfiles](db_debug_openfiles): Dobiva broj otvorenih konekcija/veza databaza u svrhu otklanjanja pogrešaka.
- [db_debug_openresults](db_debug_openresults): Dobiva broj rezultata otvorene databaze.
| openmultiplayer/web/docs/translations/bs/scripting/functions/db_query.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/db_query.md",
"repo_id": "openmultiplayer",
"token_count": 1597
} | 362 |
---
title: floatlog
description: Ova funkcija vam omogućuje da dobijete logaritam float vrijednosti.
tags: []
---
:::warning
Ova funkcija započinje malim slovom.
:::
## Deskripcija
Ova funkcija vam omogućuje da dobijete logaritam float vrijednosti.
| Ime | Deskripcija |
| ----------- | --------------------------------------- |
| Float:value | Vrijednost koje treba dobiti logaritam. |
| Float:base | Baza logaritma. |
## Returns
Logaritam kao float vrijednost.
## Primjeri
```c
public OnGameModeInit()
{
printf("Logaritam 15,0 sa osnovom 10,0 je %f", floatlog( 15.0, 10.0 ));
return 1;
}
```
## Srodne Funkcije
- [floatsqroot](floatsqroot): Izračunajte kvadratni korijen float vrijednosti.
- [floatpower](floatpower): Povećava zadanu vrijednost u stepen eksponenta.
| openmultiplayer/web/docs/translations/bs/scripting/functions/floatlog.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/floatlog.md",
"repo_id": "openmultiplayer",
"token_count": 400
} | 363 |
---
title: ftemp
description: Stvara datoteku u "tmp", "temp" ili root direktorijumu sa slučajnim imenom za čitanje i pisanje.
tags: []
---
:::warning
Ova funkcija započinje malim slovom.
:::
## Deskripcija
Stvara datoteku u "tmp", "temp" ili root direktorijumu sa slučajnim imenom za čitanje i pisanje. Datoteka se briše nakon upotrebe fclose() na datoteci.
## Primjeri
```c
// Stvorite privremeni tok datoteka
new File:t_handle = ftemp(),
// Deklariši "handle"
File:handle,
// Deklariši "g_char"
g_char;
// Provjerite je li otvoren privremeni tok datoteka
if (t_handle)
{
// Uspješno
// Otvori "file.txt" u "read only" modu (samo čitanje) and check, if the file is open
if (handle = fopen("file.txt", io_read))
{
// Preuzmi sve znakove iz "file.txt"
while((g_char = fgetchar(handle, 0, false)) != EOF)
{
// Zapišite znak malim slovima u privremeni tok datoteka
fputchar(t_handle, tolower(g_char), false);
}
// Zatvori "file.txt"
fclose(handle);
// Postavite pokazivač datoteke privremenog toka datoteka na prvi bajt
fseek(t_handle, _, seek_begin);
// Otvorite "file1.txt" u "write only" načinu (samo napiši) i provjerite je li datoteka otvorena
if (handle = fopen("file1.txt", io_write))
{
// Uspješno
// Preuzmite sve znakove iz privremenog toka datoteka
while((g_char = fgetchar(t_handle, 0, false)) != EOF)
{
// Zapiši znak u "file1.txt"
fputchar(handle, g_char, false);
}
// Close "file1.txt"
fclose(handle);
// Postavite pokazivač datoteke privremenog toka datoteka na prvi bajt
fseek(t_handle, _, seek_begin);
}
else
{
// Error
print("Nesupješno otvaranje file \"file1.txt\".");
}
// Otvorite "file2.txt" u načinu "samo napiši" i provjerite je li datoteka otvorena
if (handle = fopen("file2.txt", io_write))
{
// Uspješno
// Preuzmite sve znakove iz privremenog toka datoteka
while((g_char = fgetchar(t_handle, 0, false)) != EOF)
{
// Napišite karakter u "file2.txt"
fputchar(handle, g_char, false);
}
// Close "file2.txt"
fclose(handle);
}
else
{
// Error
print("Nesupješno otvaranje file \"file2.txt\".");
}
}
else
{
// Error
print("Nesupješno otvaranje file \"file.txt\".");
}
// Zatvorite privremeni tok datoteka
fclose(t_handle);
}
else
{
// Error
print("Stvaranje privremenog toka datoteka nije uspjelo.");
}
```
## Zabilješke
:::warning
Ova funkcija može srušiti poslužitelj kada nije kreiran pravi direktorij.
:::
## 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/ftemp.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/ftemp.md",
"repo_id": "openmultiplayer",
"token_count": 1926
} | 364 |
---
title: print
description: Ispisuje formatirani niz na konzoli (ne chat u igri) i logovima (server_log.txt).
tags: []
---
:::warning
Ova funkcija započinje malim slovom.
:::
## Deskripcija
Ispisuje formatirani niz na konzoli (ne chat u igri) i logovima (server_log.txt).
| Ime | Deskripcija |
| --------------------- | ----------------------------------- |
| string[] | String za ispisati. |
| foreground (optional) | Boja u prvom planu koja se koristi. |
| background (optional) | Pozadinska boja koja se koristi. |
| highlight (optional) | Istaknuta boja za upotrebu. |
## Returns
Ova funkcija ne returna (vraća) nikakve posebne vrijednosti.
:::tip
Kad kodovi boja ostanu -1, koriste se zadane boje poslužiteljske konzole.
:::
:::tip
Na većini sistema mogu se koristiti sljedeći kodovi boja u prvom planu i pozadini: crna (0), crvena (1), zelena (2), žuta (3), plava (4), magenta (5), cijan (6) i bijela (7).
:::
:::tip
Većina sistema takođe podržava jarke / podebljane verzije ovih boja. Mogu se koristiti sljedeće istaknute vrijednosti: uobičajena (0) i svijetla/podebljana (1).
:::
## Primjeri
```c
public OnGameModeInit( )
{
print("Gamemode se pokrenuo.");
return 1;
}
```
## Srodne Funkcije
- [printf](printf): Ispišite formatiranu poruku u zapise poslužitelja i konzolu.
| openmultiplayer/web/docs/translations/bs/scripting/functions/print.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/print.md",
"repo_id": "openmultiplayer",
"token_count": 654
} | 365 |
---
title: strval
description: Pretvori string u cijeli broj.
tags: []
---
:::warning
Ova funkcija započinje malim slovom.
:::
## Deskripcija
Pretvori string u cijeli broj.
| Ime | Deskripcija |
| -------------- | --------------------------------------------- |
| const string[] | String kojeg želite pretvoriti u cijeli broj. |
## Returns
Cjelobrojna vrijednost stringa. '0 ako string nije numerički.
## Primjeri
```c
new string[4] = "250";
new iValue = strval(string); // iValue je sada '250'
```
## 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.
- [strcat](strcat): Spojite dva stringa u odredišnu referencu.
| openmultiplayer/web/docs/translations/bs/scripting/functions/strval.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/bs/scripting/functions/strval.md",
"repo_id": "openmultiplayer",
"token_count": 431
} | 366 |
---
title: Vrste Zapisa
description: Vrste Zapisa korištene od StartRecordingPlayerData.
tags: ["player"]
sidebar_label: Vrste Zapisa
---
:::info
Ovdje možete pronaći sve vrste zapisa koje koristi [StartRecordingPlayerData](../functions/StartRecordingPlayerData).
:::
| Vrijednost | Definicija |
| ---------- | ---------------------------- |
| 0 | PLAYER_RECORDING_TYPE_NONE |
| 1 | PLAYER_RECORDING_TYPE_DRIVER |
| 2 | PLAYER_RECORDING_TYPE_ONFOOT |
| openmultiplayer/web/docs/translations/bs/scripting/resources/recordtypes.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/bs/scripting/resources/recordtypes.md",
"repo_id": "openmultiplayer",
"token_count": 221
} | 367 |
---
title: AddPlayerClassEx
description: Fügt eine Klasse zur Klassen-Auswahl(class-selection) hinzu. Genau wie "AddPlayerClass" nur mit einem team Parameter.
tags: ["player"]
---
## Beschreibung
Fügt eine Klasse zur Klassen-Auswahl(class-selection) hinzu. Genau wie "AddPlayerClass" nur mit einem team Parameter.
| Name | Beschreibung |
| ------------- | ----------------------------------------------------------- |
| teamid | Das Tean dem der Spieler angehört. |
| modelid | Der Skin(SkinID) mit dem der Spieler spawnt. |
| Float:spawn_x | Die X Koordinate des Spawnpunkts der Klasse. |
| Float:spawn_y | Die Y Koordinate des Spawnpunkts der Klasse. |
| Float:spawn_z | Die Z Koordinate des Spawnpunkts der Klasse. |
| Float:z_angle | Die Blickrichtung des Spawnpunktes. |
| weapon1 | Die erste Spawn-Waffe des Spielers. |
| weapon1_ammo | Die Menge der Munition der ersten Waffe. |
| weapon2 | Die zweite Spawn-Waffe des Spielers. |
| weapon2_ammo | Die Menge der Munition der zweiten Waffe. |
| weapon3 | Die dritte Spawn-Waffe des Spielers. |
| weapon3_ammo | Die Menge der Munition der dritten Waffe. |
## Rückgabe(return value)
Die ID der Klasse die erstellt wurde.
319 wenn das Class-Limit (320) erreicht ist. Höchstmögliche Class ID: 319.
## Beispiele
```c
public OnGameModeInit()
{
// Spieler können wie folgt spawnen:
// CJ Skin (ID 0) in Team 1.
// The Truth skin (ID 1) in 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;
}
```
## Anmerkungen
:::tip
Die maximale Class ID ist 319 (Start bei 0, also insgesamt 320 Klassen). Wenn das Limit erreicht ist ersetzen alle weiteren Klassen die Klasse mit class ID 319.
:::
## Ähnliche Funktionen
- [AddPlayerClass](AddPlayerClass): Erstelle eine Klasse.
- [SetSpawnInfo](SetSpawnInfo): Setze die Spawneinstellungen eines Spielers.
- [SetPlayerTeam](SetPlayerTeam): Setze das Team eines Spielers.
- [SetPlayerSkin](SetPlayerSkin): Ändere den Skin eines Spielers.
| openmultiplayer/web/docs/translations/de/scripting/functions/AddPlayerClassEx.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/de/scripting/functions/AddPlayerClassEx.md",
"repo_id": "openmultiplayer",
"token_count": 1032
} | 368 |
---
título: OnEnterExitModShop
descripción: Este callback se llama cuando un jugador entra o sale de un taller de modificación.
tags: []
---
## Descripción
Este callback se llama cuando un jugador entra o sale de un taller de modificación.
| Nombre | Descripción |
| ---------- | ---------------------------------------------------------------------------- |
| playerid | El ID del jugador que entró o salió del taller de modificación. |
| enterexit | 1 si el jugador entró o 0 si salió. |
| interiorid | El ID del interior del taller al que el jugador entró (0 si salió). |
## Devoluciones
Siempre se llama primero en filterscripts.
## Ejemplos
```c
public OnEnterExitModShop(playerid, enterexit, interiorid)
{
if (enterexit == 0) // Si enterexit es 0, esto quiere decir que está saliendo del taller
{
SendClientMessage(playerid, COLOR_WHITE, "Buen auto! Pagás $100.");
GivePlayerMoney(playerid, -100);
}
return 1;
}
```
## Notas
:::warning
Bugs conocidos: Los jugadores colisionan cuando entran al mismo taller de modificación.
:::
## Funciones Relacionadas
- [AddVehicleComponent](../functions/AddVehicleComponent): Añadir un componente a un vehículo.
| openmultiplayer/web/docs/translations/es/scripting/callbacks/OnEnterExitModShop.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/es/scripting/callbacks/OnEnterExitModShop.md",
"repo_id": "openmultiplayer",
"token_count": 557
} | 369 |
---
título: OnPlayerEditAttachedObject
descripción: Este callback se llama cuando un jugador sale del modo edición de objetos adjuntos.
tags: ["player"]
---
## Descripción
Este callback se llama cuando un jugador sale del modo edición de objetos adjuntos.
| Nombre | Descripción |
|------------------------|---------------------------------------------------------|
| playerid | El ID del jugador que salió del modo de edición. |
| EDIT_RESPONSE:response | 0 si canceló o 1 si clickeó el ícono de guardar. |
| index | The index of the attached object (0-9) |
| modelid | El modelo del objeto adjunto que fue editado. |
| boneid | El hueso del objeto adjunto que fue editado. |
| Float:fOffsetX | La coordenada X para el objeto adjunto que fue editado. |
| Float:fOffsetY | La coordenada Y para el objeto adjunto que fue editado. |
| Float:fOffsetZ | La coordenada Z para el objeto adjunto que fue editado. |
| Float:fRotX | La rotación X para el objeto adjunto que fue editado. |
| Float:fRotY | La rotación Y para el objeto adjunto que fue editado. |
| Float:fRotZ | La rotación Z para el objeto adjunto que fue editado. |
| Float:fScaleX | La escala X para el objeto adjunto que fue editado. |
| Float:fScaleY | La escala Y para el objeto adjunto que fue editado. |
| Float:fScaleZ | La escala Z para el objeto adjunto que fue editado. |
## 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
enum attached_object_data
{
Float:ao_x,
Float:ao_y,
Float:ao_z,
Float:ao_rx,
Float:ao_ry,
Float:ao_rz,
Float:ao_sx,
Float:ao_sy,
Float:ao_sz
}
new ao[MAX_PLAYERS][MAX_PLAYER_ATTACHED_OBJECTS][attached_object_data];
// Los datos deberían ser guardados en el array anterior cuando objetos son adjuntados.
public OnPlayerEditAttachedObject(playerid, EDIT_RESPONSE:response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ)
{
if (response)
{
SendClientMessage(playerid, COLOR_GREEN, "Edición de objeto adjunto guardada.");
ao[playerid][index][ao_x] = fOffsetX;
ao[playerid][index][ao_y] = fOffsetY;
ao[playerid][index][ao_z] = fOffsetZ;
ao[playerid][index][ao_rx] = fRotX;
ao[playerid][index][ao_ry] = fRotY;
ao[playerid][index][ao_rz] = fRotZ;
ao[playerid][index][ao_sx] = fScaleX;
ao[playerid][index][ao_sy] = fScaleY;
ao[playerid][index][ao_sz] = fScaleZ;
}
else
{
SendClientMessage(playerid, COLOR_RED, "Edición de objeto adjunto no guardada.");
new i = index;
SetPlayerAttachedObject(playerid, index, modelid, boneid, ao[playerid][i][ao_x], ao[playerid][i][ao_y], ao[playerid][i][ao_z], ao[playerid][i][ao_rx], ao[playerid][i][ao_ry], ao[playerid][i][ao_rz], ao[playerid][i][ao_sx], ao[playerid][i][ao_sy], ao[playerid][i][ao_sz]);
}
return 1;
}
```
## Notas
:::warning
Las ediciones deberían descartarse si response fue '0' (cancelado). Esto debe hacerse almacenando los valores en un array ANTES de usar EditAttachedObject.
:::
## Funciones Relacionadas
- [EditAttachedObject](../functions/EditAttachedObject): Editar un objeto adjunto.
- [SetPlayerAttachedObject](../functions/SetPlayerAttachedObject): Adjuntar un objeto a un jugador.
| openmultiplayer/web/docs/translations/es/scripting/callbacks/OnPlayerEditAttachedObject.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/es/scripting/callbacks/OnPlayerEditAttachedObject.md",
"repo_id": "openmultiplayer",
"token_count": 1677
} | 370 |
---
título: OnPlayerRequestClass
descripción: Se llama cuando un jugador cambia de clase en la selección de clase (y cuando la selección de clase aparece por primera vez).
tags: ["player"]
---
## Descripción
Se llama cuando un jugador cambia de clase en la selección de clase (y cuando la selección de clase aparece por primera vez).
| Nombre | Descripción |
| -------- | ----------------------------------------------------------------------------- |
| playerid | El ID del jugador que cambió de clase. |
| classid | El ID de la clase actual que está siendo vista (devuelto por AddPlayerClass). |
## Devoluciones
Siempre se llama primero en filterscripts.
## Ejemplos
```c
public OnPlayerRequestClass(playerid,classid)
{
if (classid == 3 && !IsPlayerAdmin(playerid))
{
SendClientMessage(playerid, COLOR_RED, "Este skin es solo para administradores!");
return 0;
}
return 1;
}
```
## Notas
:::tip
Este callback también se llama cuando un jugador presiona F4.
:::
## Funciones Relacionadas
- [AddPlayerClass](../functions/AddPlayerClass): Añadir una clase.
| openmultiplayer/web/docs/translations/es/scripting/callbacks/OnPlayerRequestClass.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/es/scripting/callbacks/OnPlayerRequestClass.md",
"repo_id": "openmultiplayer",
"token_count": 499
} | 371 |
---
título: OnTrailerUpdate
descripción: Este callback se llama cuando un jugador envía una actualización de trailer.
tags: []
---
## Descripción
Este callback se llama cuando un jugador envía una actualización de trailer.
| Nombre | Descripción |
| --------- | -------------------------------------------------------- |
| playerid | El ID del jugador que envió la actualización de trailer. |
| vehicleid | El ID del trailer que está siendo actualizado. |
## 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 OnTrailerUpdate(playerid, vehicleid)
{
DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
return 0;
}
```
## Notas
:::warning
Este callback se llama muy frecuentemente por segundo por cada trailer. Deberías abstenerte de implementar cálculos intensivos o operaciones de escritura/lectura sobre archivos en este callback.
:::
## Funciones Relacionadas
- [GetVehicleTrailer](../functions/GetVehicleTrailer): Comprueba qué trailer está siendo tirado por un vehículo.
- [IsTrailerAttachedToVehicle](../functions/IsTrailerAttachedToVehicle): Comprueba si un trailer está adjunto a un vehículo.
- [AttachTrailerToVehicle](../functions/AttachTrailerToVehicle): Adjuntar un trailer a un vehículo.
- [DetachTrailerFromVehicle](../functions/DetachTrailerFromVehicle): Separar un trailer de un vehículo.
| openmultiplayer/web/docs/translations/es/scripting/callbacks/OnTrailerUpdate.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/es/scripting/callbacks/OnTrailerUpdate.md",
"repo_id": "openmultiplayer",
"token_count": 556
} | 372 |
---
title: OnIncomingConnection
description: This callback is called when an IP address attempts a connection to the server.
tags: []
---
## Description
Ang callback na ito ay itinatawag kapag mayroong IP address na nag-tatangkang kumonek sa server.
| Name | Description |
| ------------ | -------------------------------------------------- |
| playerid | Ang ID ng player na nagtatangkang kumonek |
| ip_address[] | Ang IP address ng player na nagtatangkang kumonek |
| port | Ang port ng tinangkang koneksyon |
## Returns
1 - Pipigilan ang ibang filterscripts na tanggapin itong callback.
0 - Ipinapahiwatig na ang callback na ito ay ipapasa sa ibang filterscript.
Ito ay palaging tinatawag una sa mga filterscripts.
## Mga Halimbawa
```c
public OnIncomingConnection(playerid, ip_address[], port)
{
printf("Koneksyon mula sa %i [IP/port: %s:%i]", playerid, ip_address, port);
return 1;
}
```
## Mga Kaugnay na Functions
- [BlockIpAddress](../functions/BlockIpAddress.md): I-Block ang isang IP address na kumonekta sa server sa ibinigay na oras.
- [UnBlockIpAddress](../functions/UnBlockIpAddress.md): I-unblock ang isang IP address na iblinock.
| openmultiplayer/web/docs/translations/fil/scripting/callbacks/OnIncomingConnection.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/fil/scripting/callbacks/OnIncomingConnection.md",
"repo_id": "openmultiplayer",
"token_count": 482
} | 373 |
---
title: OnPlayerDisconnect
description: This callback is called when a player disconnects from the server.
tags: ["player"]
---
## Deskripsyon
Ang callback na ito ay natatawag kapag ang player ay nag diskonekta mula sa server.
| Pangalan | Deskripsyon |
| ------------- | ---------------------------------------------------------- |
| playerid | Ang ID ng player na nag diskonekta |
| reason | Ang rason ng pag diskonekta. Tignan ang table sa baba |
## Returns
0 - Ay hindi hahayaan ang ibang filterscript na ma gamit ang callback na ito.
1 - Iniindika na ang callback na ito ay pwedeng ma-ipasa o magamit sa susunod the filterscript.
Lagi itong natatawag una sa mga filterscript.
## Mga Halimbawa
```c
public OnPlayerDisconnect(playerid, reason)
{
new
szString[64],
playerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
new szDisconnectReason[3][] =
{
"Timeout/Crash",
"Quit",
"Kick/Ban"
};
format(szString, sizeof szString, "%s left the server (%s).", playerName, szDisconnectReason[reason]);
SendClientMessageToAll(0xC4C4C4FF, szString);
return 1;
}
```
## Mga Dapat Unawain
:::tip
Ang ibang function ay maaaring di gumana ng maayos kapag ginamit sa callback na ito dahil ang player ay naka diskonekta na bago matatawag ang callback na ito. Dahil din dito, hindi mo magagamit ng buo ang mga importanteng functions na pangkuha ng impormasyon tulad ng `GetPlayerIp` at `GetPlayerPos`.
:::
## Mga Kaugnay na Functions
| openmultiplayer/web/docs/translations/fil/scripting/callbacks/OnPlayerDisconnect.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/fil/scripting/callbacks/OnPlayerDisconnect.md",
"repo_id": "openmultiplayer",
"token_count": 654
} | 374 |
---
title: AddStaticPickup
description: Ang function na ito ay nagdaragdag ng 'static' pickup sa laro.
tags: []
---
## Description
Ang function na ito ay nagdaragdag ng 'static' pickup sa laro. Sinusuportahan ng mga pickup na ito ang mga sandata, kalusugan, armor atbp., na may kakayahang gumana nang walang script ng mga ito (awtomatikong ibibigay ang mga armas/kalusugan/armor).
| Name | Description |
| ----------------------------------- | ----------------------------------------------------------------------------------- |
| [model](../resources/pickupids) | Ang modelo ng pickup. |
| [type](../resources/pickuptypes) | Ang uri ng pickup. Tinutukoy kung paano tumugon ang pickup kapag kinuha. |
| Float:X | Ang X coordinate para gawin ang pickup sa. |
| Float:Y | Ang Y coordinate para gawin ang pickup sa. |
| Float:Z | Ang Z coordinate para gawin ang pickup sa. |
| virtualworld | Ang virtual world ID para ilagay ang pickup na iyon. Gamitin ang -1 para ipakita ang pickup sa lahat ng mundo. |
## Returns
1 kung matagumpay na nagawa ang pickup.
0 kung nabigong gumawa.
## Examples
```c
public OnGameModeInit()
{
// Gumawa ng pickup para sa armor
AddStaticPickup(1242, 2, 1503.3359, 1432.3585, 10.1191, 0);
// Gumawa ng pickup para sa ilang kalusugan, sa tabi mismo ng armor
AddStaticPickup(1240, 2, 1506.3359, 1432.3585, 10.1191, 0);
return 1;
}
```
## Notes
:::tip
Ang function na ito ay hindi nagbabalik ng pickup ID na magagamit mo, halimbawa, OnPlayerPickUpPickup. Gamitin ang CreatePickup kung gusto mong magtalaga ng mga ID.
:::
## Related Functions
- [CreatePickup](CreatePickup): Gumawa ng pickup.
- [DestroyPickup](DestroyPickup): Sirain ang pickup.
- [OnPlayerPickUpPickup](../callbacks/OnPlayerPickUpPickup): Tinatawag kapag kinuha ng manlalaro ang isang pickup. | openmultiplayer/web/docs/translations/fil/scripting/functions/AddStaticPickup.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/fil/scripting/functions/AddStaticPickup.md",
"repo_id": "openmultiplayer",
"token_count": 1030
} | 375 |
---
title: BlockIpAddress
description: Bina-block ang isang IP address mula sa karagdagang komunikasyon sa server para sa isang nakatakdang tagal ng oras (na may pinapayagang mga wildcard).
tags: []
---
## Description
Bina-block ang isang IP address mula sa karagdagang komunikasyon sa server para sa isang nakatakdang tagal ng oras (na may pinapayagang mga wildcard). Ang mga manlalarong sumusubok na kumonekta sa server na may naka-block na IP address ay makakatanggap ng generic na "Ikaw ay pinagbawalan mula sa server na ito." mensahe. Ang mga manlalaro na online sa tinukoy na IP bago ang block ay mag-timeout pagkatapos ng ilang segundo at, kapag muling kumonekta, ay makakatanggap ng parehong mensahe.
| Name | Description |
| ---------- | ---------------------------------------------------------------------------------------------------------- |
| ip_address | Ang IP na i-bloblock |
| timems | Ang oras (sa millisecond) kung saan iba-block ang koneksyon. 0 ay maaaring gamitin para sa indefinite block|
## Returns
Ang function na ito ay hindi nagbabalik ng anumang value.
## Examples
```c
public OnRconLoginAttempt(ip[], password[], success)
{
if (!success) // kung nagbigay sila ng masamang password
{
BlockIpAddress(ip, 60 * 1000); // I-block ang mga koneksyon mula sa ip na ito sa loob ng isang minuto
}
return 1;
}
```
## Notes
:::tip
Maaaring gamitin ang mga wildcard sa function na ito, halimbawa, ang pagharang sa IP '6.9._._' ay haharangan ang lahat ng IP kung saan ang unang dalawang octet ay 6 at 9 ayon sa pagkakabanggit. Anumang numero ay maaaring maging kapalit ng isang asterisk.
:::
## Related Functions
- [UnBlockIpAddress](UnBlockIpAddress): I-unblock ang isang IP na dati nang na-block.
- [OnIncomingConnection](../callbacks/OnIncomingConnection): Tinatawag kapag sinusubukan ng isang manlalaro na kumonekta sa server. | openmultiplayer/web/docs/translations/fil/scripting/functions/BlockIpAddress.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/fil/scripting/functions/BlockIpAddress.md",
"repo_id": "openmultiplayer",
"token_count": 847
} | 376 |
---
title: GameModeExit
description: Tinatapos ang kasalukuyang gamemode.
tags: []
---
## Description
Tinatapos ang kasalukuyang gamemode.
## Examples
```c
if (OneTeamHasWon)
{
GameModeExit();
}
``` | openmultiplayer/web/docs/translations/fil/scripting/functions/GameModeExit.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/fil/scripting/functions/GameModeExit.md",
"repo_id": "openmultiplayer",
"token_count": 86
} | 377 |
---
title: SetActorHealth
description: I-set ang health ng isang actor.
tags: []
---
<VersionWarn version='SA-MP 0.3.7' />
## Description
I-set ang health ng isang actor.
| Name | Description |
| ------------ | ----------------------------------------- |
| actorid | Ang ID ng aktor na i-seset ang health |
| Float:health | Ang value na i-seset ang health ng aktor. |
## Returns
1 - tagumpay
0 - pagkabigo (ibig sabihin, hindi nilikha ang aktor).
## Examples
```c
new gMyActor;
public OnGameModeInit()
{
gMyActor = CreateActor(179, 316.1, -134.0, 999.6, 90.0); // Actor bilang salesperson sa Ammunation
SetActorHealth(gMyActor, 100);
return 1;
}
```
## Related Functions | openmultiplayer/web/docs/translations/fil/scripting/functions/SetActorHealth.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/fil/scripting/functions/SetActorHealth.md",
"repo_id": "openmultiplayer",
"token_count": 291
} | 378 |
---
title: acos
description: Kunin ang inverse value ng isang cosine sa degrees.
tags: ["math"]
---
<LowercaseNote />
## Description
Kunin ang inverse value ng isang cosine sa degrees. Sa trigonometriko, ang arc cosine ay ang kabaligtaran na operasyon ng cosine.
| Name | Description |
| ----------- | ------------------------------------------------------------ |
| Float:value | halaga na ang arc cosine ay nakalkula, sa pagitan [-1, +1]. |
## Returns
Ang anggulo sa degrees, sa pagitan [0.0,180.0].
## Examples
```c
//Ang arc cosine ng 0.500000 ay 60.000000 degrees.
public OnGameModeInit()
{
new Float:param, Float:result;
param = 0.5;
result = acos(param);
printf("The arc cosine of %f is %f degrees.", param, result);
return 1;
}
```
## Related Functions
- [floatsin](floatsin): Kunin ang sine mula sa isang tiyak na anggulo.
- [floatcos](floatcos): Kunin ang cosine mula sa isang tiyak na anggulo.
- [floattan](floattan): Kunin ang tangent mula sa isang tiyak na anggulo.
- [asin](asin): Kunin ang kabaligtaran na halaga ng isang sine sa mga degree.
- [atan](atan): Kunin ang kabaligtaran na halaga ng isang tangent sa mga degree.
- [atan2](atan2): Kunin ang multi-valued inversed value ng isang tangent sa degrees.
| openmultiplayer/web/docs/translations/fil/scripting/functions/acos.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/fil/scripting/functions/acos.md",
"repo_id": "openmultiplayer",
"token_count": 488
} | 379 |
---
title: OnGameModeExit
description: Cette callback est appelée quand le gamemode s'éteint.
tags: [gamemode, éteint, exit, ended]
---
## Description
Cette callback est appelée quand le gamemode s'éteint.
## Exemple
```c
public OnGameModeExit()
{
print("Gamemode éteint.");
return 1;
}
```
## Astuce
:::tip
Cette fonction peut également être utilisée dans un filterscript pour détecter si le gamemode change avec les commandes RCON comme changemode ou gmx, car le changement de gamemode ne recharge pas un filterscript. Lorsque vous utilisez OnGameModeExit en conjonction avec la commande de console 'rcon gmx', gardez à l'esprit qu'il y a un risque que des bugs se produisent, par exemple avec les callbacks RemoveBuildingForPlayer excessifs pendant OnGameModeInit qui pourraient faire crash le joueur. Cette callback ne sera PAS appelée si le serveur crash ou si le processus est fermé par d'autres moyens, par exemple en appuyant sur le bouton de fermeture de la console Windows.
:::
## Callback connexe
- [OnGameModeInit](OnGameModeInit) : callback appelée quand le gamemode démarre
| openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnGameModeExit.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnGameModeExit.md",
"repo_id": "openmultiplayer",
"token_count": 377
} | 380 |
---
title: OnPlayerClickPlayerTextDraw
description: Cette callback est appelée quand un joueur clique sur un player-textdraw.
tags: ["player", "textdraw", "playertextdraw"]
---
## Paramètres
Cette callback est appelée quand un joueur clique sur un player-textdraw. Mais elle ne l'est pas quand le joueur quitte le textdraw sélectionné (ECHAP) - mais [OnPlayerClickTextDraw](OnPlayerClickTextDraw) l'est.
| Nom | Description |
| ------------------ | ---------------------------------------------------------- |
| `int` playerid | ID du joueur qui a sélectionné le textdraw |
| `int` playertextid | ID du player-textdraw qui a été sélectionné par `playerid` |
## Valeur de retour
La callback est toujours appelée en premier dans les filterscripts, donc return 1, faute de quoi les autres scripts ne pourront pas communiquer avec cette callback.
## Exemple
```c
new PlayerText:gPlayerTextDraw[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
// Création du TextDraw
gPlayerTextDraw[playerid] = CreatePlayerTextDraw(playerid, 10.000000, 141.000000, "TextDraw");
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);
// Le rendre sélectionnable
PlayerTextDrawSetSelectable(playerid, gPlayerTextDraw[playerid], 1);
// Le montrer au joueur
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, "Vous avez cliqué sur un textdraw.");
CancelSelectTextDraw(playerid);
return 1;
}
return 0;
}
```
## Astuces
:::warning
Quand un joueur quitte le textdraw sélectionné avec ECHAP, OnPlayerClickTextDraw est appelé avec le textdraw ID `INVALID_TEXT_DRAW`. OnPlayerClickPlayerTextDraw ne sera pas appelé.
:::
## Fonctions connexes
- [PlayerTextDrawSetSelectable](../functions/PlayerTextDrawSetSelectable): Rend un player-textdraw sélectionnable par un joueur.
## Callbacks connexes
- [OnPlayerClickTextDraw](OnPlayerClickTextDraw): Quand un joueur clique sur un textdraw.
- [OnPlayerClickPlayer](OnPlayerClickPlayer): Quand un joueur clique sur un autre.
- [OnPlayerClickMap](OnPlayerClickMap): Quand un joueur place un point sur la map avec le clic droit.
| openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnPlayerClickPlayerTextDraw.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnPlayerClickPlayerTextDraw.md",
"repo_id": "openmultiplayer",
"token_count": 1133
} | 381 |
---
title: OnPlayerGiveDamage
description: Cette callback est appelée quand un joueur inflige des dégâts à un autre joueur.
tags: ["player"]
---
## Paramètres
Cette callback est appelée quand un joueur inflige des dégâts à un autre joueur.
| Nom | Description |
|-----------------------|--------------------------------------------------------------------------|
| `int` playerid | ID du joueur qui inflige le dégât |
| `int` damagedid | ID du joueur qui reçoit le dégât |
| `float` Float:amount | Montant de la perte en armure/vie (combinés) |
| `int` WEAPON:weaponid | Cause du dommage |
| `int` bodypart | Partie du corps qui a été touchée |
## Valeur de retour
**1** - Autorise la callback à être appelée par un autre script.
**0** - Refuser que la callback soit appelée ailleurs.
## Exemple
```c
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, WEAPON:weaponid, bodypart)
{
new
string[128],
victim[MAX_PLAYER_NAME],
attacker[MAX_PLAYER_NAME],
weaponname[24];
GetPlayerName(playerid, attacker, sizeof (attacker));
GetPlayerName(damagedid, victim, sizeof (victim));
GetWeaponName(weaponid, weaponname, sizeof (weaponname));
format(string, sizeof(string), "%s a infligé %.0f de dégâts à %s, arme: %s, bodypart: %d", attacker, amount, victim, weaponname, bodypart);
SendClientMessageToAll(0xFFFFFFFF, string);
return 1;
}
```
## Astuce
:::tip
Gardez à l'esprit que cette fonction peut être inexacte dans certains cas.
Si vous voulez empêcher certains joueurs de s'endommager, utilisez SetPlayerTeam.
Le weaponid retournera la raison 37 _(lance-flammes)_ de n'importe quelle source de feu _(par exemple molotov, 18)_.
Le weaponid retournera la raison 51 de n'importe quelle arme qui crée une explosion _(par exemple RPG, grenade)_.
`playerid` est le seul à pouvoir appeler le callback.
Le montant est toujours le maximum de dégâts que l'arme peut faire, même si la santé restante est inférieure à ce maximum de dégâts. Ainsi, lorsqu'un joueur a 100,0 points de vie et se fait tirer dessus avec un Desert Eagle qui a une valeur de dégâts de 46,2, il faut 3 coups pour tuer ce joueur. Les 3 tirs montreront au final un montant de 46,2, même si lorsque le dernier coup frappe, le joueur n'a plus que 7,6 points de vie.
:::
| openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnPlayerGiveDamage.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnPlayerGiveDamage.md",
"repo_id": "openmultiplayer",
"token_count": 1129
} | 382 |
---
title: OnPlayerSpawn
description: Cette callback est appelée lorsqu'un joueur spawn (apparaît).
tags: ["player"]
---
## Paramètres
Cette callback est appelée lorsqu'un joueur spawn (apparaît).
| Nom | Description |
| -------------- | ---------------------------------- |
| `int` playerid | L'ID du joueur qui spawn. |
## Valeur de retour
Retournez **0** pour forcer le joueur à retourner à la sélection de classe au prochain spawn.
## Exemple
```c
public OnPlayerSpawn(playerid)
{
new PlayerName[MAX_PLAYER_NAME],
string[40];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName
format(string, sizeof(string), "[ ! ] %s a spawn.", PlayerName);
SendClientMessageToAll(0xFFFFFFFF, string);
return 1;
}
```
## Astuces
:::tip
Le jeu déduit parfois \$100 à un joueur après son apparition.
:::
## Fonctions connexes
- [SpawnPlayer](../functions/SpawnPlayer): Force un joueur a spawn.
- [AddPlayerClass](../functions/AddPlayerClass): Ajoute une class.
- [SetSpawnInfo](../functions/SetSpawnInfo): Permet de déterminer les paramètres de spawn d'un joueur.
| openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnPlayerSpawn.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnPlayerSpawn.md",
"repo_id": "openmultiplayer",
"token_count": 454
} | 383 |
---
title: OnVehicleMod
description: Cette callback est appelée lorsqu'un véhicule est modifié.
tags: ["vehicle"]
---
## Paramètres
Cette callback est appelée lorsqu'un véhicule est modifié.
| Nom | Description |
| ----------------- | ----------------------------------------------------------- |
| `int` playerid | L'ID du conducteur du véhicule. |
| `int` vehicleid | L'ID du véhicule modifié. |
| `int` componentid | L'ID de la partie de la voiture qui a été ajoutée/modifiée. |
## Valeur de retour
Retournez **0** pour empêcher la modification d'être visible pour les autres joueurs.
## Exemple
```c
public OnVehicleMod(playerid, vehicleid, componentid)
{
printf("Le véhicule %d a été modifié par le joueur ID %d. L'ID de la partie de la voiture modifiée est %d",vehicleid,playerid,componentid);
if(GetPlayerInterior(playerid) == 0)
{
BanEx(playerid, "Hack Tuning"); // Anti-tuning hacks script
//Testé et approuvé sur les serveurs où il est impossible de modifier un véhicule hors d'un transfender/wheel arch angel
}
return 1;
}
```
## Astuces
:::tip
Cette callback ne sera pas appelée avec [AddVehicleComponent](../functions/AddVehicleComponent).
:::
## Fonctions connexes
- [AddVehicleComponent](../functions/AddVehicleComponent): Ajoute un composant sur un véhicule.
## Callbacks connexes
- [OnEnterExitModShop](OnEnterExitModShop): Appelée lorsqu'un joueur dans un véhicule entre ou sort d'un garage de modification.
- [OnVehiclePaintjob](OnVehiclePaintjob): Appelée lorsque la peinture d'un véhicule est changée.
- [OnVehicleRespray](OnVehicleRespray): Appelée lorsqu'un véhicule est repeint.
| openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnVehicleMod.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/fr/scripting/Callbacks/OnVehicleMod.md",
"repo_id": "openmultiplayer",
"token_count": 743
} | 384 |
---
title: Berkontribusi
description: Cara berkontribusi untuk wiki SA-MP dan dokumentasi open.mp.
---
Sumber dokumentasi ini terbuka bagi siapa saja untuk memberi kontribusi perubahan! Yang Anda butuhkan adalah sebuah akun [GitHub](https://github.com) dan waktu luang. Anda tidak diharuskan mengerti Git, Anda dapat melakukan semuanya dari _Web UI_ (antarmuka web).
Jika Anda ingin membantu mempertahankan wiki ini dalam Bahasa Indonesia, buka sebuah _pull request_ (PR) terhadap file [`CODEOWNERS`](https://github.com/openmultiplayer/web/blob/master/CODEOWNERS) dan tambahkan direktori untuk bahasa Anda dengan _username_ GitHub Anda.
## Menyunting Konten
Di setiap halaman, ada sebuah tombol yang mengarahkan Anda ke halaman GitHub untuk penyuntingan:

Sebagai contoh, klik di [SetVehicleAngularVelocity](../scripting/functions/SetVehicleAngularVelocity) akan mengarahkan Anda ke [halaman ini](https://github.com/openmultiplayer/web/edit/master/docs/scripting/functions/SetVehicleAngularVelocity.md) yang di mana akan memunculkan sebuah _text editor_ untuk membuat perubahan ke file tersebut (asumsikan Anda sudah _login_ ke GitHub).
Lakukan penyuntingan Anda and kirimkan sebuah "Pull Request" yang artinya pengelola Wiki ini dan anggota komunitas lainnya dapat mengulas (me-_review_) perubahan Anda, diskusikas apakah perlu ada perubahan dan kemudian gabungkan.
## Menambah Konten Baru
Menambah konten baru sedikit lebih rumit. Anda dapat melakukannya dengan dua cara:
### Antarmuka GitHub
Ketika menjelajahi sebuah direktori di GitHub, ada sebuah tombol Add file terletak di sudut kanan atas daftar file (_file list_):

Anda bisa meng-_upload_ file Markdown yang sudah Anda tulis atau menulisnya langsung ke _text editor_ GitHub.
_File_ harus memiliki ekstensi `.md` dan mengandung Markdown. Untuk informasi lebih lanjut tentang Markdown silakan lihat [panduan ini](https://guides.github.com/features/mastering-markdown/).
Setelah selesai, tekan "Propose new file" dan sebuah Pull Request akan terbuka untuk diulas.
### Git
Jika Anda ingin menggunakan Git, yang Anda harus lakukan adalah _clone_ _repository_ Wiki dengan:
```sh
git clone https://github.com/openmultiplayer/wiki.git
```
Buka dengan editor favorit Anda. Saya merekomendasikan Visual Studio Code karena memiliki peralatan yang bagus untuk menyunting dan _formatting_ _file_ Markdown. Yang Anda lihat, saya sedang menulis ini menggunakan Visual Studio Code!

Saya merekomendasikan dua ekstension untuk membuat pengalaman Anda menjadi lebih baik:
- [markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint) oleh David Anson - ini adalah sebuah ekstensi yang memastikan Markdown Anda telah di-_format_ dengan benar. Hal ini untuk mencegah beberapa kesalahan secara sintaks dan semantik. Tidak semua peringatan itu penting, tapi beberapa dapat membantu meningkatkan dalam pembacaan. Gunakan penilai terbaik Anda dan jika ragu, tanyakan saja kepada pengulas!
- [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) oleh Tim Prettier.js - ini adalah sebuah _formatter_ yang akan mem-_format_ Markdown Anda secara otomatis, sehingga Markdown Anda menggunakan gaya yang konsisten. _Repository_ _Wiki_ memiliki beberapa pengaturan di dalam file `package.json` yang harus digunakan secara otomatis. Pastikan Anda menyalakan pengaturan "Format On Save" di pengaturan _editor_ Anda, sehingga _file_ Markdown Anda akan menjadi ter-_format_ secara otomatis setiap kali Anda menyimpan!
## Catatan, Tips, dan Konvensi
### Tautan Internal
Jangan gunakan URL absolut untuk tautan antarsitus. Gunakan _relative paths_.
- ❌
```md
Untuk digunakan dengan [OnPlayerClickPlayer](https://www.open.mp/docs/scripting/callbacks/OnPlayerClickPlayer)
```
- ✔
```md
Untuk digunakan dengan [OnPlayerClickPlayer](../callbacks/OnPlayerClickPlayer)
```
`../` artinya "naik satu direktori", sehingga ketika _file_ yang Anda sunting di dalam direktori `functions` dan Anda menghubungkan ke `callbacks`, Anda menggunakan `../` untuk ke `scripting/`, kemudian `callbacks` untuk masuk ke direktori `callbacks`, kemudian nama _file_ _callback_ (tanpa `.md`) yang ingin Anda hubungkan.
### Gambar
Gambar-gambar ada di dalam subdirektori `/static/images`. Lalu, ketika Anda ingin menghubungkan gambar dengan `![]()`, Anda cukup menggunakan `/images/` sebagai jalur dasarnya (tidak perlu menambahkan `static`).
Jika ragu, bacalah halaman lain yang menggunakan gambar dan salin bagian memuat gambar.
### Metadata
Hal pertama di dokumen _apapun_ di sini adalah metadata:
```mdx
---
title: Dokumentasi
description: Ini adalah sebuah halaman tentang apapun yang berhubungan dengan burger. Nyam nyam~
---
```
Setiap halaman harus disertakan sebuah judul dan deskripsi.
Untuk daftar lengkap yang bisa disertakan di antara `---`, lihat [dokumentasi Docusaurus](https://v2.docusaurus.io/docs/markdown-features#markdown-headers).
### Judul
Jangan membuat heading level 1 (`<h1>`) dengan `#` yang akan di-_generate_ secara otomatis. Judul pertama Anda harus selalu menggunakan `##`
- ❌
```md
# Ini Judul
Dokumentasi ini untuk ...
# Perincian
```
- ✔
```md
Dokumentasi ini untuk ...
## Perincian
```
### Gunakan `Code` Snippets untuk Referensi Teknis
Ketika menulis sebuah paragraf yang mengandung nama-nama fungsi, angka, ekspresi, atau apapun yang bukan standar penulisan bahasa, apitkan dengan \`backtick\` (letaknya di bawah tombol ESC pada _keyboard_). Hal ini mempermudah untuk memisahkan bahasa untuk deskripsi dengan elemen teknis, seperti nama fungsi dan potongan kode.
- ❌
> Fungsi fopen akan mengembalikan sebuah nilai dengan sebuah tag dengan tipe File:, tidak ada masalah pada baris tersebut, selama baris tersebut nilai baliknya disimpan ke variabel dengan tag File: (perhatikan bahwa kasusnya juga sama). Namun, pada baris selanjutnya, nilai 4 ditambahkan ke handle file. 4 tidak memiliki tag [...]
- ✔
> Fungsi `fopen` akan mengembalikan sebuah nilai dengan sebuah tag dengan tipe `File:`, tidak ada masalah pada baris tersebut, selama baris tersebut nilai baliknya disimpan ke variabel dengan tag `File:` (perhatikan bahwa kasusnya juga sama). Namun, pada baris selanjutnya, nilai `4` ditambahkan ke handle file. `4` tidak memiliki tag [...]
Seperti contoh di atas, `fopen` adalah sebuah nama fungsi, bukan kata bahasa Inggris, jadi apitkan dengan penanda `code` snippet untuk membantu membedakan dengan konten lainnya.
Selain itu, jika paragraf merujuk ke sekumpulan kode, ini membantu pembaca mengaitkan kata dengan contoh tersebut.
### Tabel
Jika tabel memiliki judul, letakkan di bagian atas:
- ❌
```md
| | |
| ------- | ------------------------------------------ |
| Darah | Status Mesin |
| 650 | Tidak Rusak |
| 650-550 | Berasap Putih |
| 550-390 | Berasap Abu-abu |
| 390-250 | Berasap Hitam |
| < 250 | Terbakar (akan meledak beberapa saat lagi) |
```
- ✔
```md
| Darah | Status Mesin |
| ------- | ------------------------------------------ |
| 650 | Tidak Rusak |
| 650-550 | Berasap Putih |
| 550-390 | Berasap Abu-abu |
| 390-250 | Berasap Hitam |
| < 250 | Terbakar (akan meledak beberapa saat lagi) |
```
## Migrasi dari Wiki SA-MP
Hampir seluruh konten dari Wiki SA-MP telah dipindahkan, namun jika Anda menemukan sebuah halaman yang hilang, ini pandungan singkat untuk konversi kontennya menjadi Markdown.
### Getting the HTML
1. Klik tombol ini
(Firefox)

(Chrome)

2. Arahkan ke sudut kiri atas dari halaman utama wiki, di margin kiri atau sudut hingga Anda menemukan `#content`

Atau cari `<div id=content>`

3. Salin kode HTML pada elemen tersebut

Sekarang Anda **hanya** memiliki memiliki kode HTML yang berisi **konten** aktual pada halaman tersebut, hal-hal yang kami minati, dan Anda bisa konversikan menjadi Markdown.
### Mengkonversi HTML menjadi Markdown
Untuk mengkonversi HTML dasar (tanpa tabel), ke Markdown, gunakan:
[https://domchristie.github.io/turndown/](https://domchristie.github.io/turndown/)

^^ Perhatikan sekarang. Hasil konversi mengacaukan tabel seluruhnya...
### Tabel HTML ke Tabel Markdown
Karena _tool_ di atas tidak mendukung tabel, gunakan _tool_ ini:
[https://jmalarcon.github.io/markdowntables/](https://jmalarcon.github.io/markdowntables/)
Dan salin hanya elemen `<table>` di:

### Merapikan
Hasil konversi tidak selalu sempurna, Jadi, Anda diharuskan merapikan beberapa bagian secara manual. Daftar ektensi untuk _formatting_ yang telah disebutkan di atas seharusnya dapat membantu, tapi mungkin Anda tetap membutuhkan meluangkan waktu untuk melakukannya secara manual.
Jika Anda tidak ada waktu, jangan khawatir. Kirim draf yang belum diselesaikan dan orang lain dapat melanjutkan yang telah Anda kerjakan!
## Perjanjian Lisensi
Seluruh proyek open.mp memiliki sebuah [Contributor License Agreement](https://cla-assistant.io/openmultiplayer/homepage). Ini pada dasarnya berarti Anda menyetujui kami menggunakan karya Anda, dan meletakannya di bawah lisensi sumber terbuka (_open-source_). Ketika Anda membuka sebuah Pull Request untuk pertama kalinya, bot CLA-Assistant akan mem-posting sebuah tautan tempat Anda bisa menandatangani perjanjian.
| openmultiplayer/web/docs/translations/id/meta/Contributing.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/id/meta/Contributing.md",
"repo_id": "openmultiplayer",
"token_count": 4132
} | 385 |
---
title: OnPlayerClickTextDraw
description: Callback ini akan terpanggil ketika pemain mengklik sebuah textraw atau membatalkan 'select' mode dengan tombol ESC.
tags: ["player", "textdraw"]
---
## Deskripsi
Callback ini akan terpanggil ketika pemain mengklik sebuah textraw atau membatalkan 'select' mode dengan tombol ESC.
| Nama | Deskripsi |
| --------- | ----------------------------------------------------------------------- |
| playerid | ID dari pemain yang mengklik textdraw. |
| clickedid | ID dari textraw yang diklik. INVALID_TEXT_DRAW jika seleksi dibatalkan. |
## Returns
Ini akan selalu terpanggil pertama di filterscripts jadi mengembalikan nilai 1 akan melarang filterscript lain untuk melihatnya.
## Contoh
```c
new Text:gTextDraw;
public OnGameModeInit()
{
gTextDraw = TextDrawCreate(10.000000, 141.000000, "TextDrawKu");
TextDrawTextSize(gTextDraw,60.000000, 20.000000);
TextDrawAlignment(gTextDraw,0);
TextDrawBackgroundColor(gTextDraw,0x000000ff);
TextDrawFont(gTextDraw,1);
TextDrawLetterSize(gTextDraw,0.250000, 1.000000);
TextDrawColor(gTextDraw,0xffffffff);
TextDrawSetProportional(gTextDraw,1);
TextDrawSetShadow(gTextDraw,1);
TextDrawSetSelectable(gTextDraw, 1);
return 1;
}
public OnPlayerKeyStateChange(playerid, KEY:newkeys, KEY:oldkeys)
{
if(newkeys == KEY_SUBMISSION)
{
TextDrawShowForPlayer(playerid, gTextDraw);
SelectTextDraw(playerid, 0xFF4040AA);
}
return 1;
}
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(clickedid == gTextDraw)
{
SendClientMessage(playerid, 0xFFFFFFAA, "Anda mengklik sebuah TextDraw, wow!.");
CancelSelectTextDraw(playerid);
return 1;
}
return 0;
}
```
## Catatan
:::warning
Area yang dapat diklik ditentukan oleh TextDrawTextSize. parameter x dan y yang diteruskan ke fungsi tersbut tidak boleh nol atau negatif. Jangan pernah gunakan CancelSelectextDraw tanpa pengecekan dalam callback ini. Kemungkinan pengulangan tak terbatas bisa terjadi.
:::
## Fungsi Terkait
- [OnPlayerClickPlayerTextDraw](OnPlayerClickPlayerTextDraw.md): Terpanggil ketika player mengklik sebuah player-textdraw.
- [OnPlayerClickPlayer](OnPlayerClickPlayer.md): Terpanggil ketika player mengklik yang lain.
| openmultiplayer/web/docs/translations/id/scripting/callbacks/OnPlayerClickTextDraw.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/id/scripting/callbacks/OnPlayerClickTextDraw.md",
"repo_id": "openmultiplayer",
"token_count": 970
} | 386 |
---
title: OnPlayerStreamOut
description: Callback ini akan terpanggil ketika pemain lain keluar dari jangkauan stream dari klien pemain.
tags: ["player"]
---
## Deskripsi
Callback ini akan terpanggil ketika pemain lain keluar dari jangkauan stream dari klien pemain.
| Nama | Deskripsi |
| ----------- | ------------------------------------------------------ |
| playerid | ID dari pemain lain yang keluar jangakauan stream klien pemain. |
| forplayerid | ID dari pemain yang berada di luar jangkauan stream pemain lain.|
## Returns
Ini akan selalu terpanggil pertama di filterscripts
## Contoh
```c
public OnPlayerStreamOut(playerid, forplayerid)
{
new string[80];
format(string, sizeof(string), "Pemain ID %d telah menjauhimu.", playerid);
SendClientMessage(forplayerid, 0xFF0000FF, string);
return 1;
}
```
## Catatan
:::tip
Callback ini akan terpanggil juga oleh NPC.
:::
## Fungsi Terkait
| openmultiplayer/web/docs/translations/id/scripting/callbacks/OnPlayerStreamOut.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/id/scripting/callbacks/OnPlayerStreamOut.md",
"repo_id": "openmultiplayer",
"token_count": 406
} | 387 |
---
title: EditObject
description: Memungkinkan Player untuk mengedit object (posisi dan rotasi) menggunakan mouse mereka pada GUI (Graphical User Interface).
tags: []
---
## Deskripsi
Memungkinkan Player untuk mengedit object (posisi dan rotasi) menggunakan mouse mereka pada GUI (Graphical User Interface).
| Name | Description |
| -------- | ----------------------------------- |
| playerid | ID Player yang mengedit Object. |
| objectid | ID Object yang di edit oleh Player. |
## Returns
1: Function berhasil dijalankan. Sukses akan di laporkan ketika Object tidak di tentukan, Tetapi tidak akan terjadi apa-apa.
0: Function gagal di jalankan. Karena pemain tidak terhubung.
## Contoh
```c
new object;
public OnGameModeInit()
{
object = CreateObject(1337, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/oedit", true))
{
EditObject(playerid, object);
SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Sekarang anda bisa mengedit Object!");
return 1;
}
return 0;
}
```
## Catatan
:::tip
Anda dapat menggerakkan kamera saat mengedit dengan menekan dan menahan spasi (atau W di kendaraan) dan menggerakkan mouse Anda.
:::
## Fungsi Terkait
- [CreateObject](CreateObject): Membuat suatu Object.
- [DestroyObject](DestroyObject): Menghapus suatu Object.
- [MoveObject](MoveObject): Memindahkan suatu Object.
- [EditPlayerObject](EditPlayerObject): Mengedit suatu Object.
- [EditAttachedObject](EditAttachedObject): Mengedit suatu Attached Object.
- [SelectObject](SelectObject): Memilih suatu Object.
- [CancelEdit](CancelEdit): Membatalkan mengedit suatu Object.
| openmultiplayer/web/docs/translations/id/scripting/functions/EditObject.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/id/scripting/functions/EditObject.md",
"repo_id": "openmultiplayer",
"token_count": 635
} | 388 |
---
title: strmid
description: Mengekstrak bagian dari sebuah string ke string lainnya.
tags: ["string"]
---
<LowercaseNote />
## Deskripsi
Mengekstrak bagian dari sebuah string ke string lainnya.
| Name | Deskripsi |
| --------------------- | ----------------------------------------------------------- |
| dest[] | Tempat string untuk menyimpan hasil ekstrak karakter. |
| const source[] | String untuk mengekstrak karakter. |
| start | Posisi karakter awal. |
| end | Posisi karakter akhir. |
| maxlength=sizeof dest | Panjang karakter. (Akan menjadi ukuran dest secara default) |
## Returns
Jumlah karakter yang diekstrak ke dest[]
## Contoh
```c
strmid(string, "Extract 'HELLO' without the !!!!: HELLO!!!!", 34, 39); //string berisi "HELLO"
```
## 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.
- [strpack](strpack): Membungkus sebuah string menjadi string baru.
- [strval](strval): Mengkonversi sebuah string menjadi integer.
- [strcat](strcat): Menggabungkan dua buah string menjadi sebuah string.
- [strdel](strdel): Menghapus bagian dari sebuah string.
| openmultiplayer/web/docs/translations/id/scripting/functions/strmid.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/id/scripting/functions/strmid.md",
"repo_id": "openmultiplayer",
"token_count": 700
} | 389 |
---
id: pickupids
title: ID Pickup
description: Informasi tentang ID Pickup
---
:::note
Semua model objek yang valid dapat digunakan sebagai [pickup](../functions/CreatePickup). Halaman ini hanya berisi daftar model objek umum yang ukurannya sesuai untuk digunakan sebagai pickup
:::
## ID model pickup
| ID | Ikon | Deskripsi |
| ----- | --------------------------------- | --------------------------------- |
| 954 |  | Tapal kuda |
| 1210 |  | Koper |
| 1212 |  | Uang |
| 1213 |  | Ranjau darat |
| 1239 |  | Informasi |
| 1240 |  | Hati |
| 1241 |  | Pil (Obat) |
| 1242 |  | Rompi Pelindung Badan |
| 1247 |  | Bintang |
| 1248 |  | Logo GTA III |
| 1252 |  | Tong ledak |
| 1254 |  | Tengkorak |
| 1272 |  | Rumah (biru) |
| 1273 |  | Rumah (hijau) |
| 1274 |  | Dollar |
| 1275 |  | Baju |
| 1276 |  | Tiki |
| 1277 |  | Disket penyimpanan |
| 1279 |  | Craig package |
| 1310 |  | Parasut |
| 1313 |  | Tengkorak ganda (rampage) |
| 1314 |  | Dua-pemain |
| 1318 |  | Panah |
| 1550 |  | Tas uang |
| 1575 |  | Paket obat (putih) |
| 1576 |  | Paket obat (jingga) |
| 1577 |  | Paket obat (kuning) |
| 1578 |  | Paket obat (hijau) |
| 1579 |  | Paket obat (biru) |
| 1580 |  | Paket obat (merah) |
| 1581 |  | Kartu akses |
| 1582 |  | Kotak pizza |
| 1636 |  | Bom Remote Control (RC) |
| 1650 |  | Kaleng bensin |
| 1654 |  | Dinamit |
| 2057 |  | Kaleng api |
| 2060 |  | Karung pasir |
| 2061 |  | Cangkang kerang |
| 2690 |  | Pemadam api |
| 2710 |  | Jam tangan |
| 11736 |  | Tas medis |
| 11738 |  | Koper medis |
| 19130 |  | Panah (tipe 1) |
| 19131 |  | Panah (tipe 2) |
| 19132 |  | Panah (tipe 3) |
| 19133 |  | Panah (tipe 4) |
| 19134 |  | Panah (tipe 5) |
| 19135 |  | Penanda eksterior (bergerak) |
| 19197 |  | Penanda eksterior (kuning, besar) |
| 19198 |  | Penanda eksterior (kuning, kecil) |
| 19320 |  | Labu |
| 19522 |  | Rumah (merah) |
| 19523 |  | Rumah (jingga) |
| 19524 |  | Rumah (kuning) |
| 19602 |  | Ranjau darat (tipe 2) |
| 19605 |  | Penanda eksterior (merah) |
| 19606 |  | Penanda eksterior (hijau) |
| 19607 |  | Penanda eksterior (biru) |
| 19832 |  | Kotak Ammunation |
## Pickup senjata
| ID | Deskripsi |
| --- | ------------------------------- |
| 321 | Dildo Reguler |
| 322 | Dildo Putih |
| 323 | Vibrator |
| 324 | Vibrator Lainnya |
| 325 | Bunga |
| 326 | Tongkat |
| 330 | Teleponnya CJ |
| 331 | Brass Knuckles |
| 333 | Tongkat Golf |
| 334 | Night Stick |
| 335 | Pisau |
| 336 | Tongkat Baseball |
| 337 | Sekop |
| 338 | Tongkat Billiard |
| 339 | Katana |
| 341 | Gergaji Mesin |
| 342 | Granat Ledak |
| 343 | Granat Gas Air Mata |
| 344 | Molotov Cocktail |
| 346 | Pistol Colt 45 |
| 347 | Pistol Colt 45 (silenced) |
| 348 | Desert Eagle |
| 349 | Shotgun Reguler |
| 350 | Sawn-Off Shotgun |
| 351 | SPAZ-12 Shotgun |
| 352 | Mac-10 (atau Micro-UZI) |
| 353 | MP5 |
| 354 | Suar Hydra |
| 355 | AK47 Assault Rifle |
| 356 | M4 Assault Rifle |
| 357 | Country Rifle |
| 358 | Sniper Rifle |
| 359 | Rocket Launcher |
| 360 | Heat Seeking Rocket Launcher |
| 361 | Flamethrower |
| 362 | Minigun |
| 363 | Granat Tempel (Satchel Charges) |
| 364 | Peledak |
| 365 | Kaleng Semprot Cat |
| 366 | Pemadam Api |
| 367 | Kamera |
| 368 | Kacamata Night Vision |
| 369 | Kacamata Infra-red |
| 370 | Jetpack |
| 371 | Parasut |
| 372 | Tec-9 |
| openmultiplayer/web/docs/translations/id/scripting/resources/pickupids.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/id/scripting/resources/pickupids.md",
"repo_id": "openmultiplayer",
"token_count": 4287
} | 390 |
---
id: lagcompensation
title: "Kompensasi Lag"
descripion: Penjelasan kompensasi lag.
---
Kompensasi lag untuk peluru yang ditembakkan diaktifkan secara otomatis di server SA-MP sejak versi 0.3z. Hal ini bisa diatur menggunakan variabel server `lagcompmode` di [server.cfg](server.cfg). Ubah nilai ke 0 akan mematikan kompensasi lag seutuhnya dari pemain diharuskan menembak agak condong ke depan (menembak di depan target).
Mematikan Kompensasi Lag akan mencegah pemanggilan [OnPlayerWeaponShot](../../callbacks/OnPlayerWeaponShot).
Variabel ini hanya dapat diatur di [server.cfg](server.cfg).
| openmultiplayer/web/docs/translations/id/server/lagcompensation.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/id/server/lagcompensation.md",
"repo_id": "openmultiplayer",
"token_count": 218
} | 391 |
---
title: AddPlayerClassEx
description: Ta funkcja jest dokładnie taka sama, jak funkcja AddPlayerClass, z wyjątkiem dodatkowego parametru na drużynę.
tags: ["player"]
---
## Opis
Ta funkcja jest dokładnie taka sama, jak funkcja AddPlayerClass, z wyjątkiem dodatkowego parametru na drużynę.
| Nazwa | Opis |
| ------------- | ----------------------------------------------------------- |
| teamid | Drużyna, w której gracz ma się spawnować. |
| modelid | Skin, z którym gracze będą się spawnować. |
| Float:spawn_x | Koordynat X miejsca spawnu tej klasy. |
| Float:spawn_y | Koordynat Y miejsca spawnu tej klasy. |
| Float:spawn_z | Koordynat Z miejsca spawnu tej klasy. |
| Float:z_angle | Kierunek, w który skierowany będzie gracz po zespawnowaniu. |
| weapon1 | Pierwsza broń, którą gracz otrzyma po zespawnowaniu. |
| weapon1_ammo | Liczba sztuk amunicji dla pierwszej broni. |
| weapon2 | Druga broń, którą gracz otrzyma po zespawnowaniu. |
| weapon2_ammo | Liczba sztuk amunicji dla drugiej broni. |
| weapon3 | Trzecia broń, którą gracz otrzyma po zespawnowaniu. |
| weapon3_ammo | Liczba sztuk amunicji dla trzeciej broni. |
## Zwracane wartości
ID klasy, która właśnie została dodana.
319, jeżeli limit klas (320) został osiągnięty. Najwyższe możliwe ID klasy to 319.
## Przykłady
```c
public OnGameModeInit()
{
// Gracze mogą się zespawnować:
// Skinem CJ (ID 0) w drużynie 1.
// Skinem The Trutha (ID 1) w drużynie 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;
}
```
## Uwagi
:::tip
Maksymalne ID klasy to 319 (zaczynając od 0, czyli łącznie 320 klas). Po osiągnięciu tego limitu, każda następna dodana klasa będzie zastępować ID 319.
:::
## Powiązane funkcje
- [AddPlayerClass](AddPlayerClass.md): Dodaje klasę.
- [SetSpawnInfo](SetSpawnInfo.md): Konfiguruje ustawienia spawnu dla gracza.
- [SetPlayerTeam](SetPlayerTeam.md): Ustawia drużynę gracza.
- [SetPlayerSkin](SetPlayerSkin.md): Ustawia skin gracza.
| openmultiplayer/web/docs/translations/pl/scripting/functions/AddPlayerClassEx.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/pl/scripting/functions/AddPlayerClassEx.md",
"repo_id": "openmultiplayer",
"token_count": 1263
} | 392 |
---
title: AttachObjectToObject
description: Możesz używać tej funkcji, aby przyczepiać obiekty do innych obiektów. Obiekty będą podążać za głównym obiektem.
tags: []
---
## Opis
Możesz używać tej funkcji, aby przyczepiać obiekty do innych obiektów. Obiekty będą podążać za głównym obiektem.
| Nazwa | Opis |
| ------------- | -------------------------------------------------------------------------------------- |
| objectid | Obiekt, który ma zostać przyczepiony do innego obiektu. |
| attachtoid | Obiekt, do którego inny obiekt ma zostać przyczepiony. |
| Float:OffsetX | Dystans pomiędzy głównym obiektem, a przyczepianym obiektem (koordynat X). |
| Float:OffsetY | Dystans pomiędzy głównym obiektem, a przyczepianym obiektem (koordynat Y). |
| Float:OffsetZ | Dystans pomiędzy głównym obiektem, a przyczepianym obiektem (koordynat Z). |
| Float:RotX | Rotacja X pomiędzy przyczepianym obiektem, a głównym obiektem. |
| Float:RotY | Rotacja Y pomiędzy przyczepianym obiektem, a głównym obiektem. |
| Float:RotZ | Rotacja Z pomiędzy przyczepianym obiektem, a głównym obiektem. |
| SyncRotation | Jeżeli ustawione na 0, rotacja objectid nie będzie się zmieniała razem z `attachtoid`. |
## Zwracane wartości
1: Funkcja wykonała się prawidłowo.
0: Funkcja nie wykonała się prawidłowo. To oznacza, że pierwszy obiekt (objectid) nie istnieje. Nie ma żadnej wbudowanej weryfikacji tego, czy drugi obiekt (attachtoid) istnieje.
## Przykłady
```c
new gObjectId = CreateObject(...);
new gAttachToId = CreateObject(...);
AttachObjectToObject(gObjectId, gAttachToId, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1);
```
## Uwagi
:::tip
Oba obiekty muszą być utworzone przed próbą ich połączenia. Nie ma odpowiednika tej funkcji dla obiektów gracza (AttachPlayerObjectToObject), dlatego nie jest ona wspierana przez streamery.
:::
## Powiązane funkcje
- [AttachObjectToPlayer](AttachObjectToPlayer.md): Przyczepia obiekt do gracza.
- [AttachObjectToVehicle](AttachObjectToVehicle.md): Przyczepia obiekt do pojazdu.
- [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer.md): Przyczepia do gracza obiekt, który jest widoczny tylko dla niego.
- [CreateObject](CreateObject.md): Tworzy obiekt.
- [DestroyObject](DestroyObject.md): Kasuje obiekt.
- [IsValidObject](IsValidObject.md): Sprawdza, czy podany obiekt istnieje.
- [MoveObject](MoveObject.md): Przesuwa obiekt.
- [StopObject](StopObject.md): Zatrzymuje obiekt.
- [SetObjectPos](SetObjectPos.md): Ustawia pozycję obiektu.
- [SetObjectRot](SetObjectRot.md): Ustawia rotację obiektu.
- [GetObjectPos](GetObjectPos.md): Podaje pozycję obiektu.
- [GetObjectRot](GetObjectRot.md): Podaje rotację obiektu.
- [CreatePlayerObject](CreatePlayerObject.md): Tworzy obiekt dla konkretnego gracza.
- [DestroyPlayerObject](DestroyPlayerObject.md): Kasuje obiekt gracza.
- [IsValidPlayerObject](IsValidPlayerObject.md): Sprawdza, czy podany obiekt gracza istnieje.
- [MovePlayerObject](MovePlayerObject.md): Przesuwa obiekt gracza.
- [StopPlayerObject](StopPlayerObject.md): Zatrzymuje obiekt gracza.
- [SetPlayerObjectPos](SetPlayerObjectPos.md): Ustawia pozycję obiektu gracza.
- [SetPlayerObjectRot](SetPlayerObjectRot.md): Ustawia rotację obiektu gracza.
- [GetPlayerObjectPos](GetPlayerObjectPos.md): Podaje pozycję obiektu gracza.
- [GetPlayerObjectRot](GetPlayerObjectRot.md): Podaje rotację obiektu gracza.
| openmultiplayer/web/docs/translations/pl/scripting/functions/AttachObjectToObject.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/pl/scripting/functions/AttachObjectToObject.md",
"repo_id": "openmultiplayer",
"token_count": 1736
} | 393 |
---
title: OnActorStreamIn
description: Esta callback é chamada quando um ator é carregado (torna-se visível) para um jogador.
tags: []
---
<VersionWarnPT name='callback' version='SA-MP 0.3.7' />
## Descrição
Esta callback é chamada quando um ator é carregado (torna-se visível) para um jogador.
| Nome | Descrição |
| ----------- | ------------------------------------------- |
| actorid | O ID do ator que foi carregado pelo jogador |
| forplayerid | O ID do jogador que carregou o ator. |
## Retorno
Sempre é chamada primeiro em filterscripts.
## Exemplos
```c
public OnActorStreamIn(actorid, forplayerid)
{
new string[40];
format(string, sizeof(string), "Ator %d carrgou para você.", actorid);
SendClientMessage(forplayerid, 0xFFFFFFFF, string);
return 1;
}
```
## Notas
<TipNPCCallbacksPT />
## Funções Relacionadas
| openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnActorStreamIn.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnActorStreamIn.md",
"repo_id": "openmultiplayer",
"token_count": 362
} | 394 |
---
title: OnNPCModeInit.
description: Essa callback é executada quando um script de NPC é carregado.
tags: []
---
## Descrição
Essa callback é executada quando um script de NPC é carregado.
## Exemplos
```c
public OnNPCModeInit()
{
print("O script do NPC foi carregado.");
return 1;
}
```
## Callbacks Relacionadas
- [OnNPCModeExit](../callbacks/OnNPCModeExit): Executada quando o script do NPC é descarregado.
| openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnNPCModeInit.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnNPCModeInit.md",
"repo_id": "openmultiplayer",
"token_count": 156
} | 395 |
---
title: OnPlayerExitVehicle
description: Esta callback é chamada quando um jogador sai do veículo.
tags: ["player", "vehicle"]
---
## Descrição
Esta callback é chamada quando um jogador sai do veículo.
| Nome | Descrição |
| --------- | ------------------------------------------- |
| playerid | O ID do jogador que esta saindo do veículo. |
| vehicleid | O ID do veículo que o jogador está saindo. |
## Retorno
Sempre é chamada primeiro em filterscripts.
## Exemplos
```c
public OnPlayerExitVehicle(playerid, vehicleid)
{
new string[35];
format(string, sizeof(string), "INFO: Você está saindo do veículo %i", vehicleid);
SendClientMessage(playerid, 0xFFFFFFFF, string);
return 1;
}
```
## Notas
:::warning
Não é chamada quando o jogador cai de uma bicicleta ou é removido do veículo por outros meios como o uso do SetPlayerPos. Você deve usar OnPlayerStateChange e checar se o antigo estado é PLAYER_STATE_DRIVER ou PLAYER_STATE_PASSENGER e se o novo estado é PLAYER_STATE_ONFOOT.
:::
## Funções Relacionadas
- [RemovePlayerFromVehicle](../functions/RemovePlayerFromVehicle.md): Tira o jogador do veículo.
- [GetPlayerVehicleSeat](../functions/GetPlayerVehicleSeat.md): Verifica que assento o jogador está.
| openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnPlayerExitVehicle.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnPlayerExitVehicle.md",
"repo_id": "openmultiplayer",
"token_count": 493
} | 396 |
---
title: OnPlayerSpawn
description: Este evento é chamado quando um jogador spawna.
tags: ["player"]
---
## Descrição
Este evento é chamado quando um spawna. (Após chamada da função SpawnPlayer)
| Nome | Descrição |
| -------- | ---------------------------------- |
| playerid | ID do jogador que spawnou. |
## Retorno
0 - Impedirá que outros filterscripts recebam este retorno de chamada.
1 - Indica que este retorno de chamada será passado para o próximo filterscript.
É sempre chamado primeiro nos filterscripts.
## Exemplos
```c
public OnPlayerSpawn(playerid)
{
new PlayerName[MAX_PLAYER_NAME],
string[40];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "%s foi spawnado com sucesso.", PlayerName);
SendClientMessageToAll(0xFFFFFFFF, string);
return 1;
}
```
## Notas
:::dica
O jogo às vezes deduz $100 dos jogadores após o spawn.
:::
## Funções Relacionadas
- [SpawnPlayer](../functions/SpawnPlayer): Forçar um jogador a spawnar.
- [AddPlayerClass](../functions/AddPlayerClass): Adiciona uma Classe.
- [SetSpawnInfo](../functions/SetSpawnInfo): Define a configuração de spawn para um jogador. | openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnPlayerSpawn.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnPlayerSpawn.md",
"repo_id": "openmultiplayer",
"token_count": 447
} | 397 |
---
title: OnVehicleSirenStateChange
description: Essa callback é chamada quando a sirene de um carro é ligada/desligada.
tags: ["vehicle"]
---
<VersionWarnPT name='callback' version='SA-MP 0.3.7' />
## Descrição
Essa callback é chamada quando a sirene de um carro é ligada/desligada.
| Nome | Descrição |
| --------- | ------------------------------------------------------------------------------ |
| playerid | ID do jogador que ligou/desligou a sirene (motorista). |
| vehicleid | ID do veículo que teve a sirene ligada/desligada. |
| newstate | Retorna o novo estado da sirene após a troca. 0 para desligada, 1 para ligada. |
## Retornos
0 - Vai prevenir que outros Filterscripts chamem essa callback.
1 - Indica que essa callback vai ser passada para o Gamemode em seguida.
Sempre é chamada primeiro em Filterscripts.
## Exemplos
```c
public OnVehicleSirenStateChange(playerid, vehicleid, newstate)
{
if (newstate)
{
GameTextForPlayer(playerid, "~W~Sirene ~G~ligada", 1000, 3);
}
else
{
GameTextForPlayer(playerid, "~W~Sirene ~r~desligada", 1000, 3);
}
return 1;
}
```
## Notas
:::tip
Essa callback **só é chamada** quando a sirene é ligada/desligada, **NÃO** quando a sirene alternativa está sendo usada (segurando a buzina).
:::
## Funções Relacionadas
- [GetVehicleParamsSirenState](../functions/GetVehicleParamsSirenState): Verifica se a sirene de um veículo está ou não ligada.
| openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnVehicleSirenStateChange.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnVehicleSirenStateChange.md",
"repo_id": "openmultiplayer",
"token_count": 686
} | 398 |
---
title: ApplyActorAnimation
description: Aplica uma animação a um ator.
tags: []
---
Esta função foi implementada no SA-MP 0.3.7 e não funcionará em versões anteriores.
## Descrição
Aplica uma animação a um ator.
| Nome | Descrição |
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| actorid | O ID do ator a aplicar a animação. |
| animlib[] | A biblioteca de animação da qual aplicar a animação. |
| animname[] | O nome da animação a aplicar, dentro da biblioteca especificada. |
| fDelta | A velocidade para reproduzir a animação (use 4.1). |
| loop | Se definido 1, a animação irá repetir. Se definido 0, a animação vai reproduzir uma vez. |
| lockx | Se definido 0, o ator vai retornar à sua coordenada X antiga, assim que a animação concluir (para animações que o ator move, como caminhar). 1 não irá retornar à posição antiga. |
| locky | O mesmo que acima, mas para o eixo Y. Same as above but for the Y axis. Deve ser mantido igual ao parâmetro anterior. |
| freeze | Definir para 1 vai congelar o ator no fim da animação. 0 não irá congelar. |
| time | Tempo em milisegundos. Para um ciclo infinito o valor deve ser 0. |
## Retorno
1: A função foi executada com sucesso.
0: A função falhou a ser executada. O ator específico não existe.
## Exemplos
```c
new gMyActor;
public OnGameModeInit()
{
gMyActor = CreateActor(179, 316.1, -134.0, 999.6, 90.0); // Ator como vendedor na Ammunation
ApplyActorAnimation(gMyActor, "DEALER", "shop_pay", 4.1, 0, 0, 0, 0, 0); // Anim de pagamento
return 1;
}
```
## Notas
:::tip
Você deve pré-carregar a biblioteca de animações para o jogador ao qual o ator irá aplicar a animação, e não para o ator. Caso contrário a animação não será aplicada ao ator até que a função seja executada novamente.
:::
## Funções Relacionadas
- [ClearActorAnimations](ClearActorAnimations.md): Limpe qualquer animação aplicada a um ator.
| openmultiplayer/web/docs/translations/pt-BR/scripting/functions/ApplyActorAnimation.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/functions/ApplyActorAnimation.md",
"repo_id": "openmultiplayer",
"token_count": 1855
} | 399 |
---
title: GangZoneCreate
description: Cria uma gangzone (zona colorida no radar).
tags: ["gangzone"]
---
## Descrição
Cria uma gangzone (zona colorida no radar).
| Nome | Descrição |
| ---- | --------------------------------------------- |
| minx | A coordenada X para o lado oeste da gangzone. |
| miny | A coordenada Y para o lado sul da gangzone. |
| maxx | A coordenada X para o lado este da gangzone. |
| maxy | A coordenada Y para o lado norte da gangzone. |
## Retorno
O ID da zona criada, retorna -1 se não for criada.
## Exemplos
```c
new gangzone;
gangzone = GangZoneCreate(1248.011, 2072.804, 1439.348, 2204.319);
```
```
MinY
v
MinX > *-------------
| |
| centro |
| gangzone |
| |
-------------* < MaxX
^
MaxY
```
## Notas
:::tip
Esta função apenas CRIA a gangzone, você deve usar GangZoneShowForPlayer ou GangZoneShowForAll para mostrá-la.
:::
:::warning
Existe um limite de 1024 gangzones. Colocar parâmetros na ordem errada resulta em glitches.
:::
## Funções Relacionadas
- [GangZoneDestroy](GangZoneDestroy): Destrói uma gangzone.
- [GangZoneShowForPlayer](GangZoneShowForPlayer): Mostra uma gangzone a um jogador.
- [GangZoneShowForAll](GangZoneShowForAll): Mostra uma gangzone para todos os jogadores.
- [GangZoneHideForPlayer](GangZoneHideForPlayer): Esconde uma gangzone a um jogador.
- [GangZoneHideForAll](GangZoneHideForAll): Esconde uma gangzone para todos os jogadores.
- [GangZoneFlashForPlayer](GangZoneFlashForPlayer): Faz uma gangzone piscar para um jogador.
- [GangZoneFlashForAll](GangZoneFlashForAll): Faz uma gangzone piscar para todos os jogadores.
- [GangZoneStopFlashForPlayer](GangZoneStopFlashForPlayer): Pare uma Gangzone de piscar para um jogador.
- [GangZoneStopFlashForAll](GangZoneStopFlashForAll): Pare uma Gangzone de piscar para todos os jogadores.
| openmultiplayer/web/docs/translations/pt-BR/scripting/functions/GangZoneCreate.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/functions/GangZoneCreate.md",
"repo_id": "openmultiplayer",
"token_count": 864
} | 400 |
---
title: GetPlayerInterior
description: Obtém o interior atual de um jogador.
tags: ["player"]
---
## Descrição
Obtém o interior atual de um jogador. Uma lista com os interiores atualmente conhecidos, com as suas posições, podem ser encontrados nesta página.
| Nome | Descrição |
| -------- | ------------------------------------------------ |
| playerid | O ID do jogador do qual deseja obter o interior. |
## Retorno
O ID do interior onde o jogador está atualmente.
## Examples
```c
public OnPlayerCommandText(playerid,text[])
{
if (strcmp(cmdtext,"/int",true) == 0)
{
new string[128];
format(string, sizeof(string), "Você está no interior: %i",GetPlayerInterior(playerid));
SendClientMessage(playerid, 0xFF8000FF, string);
return 1;
}
return 0;
}
```
## Notas
:::tip
Sempre retorna 0 para NPCs.
:::
## Funções Relacionadas
- [SetPlayerInterior](SetPlayerInterior): Define o interior de um jogador.
- [GetPlayerVirtualWorld](GetPlayerVirtualWorld): Verifica qual mundo virtual o jogador está.
| openmultiplayer/web/docs/translations/pt-BR/scripting/functions/GetPlayerInterior.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/functions/GetPlayerInterior.md",
"repo_id": "openmultiplayer",
"token_count": 438
} | 401 |
---
title: SetVehicleParamsCarDoors
description: Permite abrir e fechar as portas de um veículo.
tags: ["vehicle"]
---
Esta função foi implementada no SA-MP 0.3.7 e não funcionará em versões anteriores.
## Descrição
Permite abrir e fechar as portas de um veículo.
| Nome | Descrição |
| --------- | --------------------------------------------------------------------------------- |
| vehicleid | O ID do veículo a definir o estado da porta. |
| driver | O estado da porta do motorista. 1 para abrir, 0 para fechar. |
| passenger | O estado da porta do passageiro. 1 para abrir, 0 para fechar. |
| backleft | O estado da porta traseira esquerda (se disponível). 1 para abrir, 0 para fechar. |
| backright | O estado da porta traseira direita (se disponível). 1 para abrir, 0 para fechar. |
## Retorno
[edit]
## Funções Relacionadas
- [GetVehicleParamsCarDoors](GetVehicleParamsCarDoors.md): Retorna o estado atual das portas de um veículo.
- [SetVehicleParamsCarWindows](SetVehicleParamsCarWindows.md): Permite abrir e fechar as janelas de um veículo.
- [GetVehicleParamsCarWindows](GetVehicleParamsCarWindows.md): Retorna o estado atual das janelas de um veículo.
| openmultiplayer/web/docs/translations/pt-BR/scripting/functions/SetVehicleParamsCarDoors.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/functions/SetVehicleParamsCarDoors.md",
"repo_id": "openmultiplayer",
"token_count": 570
} | 402 |
---
title: Partes do Corpo
---
Para ser usado com [OnPlayerGiveDamage](../callbacks/OnPlayerGiveDamags), [OnPlayerTakeDamage](../callbacks/OnPlayerTakeDamage) e [OnPlayerGiveDamageActor](../callbacks/OnPlayerGiveDamageActor).
| ID | Partes do Corpo |
| --- | --------------- |
| 3 | Tronco |
| 4 | Virilha |
| 5 | Braço esquerdo |
| 6 | Braço direito |
| 7 | Perna esquerda |
| 8 | Pena direita |
| 9 | Cabeça |
:::note Esses ID's não são 100% confirmados, e não estão definidos em nenhuma include do SA:MP - eles devem ser definidos pelo scripter. Não se sabe se o ID 0, 1 e 2 têm algumas utilidade. :::

| openmultiplayer/web/docs/translations/pt-BR/scripting/resources/bodyparts.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/resources/bodyparts.md",
"repo_id": "openmultiplayer",
"token_count": 294
} | 403 |
---
title: OnActorStreamIn
description: Acest callback este apelat atunci când un actor este transmis în flux (streamed in) de către clientul unui jucător.
---
:::warning
Această funcție a fost adăugată în SA-MP 0.3.7 și nu va funcționa în versiunile anterioare!
:::
## Descriere
Acest callback este apelat atunci când un actor este transmis în flux (streamed in) de către clientul unui jucător.
| Nume | Descriere |
| ----------- | ------------------------------------------------------------ |
| actorid | ID-ul actorului care a fost transmis în flux pentru jucător. |
| forplayerid | ID-ul jucătorului în care s-a transmis actorul. |
## Returnări
Mereu este apelat primul în filterscript-uri.
## Exemple
```c
public OnActorStreamIn(actorid, forplayerid)
{
new string[40];
format(string, sizeof(string), "Actorul %d este acum transmis în flux pentru dvs.", actorid);
SendClientMessage(forplayerid, 0xFFFFFFFF, string);
return 1;
}
```
## Note
:::tip
Acest apel invers poate fi apelat și de NPC.
:::
## Funcții asociate
| openmultiplayer/web/docs/translations/ro/scripting/callbacks/OnActorStreamIn.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/ro/scripting/callbacks/OnActorStreamIn.md",
"repo_id": "openmultiplayer",
"token_count": 489
} | 404 |
---
title: OnPlayerCommandText
description: Acest callback este apelat atunci când un jucător introduce o comandă în chat.
tags: ["player"]
---
## Description
Acest callback este apelat atunci când un jucător introduce o comandă în chat. Comenzile sunt orice încep cu o bară oblică înainte, de ex. /ajutor.
| Nume | Descriere |
| --------- | ----------------------------------------------------------- |
| playerid | ID-ul jucătorului care a introdus o comandă. |
| cmdtext[] | Comanda care a fost introdusă (inclusiv bara oblică). |
## Returns
Este întotdeauna numit primul în filterscript-uri, astfel încât returnarea 1 blochează alte scripturi să-l vadă.
## Examples
```c
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/ajutor", true))
{
SendClientMessage(playerid, -1, "SERVER: Aceasta este comanda /ajutor !");
return 1;
// Returnarea 1 informează serverul că comanda a fost procesată.
// OnPlayerCommandText nu va fi apelat în alte scripturi.
}
return 0;
// Returnarea 0 informează serverul că comanda nu a fost procesată de acest script.
// OnPlayerCommandText va fi apelat în alte scripturi până când unul returnează 1.
// Dacă niciun script nu returnează 1, mesajul „SERVER: Comandă necunoscută” va fi afișat jucătorului.
}
```
## Note
<TipNPCCallbacks />
## Funcții similare
- [SendRconCommand](../functions/SendRconCommand): Trimite o comandă RCON prin script. | openmultiplayer/web/docs/translations/ro/scripting/callbacks/OnPlayerCommandText.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/ro/scripting/callbacks/OnPlayerCommandText.md",
"repo_id": "openmultiplayer",
"token_count": 672
} | 405 |
---
title: OnPlayerLeaveCheckpoint
description: Acest callback este apelat atunci când un jucător părăsește punctul de control setat pentru el de SetPlayerCheckpoint.
tags: ["player", "checkpoint"]
---
## Descriere
Acest callback este apelat atunci când un jucător părăsește punctul de control setat pentru el de SetPlayerCheckpoint. Numai un singur punct de control poate fi setat la un moment dat.
| Nume | Descriere |
| -------- | ---------------------------------------------------- |
| playerid | ID-ul jucătorului care a părăsit punctul de control. |
## Returnări
Este întotdeauna numit primul în filterscript-uri.
## Exemple
```c
public OnPlayerLeaveCheckpoint(playerid)
{
printf("Jucătorul %i a părăsit un punct de control!", playerid);
return 1;
}
```
## Note
<TipNPCCallbacks />
## Funcții similare
- [SetPlayerCheckpoint](../functions/SetPlayerCheckpoint): Creați un punct de control pentru un jucător.
- [DisablePlayerCheckpoint](../functions/DisablePlayerCheckpoint): Dezactivează punctul de control curent al jucătorului.
- [IsPlayerInCheckpoint](../functions/IsPlayerInCheckpoint): Verificați dacă un jucător se află într-un punct de control.
- [SetPlayerRaceCheckpoint](../functions/SetPlayerRaceCheckpoint): Creați un punct de control al cursei pentru un jucător.
- [DisablePlayerRaceCheckpoint](../functions/DisablePlayerRaceCheckpoint): Dezactivează punctul de control al cursei curent al jucătorului.
- [IsPlayerInRaceCheckpoint](../functions/IsPlayerInRaceCheckpoint): Verificați dacă un jucător se află într-un punct de control al cursei. | openmultiplayer/web/docs/translations/ro/scripting/callbacks/OnPlayerLeaveCheckpoint.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/ro/scripting/callbacks/OnPlayerLeaveCheckpoint.md",
"repo_id": "openmultiplayer",
"token_count": 611
} | 406 |
---
title: OnPlayerWeaponShot
description: Acest callback este apelat atunci când un jucător trage o lovitură dintr-o armă.
tags: ["player"]
---
## Descriere
Acest callback este apelat atunci când un jucător trage o lovitură dintr-o armă. Sunt acceptate doar armele cu gloanțe. Este acceptată doar trecerea pasagerilor (nu șoferul și nu loviturile de vrăbii de mare/vânători).
| Nume | Descriere |
|-------------------------|----------------------------------------------------------------------------------------------------------------------|
| playerid | ID-ul jucătorului care a împușcat o armă. |
| WEAPON:weaponid | ID-ul [armei](../resources/weaponids) împușcat de jucător. |
| BULLET_HIT_TYPE:hittype | [Tipul](../resources/bullethittypes) a obiectului lovit (niciunul, jucătorul, vehiculul sau obiectul (jucătorului)). |
| hitid | ID-ul jucătorului, vehiculului sau obiectului care a fost lovit. |
| Float:fX | Coordonata X pe care a lovit împușcătura. |
| Float:fY | Coordonata Y pe care a lovit împușcătura. |
| Float:fZ | Coordonata Z pe care a lovit împușcătura. |
## Returnări
0 - Preveniți glonțul să provoace daune.
1 - Lăsați glonțul să provoace daune.
Este întotdeauna numit primul în filterscript-uri, așa că returnarea 0 acolo blochează și alte scripturi să-l vadă.
## Exemple
```c
public OnPlayerWeaponShot(playerid, WEAPON:weaponid, BULLET_HIT_TYPE:hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
new szString[144];
format(szString, sizeof(szString), "Arma %i trasă. hittype: %i hitid: %i poziție: %f, %f, %f", weaponid, hittype, hitid, fX, fY, fZ);
SendClientMessage(playerid, -1, szString);
return 1;
}
```
## Note
:::tip
Acest apel invers este apelat numai când este activată compensarea întârzierii. Dacă hittype este:
- `BULLET_HIT_TYPE_NONE`: parametrii fX, fY și fZ sunt coordonate normale, vor da 0,0 pentru coordonate dacă nu a fost lovit nimic (de exemplu, obiect îndepărtat pe care glonțul nu poate ajunge);
- Altele: fX, fY și fZ sunt decalaje relativ la hitid.
:::
:::tip
[GetPlayerLastShotVectors](../functions/GetPlayerLastShotVectors) poate fi folosit în acest apel invers pentru informații mai detaliate despre vectorul glonț.
:::
:::warning
Bug(e) cunoscut(e):
- nu este apelat dacă ați tras în vehicul ca șofer sau dacă vă uitați în spate cu scopul activat (trageți în aer).
- Se numește `BULLET_HIT_TYPE_VEHICLE` cu hitidul corect (vehiculul jucătorului lovit) dacă împușci un jucător care se află într-un vehicul. Nu va fi numit deloc `BULLET_HIT_TYPE_PLAYER`.
- Remediat parțial în SA-MP 0.3.7: Dacă date false ale armelor sunt trimise de un utilizator rău intenționat, alți clienți jucători se pot bloca sau se pot bloca. Pentru a combate acest lucru, verificați dacă arma raportată poate de fapt să tragă gloanțe.
:::
## Funcții similare
- [GetPlayerLastShotVectors](../functions/GetPlayerLastShotVectors): Preia vectorului ultimei lovituri trase de un jucator. | openmultiplayer/web/docs/translations/ro/scripting/callbacks/OnPlayerWeaponShot.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/ro/scripting/callbacks/OnPlayerWeaponShot.md",
"repo_id": "openmultiplayer",
"token_count": 1930
} | 407 |
---
title: AddMenuItem
description: Adaugă un element la un meniu specificat.
tags: ["menu"]
---
## Descriere
Adaugă un element la un meniu specificat.
| Nume | Descriere |
| ------- | ------------------------------------------ |
| menuid | ID-ul meniului pentru a adăuga un element. |
| column | Coloana la care se adaugă elementul. |
| title[] | Titlul pentru noul element de meniu. |
## Se intoarce
Indexul rândului la care a fost adăugat acest element.
## Exemple
```c
new Menu:gExampleMenu;
public OnGameModeInit()
{
gExampleMenu = CreateMenu("Your Menu", 2, 200.0, 100.0, 150.0, 150.0);
AddMenuItem(gExampleMenu, 0, "item 1");
AddMenuItem(gExampleMenu, 0, "item 2");
return 1;
}
```
## Note
:::tip
Se blochează la trecerea unui ID de meniu nevalid. Puteți avea doar 12 elemente pe meniu (al 13-lea merge în partea dreaptă a antetului numelui coloanei (colorat), al 14-lea și superior nu este afișat deloc). Puteți utiliza doar 2 coloane (0 și 1). Puteți adăuga doar 8 coduri de culoare pentru un singur articol (~ r ~, ~ g ~ etc.). Lungimea maximă a elementului de meniu este de 31 de simboluri.
:::
## Funcții conexe
- [CreateMenu](CreateMenu.md): Creați un meniu.
- [SetMenuColumnHeader](SetMenuColumnHeader.md): Setați antetul pentru una dintre coloanele dintr-un meniu.
- [DestroyMenu](DestroyMenu.md): Distrugeți un meniu.
- [OnPlayerSelectedMenuRow](../callbacks/OnPlayerSelectedMenuRow.md): Apelat atunci când un jucător a selectat un rând dintr-un meniu.
- [OnPlayerExitedMenu](../callbacks/OnPlayerExitedMenu.md): Apelat când un jucător iese din meniu.
| openmultiplayer/web/docs/translations/ro/scripting/functions/AddMenuItem.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/ro/scripting/functions/AddMenuItem.md",
"repo_id": "openmultiplayer",
"token_count": 681
} | 408 |
---
title: "Noțiuni de bază: Variabile"
description: Un ghid pentru începători pentru variabilele din Pawn
---
## Variabile
Unul dintre cele mai importante concepte din programare este conceptul de 'variabile'. În programare, o variabilă este o entitate care poate fi schimbată, dar în ceea ce privește ce? În limba Pawn, o variabilă deține o 'valoare' în orice moment și acea valoare - așa cum sugerează și numele - este 'variabilă' sau 'schimbabilă'.
Motivul pentru care variabilele sunt atât de importante se datorează faptului că sunt în esență unități mici de memorie de calculator care pot păstra sau 'aminti' diferite valori în timp ce programul este în curs de execuție (rulează), iar această proprietate se dovedește a fi foarte utilă în programare. De exemplu, doriți să țineți evidența scorurilor a 100 de jucători într-un joc, o puteți face cu ușurință programând computerul pentru a stoca (amintiți-vă) și a actualiza acele valori. Mai târziu, dacă doriți să găsiți scorul mediu al acelor jucători sau doriți să creați un clasament, acele valori din variabile pot fi ușor accesate și utilizate în acest scop.
### Declararea variabilelor
Urmează sintaxa pentru declarația variabilă:
```c
// Creating (more appropriately, 'declaring') a variable named 'myVariable
new myVariable;
// The 'new' keyword is used for declaring a variable
// In the above line a variable is declared with the name 'myVariable'
// Semi-colon is used in the end to close the declaration statement.
```
Sintaxa declarației poate fi mai bine înțeleasă examinând câteva exemple:
```c
new var;
new ammo;
new score;
new vehicles;
new topScore;
```
Fiecare dintre variabilele definite mai sus are o valoare implicită, care este zero. Există diferite moduri de atribuire a valorilor unei variabile. O metodă este atribuirea directă a unei variabile în timp ce este declarată:
```c
new letters = 25;
```
În exemplul de mai sus, este declarată o variabilă numită 'litere', cu o valoare de 25. Veți observa un semn egal care este un simplu Operator de atribuire care poate fi utilizat pentru atribuirea de valori variabilelor. Evaluează expresia din dreapta și atribuie valoarea rezultată variabilei la care se face referire în partea stângă. În afară de atribuirea valorilor direct la declarație, o puteți face și în părțile ulterioare ale codului:
```c
new letters;
letters = 25;
```
### Domenii de aplicare
Modificarea valorii unei variabile este posibilă numai dacă partea codului în care faceți referire la variabilă se află în sfera acelei variabile. Domeniul de aplicare al unei variabile depinde de blocul de cod sau poziția în care a fost declarată variabila respectivă. De exemplu, o variabilă declarată în afara oricărui bloc de cod, de obicei la începutul scriptului, are un domeniu 'Global' și poate fi accesată de oriunde din script:
```c
#include <a_samp>
new g_var = 5;
public OnFilterScriptInit ()
{
g_var = 10;
printf ("The value is %i", g_var);
return 1;
}
public OnPlayerConnect (playerid)
{
g_var = 100;
printf ("The value is %i", g_var);
return 1;
}
// Output :
// The value is 10
// The value is 100
// Note: The second output line is shown only when a player connects.
```
În afară de variabilele 'globale' (cu scop), există variabile 'locale' sau 'private' care pot fi accesate numai din interiorul blocului de cod unde au fost declarate.
```c
#include <a_samp>
public OnFilterScriptInit ()
{
new localVar;
localVar = 5;
return 1;
}
public OnPlayerConnect (playerid)
{
localVar = 10; // This line will show an error upon compilation
return 1;
}
```
Dacă încercați să compilați codul de mai sus, compilatorul va afișa o eroare care este rezonabilă, deoarece o variabilă locală face referințe într-un bloc complet diferit de cod. Notă: Dacă este un bloc de cod imbricat, atunci variabila poate fi accesată de acolo.
Un lucru important de remarcat este că nu puteți declara variabile cu aceleași nume dacă scopurile lor intercedează. De exemplu, dacă aveți deja o variabilă numită 'scor' pe un domeniu global, nu puteți crea o altă variabilă numită 'punctaj' pe domeniul global, precum și una locală, iar acest lucru este valabil și pentru invers (dacă au deja o variabilă locală, evitați declararea unei variabile globale cu același nume).
```c
#include <a_samp>
new g_score;
public OnFilterScriptInit ()
{
new g_score = 5; // This line will show an error.
return 1;
}
```
### Reguli de denumire
Acum că știți cum să declarați variabile, trebuie să cunoașteți regulile de denumire pentru declararea variabilei care sunt enumerate mai jos:
- Toate numele variabilelor trebuie să înceapă cu o literă sau o subliniere (`_`)
- După prima literă inițială, numele variabilelor pot conține litere și cifre, dar nu spații sau caractere speciale.
- Numele variabilelor sunt sensibile la majuscule, adică literele majuscule sunt distincte de literele mici.
- Utilizarea unui cuvânt rezervat (cuvânt cheie) ca nume de variabilă va afișa o eroare.
#### Exemple:
```c
new new; // Incorrect : Using a reserved word
new _new; // Correct
new 10letters; // Incorrect : Name starting with a number
new letters10; // Correct
new letters_10; // Correct
new my name; // Incorrect : Space in the name
new my_name; // Correct
new !nternet; // Incorrect
new Internet; // Correct
```
### Stocarea diferitelor tipuri de date
După aceea, acum să analizăm câteva exemple despre ce tipuri de date pot fi stocate în variabilă și cum:
```c
new letter = 'M';
new value = 100;
new decimalValue = 1.0;
// Works, but will show a compiler warning
// warning 213: tag mismatch
new engineOn = true;
// Works, and will not show a compiler warning but using a Tag is suggested
new sentence = "This is a sentence";
// Will show an error.
// error 006: must be assigned to an array
```
O variabilă este capabilă să dețină un caracter, valoare întreagă, booleană (adevărată sau falsă) și o valoare float (valoare zecimală). Comentariile din codul de mai sus arată că stocarea unui șir într-o variabilă duce la o eroare (deoarece șirurile pot fi stocate numai în _Arrays_). În afară de aceasta, atribuirea unei valori float unei variabile va duce la un avertisment al compilatorului, care poate fi evitat prin adăugarea de 'etichete'. Fără etichete adecvate, scriptul va afișa avertismente la compilare, dar va fi executabil. Etichetele spun compilatorului despre tipul de date care este destinat să fie stocat în variabilă, care la rândul nostru ne informează sub formă de erori sau avertisment dacă facem o greșeală de rupere a programului în cod. Exemplu de etichete:
```c
new decimalValue = 1.0; // Incorrect
new bool: decimalValue = 1.0 // Incorrect
new Float: decimalValue = 1.0; // Correct
new switchOn = 1.0; // Incorrect
new switchOn = true; // Incorrect, doesn't show a warning
new bool: switchOn = true; // Correct
```
Utilizarea etichetelor corecte este importantă pentru a evita orice erori sau erori în timpul executării programului.
Pawnul fiind un limbaj fără tip ne permite să stocăm diferite tipuri de date în aceeași variabilă, care poate fi utilă în unele cazuri și supărătoare în altele, dar o astfel de utilizare a variabilelor nu este recomandată.
```c
#include <a_samp>
public OnFilterScriptInit ()
{
new var ;
var = 'a';
printf ("%c", var);
var = 1;
printf ("%d", var);
var = 1.0;
printf ("%f", var);
var = true;
printf ("%d", var); // prints a value 0 or 1
return 1;
}
// Output :
a
1
1.000000
1
```
| openmultiplayer/web/docs/translations/ro/scripting/language/Variables.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/ro/scripting/language/Variables.md",
"repo_id": "openmultiplayer",
"token_count": 3098
} | 409 |
---
title: ID-urile de vreme
---
Se foloseste in [SetWeather](../functions/SetWeather) si [SetPlayerWeather](../functions/SetPlayerWeather).
```c
0 = EXTRASUNNY_LA
1 = SUNNY_LA
2 = EXTRASUNNY_SMOG_LA
3 = SUNNY_SMOG_LA
4 = CLOUDY_LA
5 = SUNNY_SF
6 = EXTRASUNNY_SF
7 = CLOUDY_SF
8 = RAINY_SF
9 = FOGGY_SF
10 = SUNNY_VEGAS
11 = EXTRASUNNY_VEGAS (heat waves)
12 = CLOUDY_VEGAS
13 = EXTRASUNNY_COUNTRYSIDE
14 = SUNNY_COUNTRYSIDE
15 = CLOUDY_COUNTRYSIDE
16 = RAINY_COUNTRYSIDE
17 = EXTRASUNNY_DESERT
18 = SUNNY_DESERT
19 = SANDSTORM_DESERT
20 = UNDERWATER (greenish, foggy)
```
Există 21 de ID-uri meteo diferite (0-20), cu toate acestea jocul nu prezintă niciun interval de verificare a identificărilor meteo și astfel puteți utiliza ID-uri meteo până la 255. Valorile mai mari de 255 sau mai mici de 0 sunt transformate în restul diviziei de către 256 (de exemplu, vremea ID 300 este identică cu ID 44, deoarece 300% 256 = 44). ID-urile meteo 0-22 par să funcționeze corect, dar alte ID-uri duc la efecte ciudate, cum ar fi cerul roz și texturile intermitente în anumite perioade. :::note
- Unele vremuri apar foarte diferite în anumite momente. Poti sa vezi [aici](http://hotmist.ddo.jp/id/weatherhtml) cum arată diferite tipuri meteo în momente diferite.
- [GTA San Andreas weather gallery](https://dev.prineside.com/en/gtasa_weather_id/) explică situația cu ID-urile meteo mai bine decât orice cuvinte. De asemenea, îl puteți utiliza dacă doriți să vizualizați vremea în anumite momente și să căutați vreme problematică care să provoace efecte ciudate.
:::
| openmultiplayer/web/docs/translations/ro/scripting/resources/weatherid.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/ro/scripting/resources/weatherid.md",
"repo_id": "openmultiplayer",
"token_count": 701
} | 410 |
---
title: Minunatii
description: O listă organizată de instrumente utile, biblioteci și pluginuri pentru dezvoltarea SA-MP.
---
## Unelte
- **_[Community Compiler](https://github.com/pawn-lang/compiler/)_** - O versiune foarte actualizată a compilatorului, cu multe remedieri și îmbunătățiri.
- **_[sampctl](http://sampctl.com/)_** - Manager de pachete pentru instalarea bibliotecilor și rularea serverului dvs.
- **_[Plugin Runner](https://github.com/Zeex/samp-plugin-runner/)_** - Instrument pentru a rula o versiune ușoară a serverului direct din linia de comandă (nu este necesar server.cfg) pentru testarea pluginurilor.
## Librarii
- **_[SA:MP stdlib](https://github.com/pawn-lang/samp-stdlib/)_** - Versiunile actualizate ale valorii implicite includ. `const`-corect, documentat și complet.
- **_[fixes.inc](https://github.com/pawn-lang/sa-mp-fixes/)_** - Remedii extrem de optimizate pentru un număr mare de erori de server SA: MP. Conectează și utilizează.
- **_[YSI](https://github.com/pawn-lang/YSI-Includes/)_** - Cea mai veche, cea mai mare, cea mai testată și bine susținută bibliotecă pentru SA: MP / pion, oferind un număr imens de noi caracteristici de joc și limbă.
- **_[amx_assembly](https://github.com/Zeex/amx_assembly/)_** - Acces la nivel scăzut la scriptul pawn în sine.
- **_[indirection](https://github.com/Y-Less/indirection/)_** - Sistem pentru trecerea pointerilor și apelarea funcțiilor indirect, cu metode abstracte de personalizare a apelurilor.
- **_[code-parse.inc](https://github.com/Y-Less/code-parse.inc/)_** - Analizați și personalizați codul de amanet la compilare.
## Pluginuri
- **_[crashdetect](https://github.com/Zeex/samp-plugin-crashdetect/)_** - Instrument de dezvoltare pentru a găsi erori în timpul testării.
- **_[JIT](https://github.com/Zeex/samp-plugin-jit/)_** - După ce codul dvs. este stabil, utilizați acest lucru pentru a-l accelera semnificativ.
- **_[sscanf](https://github.com/Y-Less/sscanf/)_** - Convertiți șirurile în valori multiple, ints, floats, jucători etc.
- **_[MySQL](https://github.com/pBlueG/SA-MP-MySQL/)_** - Conectați-vă serverul la un server MySQL.
- **_[streamer](https://github.com/samp-incognito/samp-streamer-plugin/)_** - Ocoliți multe limite SA: MP, cum ar fi obiectele și pickup-urile.
| openmultiplayer/web/docs/translations/ro/x-awesome.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/ro/x-awesome.md",
"repo_id": "openmultiplayer",
"token_count": 953
} | 411 |
---
title: AddStaticPickup
description: Эта функция добавляет статический пикап в игру.
tags: []
---
## Описание
Эта функция добавляет статический пикап в игру. Эти пикапы поддерживают: оружие, здоровье, броня и т.д., с возможностью работы этих функций без скрипта (оружие/здоровье/броня будет выдано автоматически если в параметре ```model``` указан соответствующий ID).
| Параметр | Описание |
| ----------------------------------- | ----------------------------------------------------------------------------------- |
| [model](../resources/pickupids) | Модель пикапа. |
| [type](../resources/pickuptypes) | Тип пикапа. Определяет реакцию пикапа при поднятии. |
| Float:X | Координата X для создания пикапа. |
| Float:Y | Координата Y для создания пикапа. |
| Float:Z | Координата Z для создания пикапа. |
| virtualworld | ID виртуального мира в который следует поместить пикап (-1 чтобы поместить во все миры). |
## Возвращаемые данные
1: пикап был успешно создан.
0: не удалось создать пикап.
## Примеры
```c
public OnGameModeInit()
{
// Создание пикапа с броней
AddStaticPickup(1242, 2, 1503.3359, 1432.3585, 10.1191, 0);
// Создание пикапа со здоровьем, рядом с броней
AddStaticPickup(1240, 2, 1506.3359, 1432.3585, 10.1191, 0);
return 1;
}
```
## Примечания
:::tip
Эта функция не возвращает ID пикапа который можно использовать, к примеру в OnPlayerPickUpPickup. Используйте CreatePickup если хотите получить ID.
:::
## Связанные функции
- [CreatePickup](CreatePickup): Создать пикап.
- [DestroyPickup](DestroyPickup): Уничтожить пикап.
- [OnPlayerPickUpPickup](../callbacks/OnPlayerPickUpPickup): Вызывается когда игрок подбирает пикап.
| openmultiplayer/web/docs/translations/ru/scripting/functions/AddStaticPickup.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/ru/scripting/functions/AddStaticPickup.md",
"repo_id": "openmultiplayer",
"token_count": 1704
} | 412 |
---
title: OnDialogResponse
description: Ta "callback" se pokliče, ko se predvajalnik odzove na pogovorno okno, imenovano "ShowPlayerDialog", s klikom na gumb, s pritiskom na tipko ENTER / ESC ali z dvoklikom na element seznama (če uporabljate pogovorno okno sloga "seznam").
tags: []
---
## Opis
Ta "callback" se pokliče, ko se predvajalnik odzove na pogovorno okno s funkcijo "ShowPlayerDialog" s klikom na gumb, s pritiskom na tipko ENTER/ESC ali z dvojnim klikom na element seznama (če uporabljate pogovorno okno sloga seznama).
| Ime | Opis |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| playerid | ID igralca, ki se je odzval na dialog. |
| dialogid | ID pogovornega okna, na katerega se je predvajalnik odzval, dodeljena iz "ShowPlayerDialog". |
| response | 1 za levi in 0 za desni gumb (če je prikazan samo en gumb, vedno 1). |
| listitem | ID seznama elementa, ki ga je izbrala naprava (začne se pri 0) (samo če uporabljate pogovorno okno za slog seznama, sicer bo -1). |
| inputtext[] | Besedilo vneseno v "input box" s strani igralca ali besedilo izbranega elementa seznama. |
## Returns
Vedno je bila povabljena prva v "filterscript" torej vrnite 1 tam blokira ostale "filterscript" da glej jo.
## Primeri
```c
// Določimo ID pogovornega okna, da lahko upravljamo odzive
#define DIALOG_RULES 1
// V ukazu pokažemo ta dialog
ShowPlayerDialog(playerid, DIALOG_RULES, DIALOG_STYLE_MSGBOX, "Pravila strežnika ", "- Brez nedovoljeni pripomočki\n- Brez Spam\n- Spoštuj Admine \n\nSe strinjate s pravili? ", "Da", "Ne");
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if (dialogid == DIALOG_RULES)
{
if (response) // Če so kliknili 'Da' ali pritisnili ENTER
{
SendClientMessage(playerid, COLOR_GREEN, "Hvala, ker ste sprejeli pravila!");
}
else // Če so kliknili ESC ali pritisnili 'Ne'
{
Kick(playerid);
}
return 1; // Pogovorno okno smo upravljali, tako da vrnemo 1. Enako kot v "OnPlayerCommandText".
}
return 0; // Tukaj morate vrniti 0! Kot v "OnPlayerCommandText".
}
// definiramo drug dialog, mu damo eno večjo vrednost kot prejšnjemu
#define DIALOG_LOGIN 2
// V ukazu pokažemo ta dialog
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Vpiši se ", "Prosimo vnesite svoje geslo:", "Vpiši se", "Odnehaj");
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if (dialogid == DIALOG_LOGIN)
{
if (!response) // Če bi kliknili 'Odnehaj' ali pritisnite ESC
{
Kick(playerid);
}
else // Aki so pritisnili ENTER ali kliknili 'Vpiši se'
{
if (CheckPassword(playerid, inputtext))
{
SendClientMessage(playerid, COLOR_RED, "Uspešno ste prijavljeni!");
}
else
{
SendClientMessage(playerid, COLOR_RED, "PRIJAVA NI USPELA.");
// Ponovno pokažite pogovorno okno predvajalniku
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Vpiši se", "Prosimo vnesite svoje geslo:", "Vpiši se", "Odnehaj");
}
}
return 1; // Pogovorno okno smo upravljali, tako da vrnemo 1. Enako kot v "OnPlayerCommandText".
}
return 0; // Tukaj morate vrniti 0! Kot v "OnPlayerCommandText".
}
// definiramo tretje pogovorno okno, spet je vrednost večja od vrednosti prejšnjega pogovornega okna
#define DIALOG_WEAPONS 3
// V ukazu pokažemo ta dialog
ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Orožje ", "Desert Eagle\nAK-47\nCombat Shotgun", "Izaberi", "Odnehaj");
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if (dialogid == DIALOG_WEAPONS)
{
if (response) // Če so pritisnili 'Izberi' ali dvokliknili na element seznama
{
// Daje jim orožje
switch(listitem)
{
case 0: GivePlayerWeapon(playerid, WEAPON_DEAGLE, 14); // Daje jim desert eagle
case 1: GivePlayerWeapon(playerid, WEAPON_AK47, 120); // Daje jim AK-47
case 2: GivePlayerWeapon(playerid, WEAPON_SHOTGSPA, 28); // Daje jim Combat Shotgun
}
}
return 1; // Pogovorno okno smo upravljali, tako da vrnemo 1. Enako kot v "OnPlayerCommandText".
}
return 0; // Tukaj morate vrniti 0! Kot v "OnPlayerCommandText".
}
// to je še en način prikaza in upravljanja za tretje pogovorno okno
#define DIALOG_WEAPONS 3
// Prikažemo ga v ukazu
ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Orožje",
"Weapon\tAmmo\tPrice\n\
M4\t120\t500\n\
MP5\t90\t350\n\
AK-47\t120\t400",
"Izaberi", "Odnehaj");
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if (dialogid == DIALOG_WEAPONS)
{
if (response) // Če je pritisnil 'Select' ali dvakrat pritisnil orožje
{
// Daje jim orožje
switch(listitem)
{
case 0: GivePlayerWeapon(playerid, WEAPON_M4, 120); // Daje jim M4
case 1: GivePlayerWeapon(playerid, WEAPON_MP5, 90); // Daje jim MP5
case 2: GivePlayerWeapon(playerid, WEAPON_AK47, 120); // Daje jim AK-47
}
}
return 1; // Pogovorno okno smo upravljali, tako da vrnemo 1. Enako kot v "OnPlayerCommandText".
}
return 0; // Tukaj morate vrniti 0! Kot v "OnPlayerCommandText".
}
```
## Opombe
:::tip
Parametri lahko vsebujejo različne vrednosti, odvisno od sloga pogovornega okna ([Kliknite za več primerov](../resources/dialogstyles.md)).
:::
:::tip
Če jih imate, je priročno preklapljati med različnimi dialogi.
:::
:::warning
Pogovorno okno predvajalnika se ne skrije ob ponovnem zagonu igralnega načina, zaradi česar strežnik natisne "Opozorilo: PlayerDialogResponse PlayerId: 0 ID pogovornega okna se ne ujema z zadnjim poslanim ID-jem pogovornega okna" (Prevod: PlayerDialogResponse PlayerId: 0), če se je igralec po dialogu odzval po ponovni zagon.
:::
## Povezane Funkcijo
- [ShowPlayerDialog](../functions/ShowPlayerDialog.md): Pokaži pogovorno okno predvajalniku.
| openmultiplayer/web/docs/translations/sl/scripting/callbacks/OnDialogResponse.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/sl/scripting/callbacks/OnDialogResponse.md",
"repo_id": "openmultiplayer",
"token_count": 3283
} | 413 |
---
title: Ban
description: Banuje igraca koji je trenutno na serveru.
tags: ["administration"]
---
## Opis
Banuje igraca koji je trenutno na serveru. Vise nece moci da udju na server. Ban je IP-baziran i bice sacuvam u samp.ban fajlu u server folderu. BanEx se moze koristiti da bi se dao razlog ban-u. IP ban se moze dodati/obrisati koristeci RCON banip i unbanip komande (SendRconCommand).
| Ime | Opis |
| -------- | ------------------------- |
| playerid | ID igraca koji se banuje. |
## Vracanje
Ova funkcija ne vraca nikakvu specificnu vrednost.
## Primeri
```c
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/banme", true) == 0)
{
// Banuje igraca koji ukuca ovu komandu
Ban(playerid);
return 1;
}
}
// Da bi prikazali poruku ( razlog ) igracu pre nego sto ga izbaci sa servera
// moramo koristiti timer da bi napravili razmak. Ovaj razmak mora biti samo par milisekundi,
// ali ovaj primer koristi punu sekundu cisto da bi bili sigurni.
forward DelayedBan(playerid);
public DelayedBan(playerid)
{
Ban(playerid);
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/banme", true) == 0)
{
// Banuje igraca koji ukuca komandu
// Prvo posaljemo poruku
SendClientMessage(playerid, 0xFF0000FF, "Banovan si sa servera!");
// Banuje ih sekundu kasnije da bi prikazalo poruku iznad
SetTimerEx("DelayedBan", 1000, false, "d", playerid);
return 1;
}
return 0;
}
```
## Beleske
:::warning
Svaka akcija odmah pre Ban(), kao sto je slanje poruka sa SendClientMessage, nece doci do igraca. Mora se postaviti timer da bi se napravio vremenski razmak ban-a.
:::
## Srodne Funkcije
- [BanEx](BanEx): Banuje igraca sa razlogom.
- [Kick](Kick): Izbaci igraca sa servera(KICK).
| openmultiplayer/web/docs/translations/sr/scripting/functions/Ban.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/sr/scripting/functions/Ban.md",
"repo_id": "openmultiplayer",
"token_count": 810
} | 414 |
---
title: OnActorStreamIn
description: Callback นี้ถูกเรียกเมื่อแอคเตอร์ถูกสตรีมเข้าโดยไคลเอนต์ของผู้เล่น
tags: []
---
:::warning
Callback นี้ถูกเพิ่มใน SA-MP 0.3.7 และจะไม่ทำงานในเวอร์ชั่นก่อนหน้านี้!
:::
## คำอธิบาย
Callback นี้ถูกเรียกเมื่อแอคเตอร์ถูกสตรีมเข้าโดยไคลเอนต์ของผู้เล่น
| ชื่อ | คำอธิบาย |
| ----------- | ------------------------------------ |
| actorid | ไอดีของแอคเตอร์ที่สตรีมเข้าหาผู้เล่น |
| forplayerid | ไอดีของผู้เล่นที่แอคเตอร์สตรีมเข้าหา |
## ส่งคืน
จะถูกเรียกใน Filterscripts ก่อนเป็นอันดับแรกเสมอ
## ตัวอย่าง
```c
public OnActorStreamIn(actorid, forplayerid)
{
new string[40];
format(string, sizeof(string), "ตอนนี้แอคเตอร์ %d ได้สตรีมเข้าหาคุณ", actorid);
SendClientMessage(forplayerid, 0xFFFFFFFF, string);
return 1;
}
```
## บันทึก
:::tip
NPC สามารถเรียก Callback นี้ได้
:::
## ฟังก์ชั่นที่เกี่ยวข้องกัน
| openmultiplayer/web/docs/translations/th/scripting/callbacks/OnActorStreamIn.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/th/scripting/callbacks/OnActorStreamIn.md",
"repo_id": "openmultiplayer",
"token_count": 1002
} | 415 |
---
title: OnPlayerConnect
description: This callback is called when a player connects to the server.
tags: ["player"]
---
## คำอธิบาย
This callback is called when a player connects to the server.
| Name | Description |
| -------- | ------------------------------------ |
| playerid | The ID of the player that connected. |
## ส่งคืน
0 - Will prevent other filterscripts from receiving this callback.
1 - Indicates that this callback will be passed to the next filterscript.
มันถูกเรียกในฟิลเตอร์สคริปต์ก่อนเสมอ
## ตัวอย่าง
```c
public OnPlayerConnect(playerid)
{
new
string[64],
playerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
format(string, sizeof string, "%s has joined the server. Welcome!", playerName);
SendClientMessageToAll(0xFFFFFFAA, string);
return 1;
}
```
## บันทึก
:::tip
NPC สามารถเรียก Callback นี้ได้
:::
## ฟังก์ชั่นที่เกี่ยวข้องกัน
| openmultiplayer/web/docs/translations/th/scripting/callbacks/OnPlayerConnect.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/th/scripting/callbacks/OnPlayerConnect.md",
"repo_id": "openmultiplayer",
"token_count": 511
} | 416 |
---
title: OnPlayerLeaveRaceCheckpoint
description: This callback is called when a player leaves the race checkpoint.
tags: ["player", "checkpoint", "racecheckpoint"]
---
## คำอธิบาย
This callback is called when a player leaves the race checkpoint.
| Name | Description |
| -------- | --------------------------------------------------- |
| playerid | The ID of the player that left the race checkpoint. |
## ส่งคืน
มันถูกเรียกในฟิลเตอร์สคริปต์ก่อนเสมอ
## ตัวอย่าง
```c
public OnPlayerLeaveRaceCheckpoint(playerid)
{
printf("Player %d left a race checkpoint!", playerid);
return 1;
}
```
## บันทึก
:::tip
NPC สามารถเรียก Callback นี้ได้
:::
## ฟังก์ชั่นที่เกี่ยวข้องกัน
- [SetPlayerCheckpoint](../../scripting/functions/SetPlayerCheckpoint.md): Create a checkpoint for a player.
- [DisablePlayerCheckpoint](../../scripting/functions/DisablePlayerCheckpoint.md): Disable the player's current checkpoint.
- [IsPlayerInCheckpoint](../../scripting/functions/IsPlayerInRaceCheckpoint.md): Check if a player is in a checkpoint.
- [SetPlayerRaceCheckpoint](../../scripting/functions/SetPlayerRaceCheckpoint.md): Create a race checkpoint for a player.
- [DisablePlayerRaceCheckpoint](../../scripting/functions/DisablePlayerRaceCheckpoint.md): Disable the player's current race checkpoint.
- [IsPlayerInRaceCheckpoint](../../scripting/functions/IsPlayerInRaceCheckpoint.md): Check if a player is in a race checkpoint.
| openmultiplayer/web/docs/translations/th/scripting/callbacks/OnPlayerLeaveRaceCheckpoint.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/th/scripting/callbacks/OnPlayerLeaveRaceCheckpoint.md",
"repo_id": "openmultiplayer",
"token_count": 631
} | 417 |
---
title: OnRconCommand
description: This callback is called when a command is sent through the server console, remote RCON, or via the in-game "/rcon command".
tags: []
---
## คำอธิบาย
This callback is called when a command is sent through the server console, remote RCON, or via the in-game "/rcon command".
| Name | Description |
| ----- | --------------------------------------------------------------------------------- |
| cmd[] | A string containing the command that was typed, as well as any passed parameters. |
## ส่งคืน
It is always called first in filterscripts so returning 1 there blocks gamemode from seeing it.
## ตัวอย่าง
```c
public OnRconCommand(cmd[])
{
printf("[RCON]: You typed '/rcon %s'!", cmd);
return 0;
}
public OnRconCommand(cmd[])
{
if (!strcmp(cmd, "hello", true))
{
SendClientMessageToAll(0xFFFFFFAA, "Hello World!");
print("You said hello to the world."); // This will appear to the player who typed the rcon command in the chat in white
return 1;
}
return 0;
}
```
## บันทึก
:::tip
"/rcon " is not included in "cmd" when a player types a command. If you use the "print" function here, it will send a message to the player who typed the command in-game as well as the log. This callback is not called when the player is not logged in as RCON admin. When the player is not logged in as RCON admin and uses /rcon login, this callback will not be called and OnRconLoginAttempt is called instead. However, when the player is logged in as RCON admin, the use of this command will call this callback.
:::
:::warning
You will need to include this callback in a loaded filterscript for it to work in the gamemode!
:::
## ฟังก์ชั่นที่เกี่ยวข้องกัน
- [IsPlayerAdmin](../../scripting/functions/IsPlayerAdmin.md): Checks if a player is logged into RCON.
- [OnRconLoginAttempt](../../scripting/callbacks/OnRconLoginAttempt.md): Called when an attempt to login to RCON is made.
| openmultiplayer/web/docs/translations/th/scripting/callbacks/OnRconCommand.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/th/scripting/callbacks/OnRconCommand.md",
"repo_id": "openmultiplayer",
"token_count": 741
} | 418 |
---
title: AddPlayerClass
description: Adds a class to class selection.
tags: ["player"]
---
## คำอธิบาย
Adds a class to class selection. Classes are used so players may spawn with a skin of their choice.
| Name | Description |
| ------------- | ------------------------------------------------------------- |
| modelid | The skin which the player will spawn with. |
| Float:spawn_x | The X coordinate of the spawnpoint of this class. |
| Float:spawn_y | The Y coordinate of the spawnpoint of this class. |
| Float:spawn_z | The Z coordinate of the spawnpoint of this class. |
| Float:z_angle | The direction in which the player should face after spawning. |
| weapon1 | The first spawn-weapon for the player. |
| weapon1_ammo | The amount of ammunition for the primary spawn weapon. |
| weapon2 | The second spawn-weapon for the player. |
| weapon2_ammo | The amount of ammunition for the second spawn weapon. |
| weapon3 | The third spawn-weapon for the player. |
| weapon3_ammo | The amount of ammunition for the third spawn weapon. |
## ส่งคืน
The ID of the class which was just added.
319 if the class limit (320) was reached. The highest possible class ID is 319.
## ตัวอย่าง
```c
public OnGameModeInit()
{
// Players can spawn with either the CJ skin (0) or The Truth skin (1).
AddPlayerClass(0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0); // CJ
AddPlayerClass(1, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0); // The Truth
return 1;
}
```
## บันทึก
:::tip
The maximum class ID is 319 (starting from 0, so a total of 320 classes). When this limit is reached, any more classes that are added will replace ID 319.
:::
## ฟังก์ชั่นที่เกี่ยวข้องกัน
- [AddPlayerClassEx](../../scripting/functions/AddPlayerClassEx.md): Add a class with a default team.
- [SetSpawnInfo](../../scripting/functions/SetSpawnInfo.md): Set the spawn setting for a player.
- [SetPlayerSkin](../../scripting/functions/SetPlayerSkin.md): Set a player's skin.
| openmultiplayer/web/docs/translations/th/scripting/functions/AddPlayerClass.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/AddPlayerClass.md",
"repo_id": "openmultiplayer",
"token_count": 920
} | 419 |
---
title: AttachCameraToPlayerObject
description: Attaches a player's camera to a player-object.
tags: ["player"]
---
## คำอธิบาย
Attaches a player's camera to a player-object. The player is able to move their camera while it is attached to an object. Can be used with MovePlayerObject and AttachPlayerObjectToVehicle.
| Name | Description |
| -------------- | ------------------------------------------------------------------------------ |
| playerid | The ID of the player which will have their camera attached to a player-object. |
| playerobjectid | The ID of the player-object to which the player's camera will be attached. |
## ส่งคืน
This function does not return any specific values.
## ตัวอย่าง
```c
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/attach", false))
{
new playerobject = CreatePlayerObject(playerid, 1245, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0);
AttachCameraToPlayerObject(playerid, playerobject);
SendClientMessage(playerid, 0xFFFFFFAA, "Your camera is now attached to an object.");
return 1;
}
return 0;
}
```
## บันทึก
:::tip
The player-object must be created before attempting to attach the player's camera to it.
:::
## ฟังก์ชั่นที่เกี่ยวข้องกัน
- [AttachCameraToObject](../../scripting/functions/AttachCameraToObject.md): Attachs the player's camera on an global object.
- [SetPlayerCameraPos](../../scripting/functions/SetPlayerCameraPos.md): Set a player's camera position.
- [SetPlayerCameraLookAt](../../scripting/functions/SetPlayerCameraLookAt.md): Set where a player's camera should face.
| openmultiplayer/web/docs/translations/th/scripting/functions/AttachCameraToPlayerObject.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/AttachCameraToPlayerObject.md",
"repo_id": "openmultiplayer",
"token_count": 665
} | 420 |
---
title: ClearActorAnimations
description: Clear any animations applied to an actor.
tags: []
---
:::warning
ฟังก์ชั่นนี้ถูกเพิ่มใน SA-MP 0.3.7 และจะไม่ทำงานในเวอร์ชั่นก่อนหน้านี้!
:::
## คำอธิบาย
Clear any animations applied to an actor.
| Name | Description |
| ------- | -------------------------------------------------------------------------- |
| actorid | The ID of the actor (returned by CreateActor) to clear the animations for. |
## ส่งคืน
1: The function executed successfully.
0: The function failed to execute. The actor specified does not exist.
## ตัวอย่าง
```c
new MyActor;
public OnGameModeInit()
{
MyActor = CreateActor(...);
}
// Somewhere else
ApplyActorAnimation(MyActor, ...);
// Somewhere else
ClearActorAnimations(MyActor);
```
## ฟังก์ชั่นที่เกี่ยวข้องกัน
- [ApplyActorAnimation](../../scripting/functions/ApplyActorAnimation.md): Apply an animation to an actor.
| openmultiplayer/web/docs/translations/th/scripting/functions/ClearActorAnimations.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/ClearActorAnimations.md",
"repo_id": "openmultiplayer",
"token_count": 506
} | 421 |
---
title: DeletePlayer3DTextLabel
description: Destroy a 3D text label that was created using CreatePlayer3DTextLabel.
tags: ["player", "3dtextlabel"]
---
## คำอธิบาย
Destroy a 3D text label that was created using CreatePlayer3DTextLabel.
| Name | Description |
| --------------- | --------------------------------------------------- |
| playerid | The ID of the player whose 3D text label to delete. |
| PlayerText3D:textid | The ID of the player's 3D text label to delete. |
## ส่งคืน
1: The function executed successfully.
0: The function failed to execute. This means the label specified doesn't exist.
## ตัวอย่าง
```c
new PlayerText3D:labelid = CreatePlayer3DTextLabel(...);
// Later...
DeletePlayer3DTextLabel(playerid, labelid);
```
## ฟังก์ชั่นที่เกี่ยวข้องกัน
- [Create3DTextLabel](../../scripting/functions/Create3DTextLabel.md): Create a 3D text label.
- [Attach3DTextLabelToPlayer](../../scripting/functions/Attach3DTextLabelToPlayer.md): Attach a 3D text label to a player.
- [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.
- [UpdatePlayer3DTextLabelText](../../scripting/functions/UpdatePlayer3DTextLabelText.md): Change the text of a player's 3D text label.
| openmultiplayer/web/docs/translations/th/scripting/functions/DeletePlayer3DTextLabel.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/DeletePlayer3DTextLabel.md",
"repo_id": "openmultiplayer",
"token_count": 599
} | 422 |
---
title: EditAttachedObject
description: Enter edition mode for an attached object.
tags: []
---
## คำอธิบาย
Enter edition mode for an attached object.
| Name | Description |
| -------- | ------------------------------------------------ |
| playerid | The ID of the player to enter in to edition mode |
| index | The index (slot) of the attached object to edit |
## ส่งคืน
1 on success and 0 on failure.
## ตัวอย่าง
```c
public OnPlayerSpawn(playerid)
{
SetPlayerAttachedObject(playerid, 0, 1337, 2);
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/edit", true))
{
EditAttachedObject(playerid, 0);
SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: You now edit your attached object on index slot 0!");
return 1;
}
return 0;
}
```
## บันทึก
:::tip
You can move the camera while editing by pressing and holding the spacebar (or W in vehicle) and moving your mouse.
:::
:::warning
Players will be able to scale objects up to a very large or negative value size. Limits should be put in place using OnPlayerEditAttachedObject to abort the edit.
:::
## ฟังก์ชั่นที่เกี่ยวข้องกัน
- [SetPlayerAttachedObject](../functions/SetPlayerAttachedObject): Attach an object to a player
- [RemovePlayerAttachedObject](../functions/RemovePlayerAttachedObject): Remove an attached object from a player
- [IsPlayerAttachedObjectSlotUsed](../functions/IsPlayerAttachedObjectSlotUsed): Check whether an object is attached to a player in a specified index
- [EditObject](../functions/EditObject): Edit an object.
- [EditPlayerObject](../functions/EditPlayerObject): Edit an object.
- [SelectObject](../functions/SelectObject): Select an object.
- [CancelEdit](../functions/CancelEdit): Cancel the edition of an object.
- [OnPlayerEditAttachedObject](../callbacks/OnPlayerEditAttachedObject): Called when a player finishes editing an attached object.
| openmultiplayer/web/docs/translations/th/scripting/functions/EditAttachedObject.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/EditAttachedObject.md",
"repo_id": "openmultiplayer",
"token_count": 700
} | 423 |
---
title: GangZoneDestroy
description: Destroy a gangzone.
tags: ["gangzone"]
---
## คำอธิบาย
Destroy a gangzone.
| Name | Description |
| ---- | ------------------------------ |
| zone | The ID of the zone to destroy. |
## ส่งคืน
This function does not return any specific values.
## ตัวอย่าง
```c
new gangzone;
gangzone = GangZoneCreate(1248.011, 2072.804, 1439.348, 2204.319);
GangZoneDestroy(gangzone);
```
## ฟังก์ชั่นที่เกี่ยวข้องกัน
- [GangZoneCreate](../functions/GangZoneCreate): Create a gangzone.
- [GangZoneShowForPlayer](../functions/GangZoneShowForPlayer): Show a gangzone for a player.
- [GangZoneShowForAll](../functions/GangZoneShowForAll): Show a gangzone for all players.
- [GangZoneHideForPlayer](../functions/GangZoneHideForPlayer): Hide a gangzone for a player.
- [GangZoneHideForAll](../functions/GangZoneHideForAll): Hide a gangzone for all players.
- [GangZoneFlashForPlayer](../functions/GangZoneFlashForPlayer): Make a gangzone flash for a player.
- [GangZoneFlashForAll](../functions/GangZoneFlashForAll): Make a gangzone flash for all players.
- [GangZoneStopFlashForPlayer](../functions/GangZoneStopFlashForPlayer): Stop a gangzone flashing for a player.
- [GangZoneStopFlashForAll](../functions/GangZoneStopFlashForAll): Stop a gangzone flashing for all players.
| openmultiplayer/web/docs/translations/th/scripting/functions/GangZoneDestroy.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/GangZoneDestroy.md",
"repo_id": "openmultiplayer",
"token_count": 513
} | 424 |
---
title: GetConsoleVarAsInt
description: Get the integer value of a console variable.
tags: []
---
## คำอธิบาย
Get the integer value of a console variable.
| Name | Description |
| --------------- | ----------------------------------------------------- |
| const varname[] | The name of the integer variable to get the value of. |
## ส่งคืน
The value of the specified console variable. 0 if the specified console variable is not an integer or doesn't exist.
## ตัวอย่าง
```c
new serverPort = GetConsoleVarAsInt("port");
printf("Server Port: %i", serverPort);
```
## บันทึก
:::tip
Type 'varlist' in the server console to display a list of available console variables and their types.
:::
## ฟังก์ชั่นที่เกี่ยวข้องกัน
- [GetConsoleVarAsString](../functions/GetConsoleVarAsString): Retreive a server variable as a string.
- [GetConsoleVarAsBool](../functions/GetConsoleVarAsBool): Retreive a server variable as a boolean.
| openmultiplayer/web/docs/translations/th/scripting/functions/GetConsoleVarAsInt.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/GetConsoleVarAsInt.md",
"repo_id": "openmultiplayer",
"token_count": 405
} | 425 |
---
title: GetPlayerAmmo_DE
description: Gibt die Munition der vom Spieler aktuell gehaltenen Waffe zurück.
tags: ["player"]
---
## คำอธิบาย
Gibt die Munition der vom Spieler aktuell gehaltenen Waffe zurück.
| Name | Description |
| -------- | -------------------- |
| playerid | Die ID des Spielers. |
## ส่งคืน
Die Anzahl der Munition von der vom Spieler aktuell gehaltenen Waffe.
## ตัวอย่าง
```c
public OnPlayerUpdate(playerid)
{
if (GetPlayerAmmo(playerid) > 25) // prüft ob die Munition des Spielers über 25 liegt.
{
SetPlayerAmmo(playerid,25) // setzt die Munition zurück auf 25
}
return 1;
}
```
## บันทึก
:::warning
Die Munition kann nur 16-bit Werte enthalten. Dies bedeutet dass die Funktion bei mehr Munition als 32767 einen fehlerhaften Wert zurückgibt.
:::
## ฟังก์ชั่นที่เกี่ยวข้องกัน
- [SetPlayerAmmo](../functions/SetPlayerAmmo): Set the ammo of a specific player's weapon.
- [GetPlayerWeaponData](../functions/GetPlayerWeaponData): Find out information about weapons a player has.
| openmultiplayer/web/docs/translations/th/scripting/functions/GetPlayerAmmo_DE.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/GetPlayerAmmo_DE.md",
"repo_id": "openmultiplayer",
"token_count": 490
} | 426 |
---
title: GetPlayerDrunkLevel
description: Checks the player's level of drunkenness.
tags: ["player"]
---
## คำอธิบาย
Checks the player's level of drunkenness. If the level is less than 2000, the player is sober. The player's level of drunkness goes down slowly automatically (26 levels per second) but will always reach 2000 at the end (in 0.3b it will stop at zero). The higher drunkenness levels affect the player's camera, and the car driving handling. The level of drunkenness increases when the player drinks from a bottle (You can use SetPlayerSpecialAction to give them bottles).
| Name | Description |
| -------- | ------------------------------------------------------ |
| playerid | The player you want to check the drunkenness level of. |
## ส่งคืน
An integer with the level of drunkenness of the player.
## ตัวอย่าง
```c
public OnPlayerStateChange(playerid, oldstate, newstate)
{
if (newstate == PLAYER_STATE_DRIVER && GetPlayerDrunkLevel(playerid) > 1999)
{
SendClientMessage(playerid,0xFFFFFFFF,"Don't drink and drive!");
RemovePlayerFromVehicle(playerid);
}
}
```
## ฟังก์ชั่นที่เกี่ยวข้องกัน
- [SetPlayerDrunkLevel](../functions/SetPlayerDrunkLevel): Set a player's drunk level.
| openmultiplayer/web/docs/translations/th/scripting/functions/GetPlayerDrunkLevel.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/GetPlayerDrunkLevel.md",
"repo_id": "openmultiplayer",
"token_count": 477
} | 427 |
---
title: GetPlayerPing
description: Get the ping of a player.
tags: ["player"]
---
## คำอธิบาย
Get the ping of a player. The ping measures the amount of time it takes for the server to 'ping' the client and for the client to send the message back.
| Name | Description |
| -------- | ---------------------------------------- |
| playerid | The ID of the player to get the ping of. |
## ส่งคืน
The current ping of the player (expressed in milliseconds).
## ตัวอย่าง
```c
// Declare an array of all possible timer identifiers for timers for kicking players with
// generally high ping with default value of 0
new
gPlayerPingTimer[MAX_PLAYERS] = {0, ...};
// A constant (nice documentation :))
const
MAX_ACCEPTED_PING = 500;
public OnPlayerConnect(playerid)
{
// Initiate the timer and assign the variable the identifier of the timer
gPlayerPingTimer[playerid] = SetTimerEx("Ping_Timer", 3 * 1000, true, "i", playerid);
}
public OnPlayerDisconnect(playerid, reason)
{
// Kill the timer and reset the value to invalid
KillTimer(gPlayerPingTimer[playerid]);
gPlayerPingTimer[playerid] = 0;
}
// A forwarded function (callback)
forward public Ping_Timer(playerid);
public Ping_Timer(playerid)
{
// Kick player if their ping is more than the generally accepted high ping
if (GetPlayerPing(playerid) > MAX_ACCEPTED_PING)
{
SendClientMessageToAll()
Kick(playerid);
}
return 1;
}
```
## บันทึก
:::warning
Player's ping may be 65535 for a while after a player connects
:::
## ฟังก์ชั่นที่เกี่ยวข้องกัน
- GetPlayerIp: Get a player's IP.
- GetPlayerName: Get a player's name.
- GetPlayerVersion: Get a player's client-version.
| openmultiplayer/web/docs/translations/th/scripting/functions/GetPlayerPing.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/GetPlayerPing.md",
"repo_id": "openmultiplayer",
"token_count": 659
} | 428 |
---
title: GetPlayerVersion
description: Returns the SA-MP client version, as reported by the player.
tags: ["player"]
---
## คำอธิบาย
Returns the SA-MP client version, as reported by the player.
| Name | Description |
| --------- | ----------------------------------------------------------------- |
| playerid | The ID of the player to get the client version of. |
| version[] | The string to store the player's version in, passed by reference. |
| len | The maximum length of the version. |
## ส่งคืน
The client version is stored in the specified array.
## ตัวอย่าง
```c
public OnPlayerConnect(playerid)
{
new string[24];
GetPlayerVersion(playerid, string, sizeof(string));
format(string, sizeof(string), "Your version of SA-MP: %s", string);
SendClientMessage(playerid, 0xFFFFFFFF, string);
// possible text: "Your version of SA-MP: 0.3.7"
return 1;
}
```
## บันทึก
:::tip
A client's version can be up to 24 characters long, otherwise the connection will be rejected due to "Invalid client connection". However, normal players can only join with a version length between 5 (0.3.7) and 9 (0.3.DL-R1) characters.
:::
:::warning
The string the version gets stored in will be empty if playerid is an NPC.
:::
## ฟังก์ชั่นที่เกี่ยวข้องกัน
- GetPlayerName: Get a player's name.
- GetPlayerPing: Get the ping of a player.
- GetPlayerIp: Get a player's IP.
| openmultiplayer/web/docs/translations/th/scripting/functions/GetPlayerVersion.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/GetPlayerVersion.md",
"repo_id": "openmultiplayer",
"token_count": 619
} | 429 |
---
title: GetTickCount
description: Returns the uptime of the actual server (not the SA-MP server) in milliseconds.
tags: []
---
## คำอธิบาย
Returns the uptime of the actual server (not the SA-MP server) in milliseconds.
| Name | Description |
| ---- | ----------- |
## ตัวอย่าง
```c
public OnPlayerConnect(playerid)
{
new count = GetTickCount();
//Rest of OnPlayerConnect
printf("Time taken to execute OnPlayerConnect: %d", GetTickCount() - count);
return 1;
}
```
## บันทึก
:::tip
One common use for GetTickCount is for benchmarking. It can be used to calculate how much time some code takes to execute. See below for an example.
:::
:::warning
GetTickCount will cause problems on servers with uptime of over 24 days as GetTickCount will eventually warp past the integer size constraints. Check [this package](https://github.com/ScavengeSurvive/tick-difference) for a solution.
:::
## ฟังก์ชั่นที่เกี่ยวข้องกัน
- tickcount: Get the uptime of the actual server.
| openmultiplayer/web/docs/translations/th/scripting/functions/GetTickCount.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/GetTickCount.md",
"repo_id": "openmultiplayer",
"token_count": 384
} | 430 |
---
title: GetVehicleVelocity
description: Get the velocity of a vehicle on the X, Y and Z axes.
tags: ["vehicle"]
---
## คำอธิบาย
Get the velocity of a vehicle on the X, Y and Z axes.
| Name | Description |
| --------- | ------------------------------------------------------------------------------------ |
| vehicleid | The ID of the vehicle to get the velocity of. |
| &Float:x | A float variable in to which to store the vehicle's X velocity, passed by reference. |
| &Float:y | A float variable in to which to store the vehicle's Y velocity, passed by reference. |
| &Float:z | A float variable in to which to store the vehicle's Z velocity, passed by reference. |
## ส่งคืน
1: The function was executed successfully.
0: The function failed to execute. This means the vehicle specified does not exist.
The vehicle's velocity is stored in the specified variables.
## ตัวอย่าง
```c
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp("/GetMyCarVelocity", cmdtext) && IsPlayerInAnyVehicle(playerid))
{
new Float:Velocity[3], output[80];
GetVehicleVelocity(GetPlayerVehicleID(playerid), Velocity[0], Velocity[1], Velocity[2]);
format(output, sizeof(output), "You are going at a velocity of X%f, Y%f, Z%f", Velocity[0], Velocity[1], Velocity[2]);
SendClientMessage(playerid, 0xFFFFFFFF, output);
return 1;
}
return 0;
}
```
## บันทึก
:::tip
This function can be used to retrieve a vehicle's speed (km/h, m/s or mph). For more info look here.
:::
## ฟังก์ชั่นที่เกี่ยวข้องกัน
- GetPlayerVelocity: Get a player's velocity.
- SetVehicleVelocity: Set a vehicle's velocity.
- SetPlayerVelocity: Set a player's velocity.
| openmultiplayer/web/docs/translations/th/scripting/functions/GetVehicleVelocity.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/GetVehicleVelocity.md",
"repo_id": "openmultiplayer",
"token_count": 740
} | 431 |
---
title: IsPlayerInAnyVehicle
description: Check if a player is inside any vehicle (as a driver or passenger).
tags: ["player", "vehicle"]
---
## คำอธิบาย
Check if a player is inside any vehicle (as a driver or passenger).
| Name | Description |
| -------- | ------------------------------ |
| playerid | The ID of the player to check. |
## ส่งคืน
1: The player is in a vehicle.
0: The player is not in a vehicle.
## ตัวอย่าง
```c
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/invehicle", true) == 0)
{
if (IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, 0x00FF00AA, "You're in a vehicle.");
}
return 1;
}
return 0;
}
```
## ฟังก์ชั่นที่เกี่ยวข้องกัน
- [IsPlayerInVehicle](../../scripting/functions/IsPlayerInVehicle.md): Check if a player is in a certain vehicle.
- [GetPlayerVehicleSeat](../../scripting/functions/GetPlayerVehicleSeat.md): Check what seat a player is in.
| openmultiplayer/web/docs/translations/th/scripting/functions/IsPlayerInAnyVehicle.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/IsPlayerInAnyVehicle.md",
"repo_id": "openmultiplayer",
"token_count": 461
} | 432 |
---
title: LimitGlobalChatRadius
description: Set a radius limitation for the chat.
tags: []
---
## คำอธิบาย
Set a radius limitation for the chat. Only players at a certain distance from the player will see their message in the chat. Also changes the distance at which a player can see other players on the map at the same distance.
| Name | Description |
| ----------------- | ---------------------------------------------------- |
| Float:chat_radius | The range in which players will be able to see chat. |
## ส่งคืน
This function does not return any specific values.
## ตัวอย่าง
```c
public OnGameModeInit()
{
LimitGlobalChatRadius(200.0);
return 1;
}
```
## ฟังก์ชั่นที่เกี่ยวข้องกัน
- [SetNameTagDrawDistance](../functions/SetNameTagDrawDistance.md): Set the distance from where people can see other player's nametags.
- [SendPlayerMessageToPlayer](../functions/SendPlayerMessageToPlayer.md): Force a player to send text for one player.
- [SendPlayerMessageToAll](../functions/SendPlayerMessageToAll.md): Force a player to send text for all players.
- [OnPlayerText](../callbacks/OnPlayerText.md): Called when a player sends a message via the chat.
| openmultiplayer/web/docs/translations/th/scripting/functions/LimitGlobalChatRadius.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/LimitGlobalChatRadius.md",
"repo_id": "openmultiplayer",
"token_count": 453
} | 433 |
---
title: PlayCrimeReportForPlayer
description: This function plays a crime report for a player - just like in single-player when CJ commits a crime.
tags: ["player"]
---
## คำอธิบาย
This function plays a crime report for a player - just like in single-player when CJ commits a crime.
| Name | Description |
| --------- | ---------------------------------------------------------------------------------------------------------------------------- |
| playerid | The ID of the player that will hear the crime report. |
| suspectid | The ID of the suspect player whom will be described in the crime report. |
| crimeid | The [crime ID](../resources/crimelist.md), which will be reported as a 10-code (i.e. 10-16 if 16 was passed as the crimeid). |
## ส่งคืน
1: The function was executed successfully.
0: The function failed to execute. This means the player specified does not exist.
## ตัวอย่าง
```c
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/suspect"))
{
PlayCrimeReportForPlayer(playerid, 0, 16);
SendClientMessage(playerid, 0xFFFFFFFF, "ID 0 committed a crime (10-16).");
return 1;
}
return 0;
}
```
## ฟังก์ชั่นที่เกี่ยวข้องกัน
- PlayerPlaySound: Play a sound for a player.
| openmultiplayer/web/docs/translations/th/scripting/functions/PlayCrimeReportForPlayer.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/PlayCrimeReportForPlayer.md",
"repo_id": "openmultiplayer",
"token_count": 687
} | 434 |
---
title: PlayerTextDrawSetProportional
description: Appears to scale text spacing to a proportional ratio.
tags: ["player", "textdraw", "playertextdraw"]
---
## คำอธิบาย
Appears to scale text spacing to a proportional ratio. Useful when using PlayerTextDrawLetterSize to ensure the text has even character spacing.
| Name | Description |
| -------- | ------------------------------------------------------------------------ |
| playerid | The ID of the player whose player-textdraw to set the proportionality of |
| text | The ID of the player-textdraw to set the proportionality of |
| set | 1 to enable proportionality, 0 to disable. |
## ส่งคืน
This function does not return any specific values.
## ฟังก์ชั่นที่เกี่ยวข้องกัน
- CreatePlayerTextDraw: Create a player-textdraw.
- PlayerTextDrawDestroy: Destroy a player-textdraw.
- PlayerTextDrawColor: Set the color of the text in a player-textdraw.
- PlayerTextDrawBoxColor: Set the color of a player-textdraw's box.
- PlayerTextDrawBackgroundColor: Set the background color of a player-textdraw.
- PlayerTextDrawAlignment: Set the alignment of a player-textdraw.
- PlayerTextDrawFont: Set the font of a player-textdraw.
- PlayerTextDrawLetterSize: Set the letter size of the text in a player-textdraw.
- PlayerTextDrawTextSize: Set the size of a player-textdraw box (or clickable area for PlayerTextDrawSetSelectable).
- PlayerTextDrawSetOutline: Toggle the outline on a player-textdraw.
- PlayerTextDrawSetShadow: Set the shadow on a player-textdraw.
- PlayerTextDrawUseBox: Toggle the box on a player-textdraw.
- PlayerTextDrawSetString: Set the text of a player-textdraw.
- PlayerTextDrawShow: Show a player-textdraw.
- PlayerTextDrawHide: Hide a player-textdraw.
| openmultiplayer/web/docs/translations/th/scripting/functions/PlayerTextDrawSetProportional.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/PlayerTextDrawSetProportional.md",
"repo_id": "openmultiplayer",
"token_count": 637
} | 435 |
---
title: SHA256_PassHash
description: Hashes a password using the SHA-256 hashing algorithm.
tags: []
---
:::warning
This function was added in SA-MP 0.3.7 R1 and will not work in earlier versions!
:::
## คำอธิบาย
Hashes a password using the SHA-256 hashing algorithm. Includes a salt. The output is always 256 bits in length, or the equivalent of 64 Pawn cells.
| Name | Description |
| ------------ | -------------------------------------------------- |
| password[] | The password to hash. |
| salt[] | The salt to use in the hash. |
| ret_hash[] | The returned hash in uppercase hexadecimal digest. |
| ret_hash_len | The returned hash maximum length. |
## ส่งคืน
The hash is stored in the specified array.
## ตัวอย่าง
```c
public OnGameModeInit()
{
new MyHash[64 + 1]; // + 1 to account for the required null terminator
SHA256_PassHash("test", "78sdjs86d2h", MyHash, sizeof MyHash);
printf("Returned hash: %s", MyHash); // Returned hash: CD16A1C8BF5792B48142FF6B67C9CB5B1BDC7260D8D11AFBA6BCDE0933A3C0AF
return 1;
}
```
## บันทึก
:::tip
The returned hash has zero padding (i.e. possible prefix 00ABCD123...).
:::
:::tip
The salt is appended to the end of the password, meaning password 'foo' and salt 'bar' would form 'foobar'. The salt should be random, unique for each player and at least as long as the hashed password. It is to be stored alongside the actual hash in the player's account.
:::
:::warning
This function is not binary-safe. Using binary values on password and salt might give unexpected result.
:::
## ฟังก์ชั่นที่เกี่ยวข้องกัน
| openmultiplayer/web/docs/translations/th/scripting/functions/SHA256_PassHash.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/SHA256_PassHash.md",
"repo_id": "openmultiplayer",
"token_count": 716
} | 436 |
---
title: SetDeathDropAmount
description: .
tags: []
---
## คำอธิบาย
.
| Name | Description |
| ------ | ----------- |
| amount | |
## ส่งคืน
This function does not return any specific values.
## ตัวอย่าง
```c
public OnGameModeInit()
{
SetDeathDropAmount(5000);
//MORE CODE
return 1;
}
```
## บันทึก
:::warning
This function does not work in the current SA:MP version!
:::
## ฟังก์ชั่นที่เกี่ยวข้องกัน
- CreatePickup: Create a pickup.
- GivePlayerMoney: Give a player money.
- OnPlayerDeath: Called when a player dies.
| openmultiplayer/web/docs/translations/th/scripting/functions/SetDeathDropAmount.md/0 | {
"file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/SetDeathDropAmount.md",
"repo_id": "openmultiplayer",
"token_count": 294
} | 437 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.