text
stringlengths
1
2.83M
id
stringlengths
16
152
metadata
dict
__index_level_0__
int64
0
949
--- title: OnActorStreamOut description: Esta callback é chamada quando um ator é descarregado (torna-se invisível) para um jogador. tags: [] --- <VersionWarnPT name='callback' version='SA-MP 0.3.7' /> ## Descrição Esta callback é chamada quando um ator é descarregado (torna-se invisível) para um jogador. | Name | Description | | ----------- | ---------------------------------------------- | | actorid | O ID do ator que foi descarregado pelo jogador | | forplayerid | O ID do jogador que descarregou o ator. | ## Retorno Sempre é chamada primeiro em filterscripts. ## Exemplos ```c public OnActorStreamOut(actorid, forplayerid) { new string[40]; format(string, sizeof(string), "Ator %d descarregou para você.", actorid); SendClientMessage(forplayerid, 0xFFFFFFFF, string); return 1; } ``` ## Notas <TipNPCCallbacksPT /> ## Funções Relacionadas
openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnActorStreamOut.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnActorStreamOut.md", "repo_id": "openmultiplayer", "token_count": 364 }
389
--- title: OnNPCSpawn description: Essa callback é executada quando o NPC é spawnado. tags: [] --- ## Descrição Essa callback é executada quando o NPC é spawnado. ## Exemplos ```c public OnNPCSpawn() { print("NPC foi spawnado!"); SendChat("Olá mundo! Eu sou um BOT."); return 1; } ```
openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnNPCSpawn.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnNPCSpawn.md", "repo_id": "openmultiplayer", "token_count": 121 }
390
--- title: OnPlayerExitedMenu description: Chamado quando um jogador sai se um menu. tags: ["player", "menu"] --- ## Descrição Chamado quando um jogador sai se um menu. | Nome | Descrição | | -------- | -------------------------------- | | playerid | O ID do jogador que saiu do menu | ## Retorno Sempre é chamada primeiro em filterscripts. ## Exemplos ```c public OnPlayerExitedMenu(playerid) { TogglePlayerControllable(playerid,1); // Descongela o jogador quando ele sai do menu return 1; } ``` ## Funções Relacionadas - [CreateMenu](../functions/CreateMenu.md): Cria um Menu. - [DestroyMenu](../functions/DestroyMenu.md): Destroi um Menu.
openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnPlayerExitedMenu.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnPlayerExitedMenu.md", "repo_id": "openmultiplayer", "token_count": 258 }
391
--- title: OnPlayerStateChange description: Esta callback é chamada quando o estado de um jogador muda. tags: ["player"] --- ## Descrição Esta callback é chamada quando o estado de um jogador muda. Por exemplo, quando um jogador deixa de ser o piloto de um veículo e fica a pé. | Nome | Desrição | | -------- | ---------------------------------------- | | playerid | O ID do jogador que teve o estado alterado. | | newstate | O novo estado do jogador. | | oldstate | O antigo estado do jogador. | Verifique em [Player States](../resources/playerstates) a lista de todos os estados disponíveis. ## Retorno Sempre é chamada primeiro em filterscripts. ## Exemplo ```c public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstate) { if (oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) // Jogador entrou no veículo como piloto { new vehicleid = GetPlayerVehicleID(playerid); AddVehicleComponent(vehicleid, 1010); // Adiciona nitro ao veículo } return 1; } ``` ## Notas <TipNPCCallbacksPT /> ## Funções Relacionadas - [GetPlayerState](../functions/GetPlayerState): Obtém o estado atual do jogador. - [GetPlayerSpecialAction](../functions/GetPlayerSpecialAction): Obtém a ação especial atual do jogador. - [SetPlayerSpecialAction](../functions/SetPlayerSpecialAction): Define uma ação especial a um jogador.
openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnPlayerStateChange.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnPlayerStateChange.md", "repo_id": "openmultiplayer", "token_count": 557 }
392
--- title: OnVehicleSpawn description: Essa callback é chamada quando um veículo renasce. tags: ["vehicle"] --- :::warning Essa callback **só é chamada** quando um veículo **re**nasce. CreateVehicle e AddStaticVehicleEx **não chamarão** essa callback. ::: ## Descrição Essa callback é chamada quando um veículo renasce. | Nome | Descrição | | --------- | ------------------------------------- | | vehicleid | ID do veículo que acabou de renascer. | ## Retornos 0 - Vai prevenir que outros Filterscripts chamem essa callback. 1 - Indica que essa callback vai ser passada para outros Filterscripts em seguida. Sempre é chamada primeiro em Filterscripts. ## Exemplos ```c public OnVehicleSpawn(vehicleid) { printf("Veículo ID %d renasceu!",vehicleid); return 1; } ``` ## Funções Relacionadas - [SetVehicleToRespawn](../functions/SetVehicleToRespawn): Faz um veículo renascer. - [CreateVehicle](../functions/CreateVehicle): Cria um veículo.
openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnVehicleSpawn.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/callbacks/OnVehicleSpawn.md", "repo_id": "openmultiplayer", "token_count": 389 }
393
--- title: GangZoneDestroy description: Destrói uma gangzone. tags: ["gangzone"] --- ## Descrição Destrói uma gangzone. | Nome | Descrição | | ---- | ---------------------------- | | zone | O ID da gangzone a destruir. | ## Retorno Esta função não retorna nenhum valor específico. ## Exemplos ```c new gangZoneId; gangZoneId = GangZoneCreate(1248.011, 2072.804, 1439.348, 2204.319); GangZoneDestroy(gangZoneId); ``` ## Funções Relacionadas - [GangZoneCreate](GangZoneCreate): Cria 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/GangZoneDestroy.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/functions/GangZoneDestroy.md", "repo_id": "openmultiplayer", "token_count": 473 }
394
--- title: GetPlayerIp description: Obtém o endereço IP de um jogador específico e armazena-o em uma string. tags: ["player", "ip address"] --- ## Descrição Obtém o endereço IP de um jogador específico e armazena-o em uma string. | Nome | Descrição | | -------- | ---------------------------------------------------------------------------- | | playerid | O ID do jogador do qual deseja obter o endereço de IP. | | ip[] | A string para armazenar o endereço de IP do jogador, passado por referência. | | len | O comprimento máximo do endereço IP (recomendado 16). | ## Retorno O endereço IP do jogador que está armazenado na array especificada. ## Exemplos ```c public OnPlayerConnect(playerid) { new plrIP[16]; GetPlayerIp(playerid, plrIP, sizeof(plrIP)); if (!strcmp(plrIP, "127.0.0.1")) { SendClientMessage(playerid, 0xFFFFFFFF, "Bem-vindo ao seu servidor, mestre :)"); } return 1; } ``` ## Notas :::tip PAWN é case-sensitive (sensível a maiúsculas e minúsculas). GetPlayerIP não irá funcionar. ::: :::warning **SA-MP server**: Esta função não funciona quando usada em [OnPlayerDisconnect](../callbacks/OnPlayerDisconnect) porque o jogador já está desconectado. Irá retornar um IP inválido (255.255.255.255). Salve os IPs dos jogador em [OnPlayerConnect](../callbacks/OnPlayerConnect) se eles precisarem ser usados no [OnPlayerDisconnect](../callbacks/OnPlayerDisconnect). **open.mp server**: This function **work** when used in [OnPlayerDisconnect](../callbacks/OnPlayerDisconnect). ::: ## Funções Relacionadas - [NetStats_GetIpPort](NetStats_GetIpPort): Obtém o IP e porta de um jogador. - [GetPlayerName](GetPlayerName): Obtém o nome de um jogador. - [GetPlayerPing](GetPlayerPing): Obtém o ping de um jogador. - [GetPlayerVersion](GetPlayerVerion): Obtém a versão-client do jogador. - [OnIncomingConnection](../callbacks/OnIncomingConnection): É chamado quando um jogador está tentando se conectar ao servidor. - [OnPlayerConnect](../callbacks/OnPlayerConnect): É chamado quando um jogador se conecta ao servidor. - [OnPlayerDisconnect](../callbacks/OnPlayerDisconnect): É chamado quando um jogador sai do servidor.
openmultiplayer/web/docs/translations/pt-BR/scripting/functions/GetPlayerIp.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/functions/GetPlayerIp.md", "repo_id": "openmultiplayer", "token_count": 922 }
395
--- title: SetVehicleParamsCarWindows description: Permite abrir e fechar as janelas 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 janelas de um veículo. | Nome | Descrição | | --------- | ---------------------------------------------------------------------------------- | | vehicleid | O ID do veículo a definir o estado da janela. | | driver | O estado da janela do motorista. 1 para abrir, 0 para fechar. | | passenger | O estado da janela do passageiro. 1 para abrir, 0 para fechar. | | backleft | O estado da janela traseira esquerda (se disponível). 1 para abrir, 0 para fechar. | | backright | O estado da janela traseira direita (se disponível). 1 para abrir, 0 para fechar. | ## Retorno [edit] ## Funções Relacionadas - [SetVehicleParamsCarDoors](SetVehicleParamsCarDoors.md): Permite abrir e fechar as portas de um veículo. - [GetVehicleParamsCarDoors](GetVehicleParamsCarDoors.md): Retorna o estado atual das portas 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/SetVehicleParamsCarWindows.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/functions/SetVehicleParamsCarWindows.md", "repo_id": "openmultiplayer", "token_count": 573 }
396
--- title: IDs Ossos --- :::note Para ser usado com [SetPlayerAttachedObject](../functions/SetPlayerAttachedObject). ::: | ID | Osso | | --- | -------------------------- | | 1 | Coluna | | 2 | Cabeça | | 3 | Braço esquerdo | | 4 | Braço direito | | 5 | Mão esquerda | | 6 | Mão direita | | 7 | Coxa esquerda | | 8 | Coxa direita | | 9 | Pé esquerdo | | 10 | Pé direito | | 11 | Panturrilha direita | | 12 | Panturrilha esquerda | | 13 | Antebraço esquerdo | | 14 | Antebraço direito | | 15 | Clavícula esquerda (ombro) | | 16 | Clavícula direita (ombro) | | 17 | Pescoço | | 18 | Maxilar |
openmultiplayer/web/docs/translations/pt-BR/scripting/resources/boneid.md/0
{ "file_path": "openmultiplayer/web/docs/translations/pt-BR/scripting/resources/boneid.md", "repo_id": "openmultiplayer", "token_count": 519 }
397
--- title: OnActorStreamOut description: Acest callback este apelat atunci când un actor iese din flux (streamed out) de către clientul unui jucător. tags: [] --- :::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 iese din flux (streamed out) 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 care a transmis actorul în flux. | ## Returnări Mereu este apelat primul în filterscript-uri. ## Exemple ```c public OnActorStreamOut(actorid, forplayerid) { new string[40]; format(string, sizeof(string), "Actorul %d este acum ieșit din flux.", actorid); SendClientMessage(forplayerid, 0xFFFFFFFF, string); return 1; } ``` ## Note :::tip Acest callback poate fi apelat și de NPC. ::: ## Funcții asociate
openmultiplayer/web/docs/translations/ro/scripting/callbacks/OnActorStreamOut.md/0
{ "file_path": "openmultiplayer/web/docs/translations/ro/scripting/callbacks/OnActorStreamOut.md", "repo_id": "openmultiplayer", "token_count": 478 }
398
--- title: OnPlayerConnect description: Acest callback este apelat atunci când un jucător se conectează la server. tags: ["player"] --- ## Descriere Acest callback este apelat atunci când un jucător se conectează la server. | Nume | Descriere | | -------- | ------------------------------------ | | playerid | ID-ul jucătorului care s-a conectat. | ## Returnări 0 - Va împiedica alte filterscript-uri să primească acest callback. 1 - Indică faptul că acest callback va fi transmis următorului filterscript. Este întotdeauna numit primul în filterscript-uri. ## Example ```c public OnPlayerConnect(playerid) { new string[64], playerName[MAX_PLAYER_NAME]; GetPlayerName(playerid, playerName, MAX_PLAYER_NAME); format(string, sizeof string, "%s a intrat pe server. Bine ai venit!", playerName); SendClientMessageToAll(0xFFFFFFAA, string); return 1; } ``` ## Note <TipNPCCallbacks /> ## Funcții similare - [OnPlayerDisconnect](OnPlayerDisconnect): Apelat când un jucător părăsește serverul. - [OnIncomingConnection](OnIncomingConnection): Apelat atunci când un jucător încearcă să se conecteze la server. - [OnPlayerFinishedDownloading](OnPlayerFinishedDownloading): Apelat când un jucător termină descărcarea modelelor personalizate.
openmultiplayer/web/docs/translations/ro/scripting/callbacks/OnPlayerConnect.md/0
{ "file_path": "openmultiplayer/web/docs/translations/ro/scripting/callbacks/OnPlayerConnect.md", "repo_id": "openmultiplayer", "token_count": 530 }
399
--- title: OnPlayerLeaveRaceCheckpoint description: Acest callback este apelat atunci când un jucător părăsește punctul de control al cursei. tags: ["player", "checkpoint", "racecheckpoint"] --- ## Descriere Acest callback este apelat atunci când un jucător părăsește punctul de control al cursei. | Nume | Descriere | | -------- | -------------------------------------------------------------- | | playerid | ID-ul jucătorului care a părăsit punctul de control al cursei. | ## Returnări Este întotdeauna numit primul în filterscript-uri. ## Exemple ```c public OnPlayerLeaveRaceCheckpoint(playerid) { printf("Jucătorul %d a părăsit un punct de control al cursei!", 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/OnPlayerLeaveRaceCheckpoint.md/0
{ "file_path": "openmultiplayer/web/docs/translations/ro/scripting/callbacks/OnPlayerLeaveRaceCheckpoint.md", "repo_id": "openmultiplayer", "token_count": 603 }
400
--- title: OnRconCommand description: Acest callback este apelat atunci când o comandă este trimisă prin consola serverului, RCON la distanță sau prin comanda „/rcon” din joc. tags: [] --- ## Descriere Acest callback este apelat atunci când o comandă este trimisă prin consola serverului, RCON la distanță sau prin comanda „/rcon” din joc. | Nume | Descriere | | ----- | ------------------------------------------------------------------------------------- | | cmd[] | Un șir care conține comanda care a fost introdusă, precum și orice parametri trecuți. | ## Returnări It is always called first in filterscripts so returning 1 there blocks gamemode from seeing it. ## Exemple ```c public OnRconCommand(cmd[]) { printf("[RCON]: ați tastat „/rcon %s”!", cmd); return 0; } public OnRconCommand(cmd[]) { if (!strcmp(cmd, "hello", true)) { SendClientMessageToAll(0xFFFFFFAA, "Salut Lume!"); print("Ai salutat lumea."); // Acesta va apărea jucătorului care a tastat comanda rcon în chat în alb return 1; } return 0; } ``` ## Note :::tip „/rcon” nu este inclus în „cmd” atunci când un jucător introduce o comandă. Dacă utilizați funcția „printare” aici, aceasta va trimite un mesaj jucătorului care a tastat comanda în joc, precum și jurnalul. Acest apel invers nu este apelat atunci când jucătorul nu este conectat ca administrator RCON. Când jucătorul nu este conectat ca administrator RCON și folosește /rcon login, acest apel invers nu va fi apelat și OnRconLoginAttempt este apelat în schimb. Cu toate acestea, atunci când jucătorul este conectat ca administrator RCON, utilizarea acestei comenzi va apela acest apel invers. ::: :::warning Va trebui să includeți acest apel invers într-un script de filtru încărcat pentru ca acesta să funcționeze în modul de joc! ::: ## Funcții similare - [IsPlayerAdmin](../functions/IsPlayerAdmin): Verifică dacă un jucător este conectat la RCON. - [OnRconLoginAttempt](OnRconLoginAttempt): Apelat atunci când se încearcă autentificare la RCON.
openmultiplayer/web/docs/translations/ro/scripting/callbacks/OnRconCommand.md/0
{ "file_path": "openmultiplayer/web/docs/translations/ro/scripting/callbacks/OnRconCommand.md", "repo_id": "openmultiplayer", "token_count": 910 }
401
--- title: AddPlayerClass description: Adaugă o clasă la selecția clasei. tags: ["player"] --- ## Descriere Adaugă o clasă la selecția clasei. Clasele sunt folosite, astfel încât jucătorii să poată genera un skin la alegere. | Nume | Descriere | | ------------- | -------------------------------------------------------------------- | | modelid | Skinul cu care jucătorul va fi generat. | | Float:spawn_x | Coordonata X a punctului de reproducere al acestei clase. | | Float:spawn_y | Coordonata Y a punctului de reproducere al acestei clase. | | Float:spawn_z | Coordonata Z a punctului de reproducere al acestei clase. | | Float:z_angle | Direcția în care jucătorul trebuie să se confrunte după reproducere. | | weapon1 | Prima armă de reproducere pentru jucător. | | weapon1_ammo | Cantitatea de muniție pentru arma primară de reproducere. | | weapon2 | A doua armă de reproducere pentru jucător. | | weapon2_ammo | Cantitatea de muniție pentru a doua armă de reproducere. | | weapon3 | A treia armă de reproducere pentru jucător. | | weapon3_ammo | Cantitatea de muniție pentru a treia armă de reproducere. | ## Se intoarce ID-ul clasei care tocmai a fost adăugat. 319 dacă limita de clasă (320) a fost atinsă. Cel mai mare ID de clasă posibil este 319. ## Exemple ```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; } ``` ## Notite :::tip ID-ul maxim de clasă este 319 (începând de la 0, deci un total de 320 de clase). Când se atinge această limită, orice alte clase adăugate vor înlocui ID 319. ::: ## Funcții conexe - [AddPlayerClassEx](AddPlayerClassEx.md): Adăugați o clasă cu o echipă implicită. - [SetSpawnInfo](SetSpawnInfo.md): Setați setarile pentru spawn unui jucător. - [SetPlayerSkin](SetPlayerSkin.md): Setează kinul unui jucător.
openmultiplayer/web/docs/translations/ro/scripting/functions/AddPlayerClass.md/0
{ "file_path": "openmultiplayer/web/docs/translations/ro/scripting/functions/AddPlayerClass.md", "repo_id": "openmultiplayer", "token_count": 1088 }
402
--- title: Sloturi pentru componente --- :::info Folosiți-le pentru a lucra cu functia [GetVehicleComponentInSlot](../functions/GetVehicleComponentInSlot). ::: --- | Slot | Nume | | ---- | ----------------------- | | 0 | CARMODTYPE_SPOILER | | 1 | CARMODTYPE_HOOD | | 2 | CARMODTYPE_ROOF | | 3 | CARMODTYPE_SIDESKIRT | | 4 | CARMODTYPE_LAMPS | | 5 | CARMODTYPE_NITRO | | 6 | CARMODTYPE_EXHAUST | | 7 | CARMODTYPE_WHEELS | | 8 | CARMODTYPE_STEREO | | 9 | CARMODTYPE_HYDRAULICS | | 10 | CARMODTYPE_FRONT_BUMPER | | 11 | CARMODTYPE_REAR_BUMPER | | 12 | CARMODTYPE_VENT_RIGHT | | 13 | CARMODTYPE_VENT_LEFT | ---
openmultiplayer/web/docs/translations/ro/scripting/resources/Componentslots.md/0
{ "file_path": "openmultiplayer/web/docs/translations/ro/scripting/resources/Componentslots.md", "repo_id": "openmultiplayer", "token_count": 378 }
403
--- title: Probleme comune --- ## Serverul se blochează instantaneu la pornire Cel mai frecvent este o eroare în fișierul server.cfg sau modul dvs. de joc lipsește. Verificați fișierul server_log.txt și motivul ar trebui să fie situat în partea de jos. Dacă nu, verificați fișierul crashinfo.txt. Soluția mai bună pentru a afla ce cauzează prăbușirea este folosirea pluginului Crash detect de Zeex/0x5A656578 [click pentru link](https://github.com/Zeex/samp-plugin-crashdetect/releases "https://github.com/Zeex/samp-plugin-crashdetect/releases") care va oferi mai multe informații, cum ar fi numerele de linie, numele funcțiilor, valorile parametrilor etc. Dacă scriptul este compilat în modul de depanare (-d3 flag) pentru a face compilatorul pune informații suplimentare despre toate aceste lucruri în ieșirea .amx. ## Serverul nu funcționează - firewall-ul este dezactivat Va trebui să vă redirecționați porturile pentru a permite jucătorilor să se alăture serverului dvs. Puteți redirecționa porturile folosind PF Port Checker. Descărcați-l de pe: www.portforward.com Dacă porturile nu sunt redirecționate, înseamnă că trebuie să le deschideți în router. Puteți verifica lista routerelor la [http://portforward.com/english/routers/port_forwarding/routerindex.htm](http://portforward.com/english/routers/port_forwarding/routerindex.htm "http://portforward.com/english/routers/port_forwarding/routerindex.htm") Are toate informațiile despre cum să redirecționați porturile. ## 'Packetul a fost modificat' Eroarea afișată în mod obișnuit ca: ``` [hh:mm:ss] Pachetul a fost modificat, trimis prin id: <id>, ip: <ip>: <port> ``` se întâmplă atunci când un jucător expiră sau are în prezent probleme de conexiune. ## 'Atenție: clientul a depășit limita de mesaje' Eroarea afișată în mod obișnuit ca: ``` Avertisment: clientul a depășit 'messageslimit' (1) <ip>: <port> (<count>) Limită: x / sec ``` se întâmplă atunci când numărul de mesaje pe secundă pe care un client le trimite serverului depășește. ## 'Atenție: clientul a depășit ackslimit' Eroarea afișată în mod obișnuit ca: ``` Avertisment: clientul a depășit `ackslimit` <ip>: <port> (<count>) Limită: x / sec ``` se întâmplă atunci când limita de acks depășește. ## 'Avertisment: clientul a depășit mesajulholelimit' Eroarea afișată în mod obișnuit ca: ``` Atenție: clientul a depășit „messageholelimit” (<type>) <ip>: <port> (<count>) Limită: x ``` se întâmplă atunci când limita orificiului pentru mesaje depășește. ## 'Avertisment: Prea multe mesaje scoase din uz' Eroarea afișată în mod obișnuit ca: ``` Avertisment: Prea multe mesaje ieșite din comandă de la player <ip>: <port> (<count>) Limită: x (messageholelimit) ``` Se întâmplă atunci când `mesaje în afara comenzii` reutilizează setarea mesaj-limită. Pentru mai multe informații despre acest lucru, consultați [aici](http://wiki.sa-mp.com/wiki/Controlling_Your_Server#RCON_Commands) ## Jucatori primesc constant "Unacceptable NickName" dar numele acestora este valid Dacă sunteți sigur că utilizați un nume acceptabil și serverul rulează pe Windows, încercați să schimbați opțiunea de compatibilitate a samp-server.exe la Windows 98 și ar trebui să fie remediată după repornirea serverului. Serverele Windows cu timp ridicat pot provoca, de asemenea, această problemă. Acest lucru a fost observat de aproximativ 50 de zile de timp de funcționare a serverului. Pentru a o rezolva, este necesară o repornire. ## `MSVCR___.dll`/`MSVCP___.dll` nu este gasit (not found) Această problemă apare în mod regulat pe serverele Windows atunci când se încearcă încărcarea unui plugin care a fost dezvoltat folosind o versiune mai mare a runtime-ului Visual C ++ decât este instalată în prezent pe computer. Pentru a remedia acest lucru, descărcați bibliotecile Microsoft runtime corespunzătoare Microsoft Visual C ++. Rețineți că serverul SA-MP are 32 de biți, prin urmare va trebui să descărcați și versiunea pe 32 de biți (x86) a runtime-ului, indiferent de arhitectură. Versiunea de runtime pe care o solicitați în mod specific este notată de numerele din numele fișierului (a se vedea tabelul de mai jos), deși nu este rău să le instalați pe toate. Aceste biblioteci nu se stivuiesc, sau cu alte cuvinte: nu veți obține timpii de rulare pentru versiunile 2013 și anterioare dacă instalați doar versiunea 2015. | Numar Versiune | Runtime | | -------------- | --------------------------------------------- | | 10.0 | Microsoft Visual C++ 2010 x86 Redistributable | | 11.0 | Microsoft Visual C++ 2012 x86 Redistributable | | 12.0 | Microsoft Visual C++ 2013 x86 Redistributable | | 14.0 | Microsoft Visual C++ 2015 x86 Redistributable |
openmultiplayer/web/docs/translations/ro/server/CommonServerIssues.md/0
{ "file_path": "openmultiplayer/web/docs/translations/ro/server/CommonServerIssues.md", "repo_id": "openmultiplayer", "token_count": 2089 }
404
--- title: GetPlayerSkin description: Возвращает скин игрока. tags: ["player"] --- ## Описание Возвращает значение ID скина игрока. | Параметр | Описание | | -------- | ---------------------------------------- | | playerid | Игрок, скин которого хотите получить. | ## Возвращаемые данные ID скина (0 если значение не верное) ## Примеры ```c playerskin = GetPlayerSkin(playerid); ``` ## Примечания :::tip Возращение нового значения ID скина после использования SetSpawnInfo будет после спавна игрока с новым скином. Возвращает старое значение скина, если игрок заспавнился при использовании функции SpawnPlayer. ::: ## Связанные функции - [SetPlayerSkin](SetPlayerSkin.md): Устанавливает скин игрока.
openmultiplayer/web/docs/translations/ru/scripting/functions/GetPlayerSkin.md/0
{ "file_path": "openmultiplayer/web/docs/translations/ru/scripting/functions/GetPlayerSkin.md", "repo_id": "openmultiplayer", "token_count": 593 }
405
--- title: OnEnterExitModShop description: Ta povratni klic se pokliče, ko igralec vstopi v mod trgovino ali jo zapusti. tags: [] --- ## Opis Ta povratni klic se pokliče, ko igralec vstopi v mod trgovino ali jo zapusti. | Ime | Opis | | ---------- | ------------------------------------------------------------------------ | | playerid | ID predvajalnika, ki je vstopil v modshop ali izstopil iz njega | | enterexit | 1, če je igralec vnesel 0, če je zapustil modshop | | interiorid | Modshop notranji ID, ki ga predvajalnik vnese (0, če izstopi) | ## Returns Vedno je bila povabljena prva v "filterscript". ## Primeri ```c public OnEnterExitModShop(playerid, enterexit, interiorid) { if (enterexit == 0) // Če je enterexit 0, to pomeni, da zapuščajo modshop { SendClientMessage(playerid, COLOR_WHITE, "Lep avto! Obdavčeni ste bili 100$."); GivePlayerMoney(playerid, -100); } return 1; } ``` ## Opombe :::warning Znane napake: igralci trčijo, ko vstopijo v isto modshop ::: ## Povezane Funkcijo - [AddVehicleComponent](../functions/AddVehicleComponent.md): V vozilo dodajte komponento.
openmultiplayer/web/docs/translations/sl/scripting/callbacks/OnEnterExitModShop.md/0
{ "file_path": "openmultiplayer/web/docs/translations/sl/scripting/callbacks/OnEnterExitModShop.md", "repo_id": "openmultiplayer", "token_count": 580 }
406
--- title: BanEx description: Banuje igraca sa razlogom. tags: ["administration"] --- ## Opis Banuje igraca sa razlogom. | Ime | Opis | | -------- | ------------------------ | | playerid | ID igraca koga banujemo. | | reason | Razlog bana. | ## Vracanje Ova funkcija ne vraca nikakvu specificnu vrednost. ## Primeri ```c public OnPlayerCommandText( playerid, cmdtext[] ) { if (!strcmp(cmdtext, "/banme", true)) { // Banuje igraca koji ukuca komandu i stavi razlog ( "Request" ) BanEx(playerid, "Request"); 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 BanExPublic(playerid, reason[]); public BanExPublic(playerid, reason[]) { BanEx(playerid, reason); } stock BanExWithMessage(playerid, color, message[], reason[]) { // razlog koji ce ici u BanEx SendClientMessage(playerid, color, message); SetTimerEx("BanExPublic", 1000, false, "ds", playerid, reason); } public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext, "/banme", true) == 0) { //Banuje igraca koji ukuca ovu komandu BanExWithMessage(playerid, 0xFF0000FF, "You have been banned!", "Request"); return 1; } return 0; } ``` ## Notes :::warning Svaka akcija odmah pre BanEx(), kao sto je slanje poruka sa SendClientMessage, nece doci do igraca. Mora se postaviti timer da bi se napravio vremenski razmak ban-a. ::: ## Related Functions - [Ban](Ban): Banuje igraca koji je trenutno na serveru. - [Kick](Kick): Izbaci igraca sa servera(KICK).
openmultiplayer/web/docs/translations/sr/scripting/functions/BanEx.md/0
{ "file_path": "openmultiplayer/web/docs/translations/sr/scripting/functions/BanEx.md", "repo_id": "openmultiplayer", "token_count": 749 }
407
--- title: OnActorStreamOut description: Callback นี้ถูกเรียกเมื่อแอคเตอร์ถูกสตรีมออกโดยไคลเอนต์ของผู้เล่น tags: [] --- :::warning Callback นี้ถูกเพิ่มใน SA-MP 0.3.7 และจะไม่ทำงานในเวอร์ชั่นก่อนหน้านี้! ::: ## คำอธิบาย Callback นี้ถูกเรียกเมื่อแอคเตอร์ถูกสตรีมออกโดยไคลเอนต์ของผู้เล่น | ชื่อ | คำอธิบาย | | ----------- | ------------------------------------ | | actorid | ไอดีของแอคเตอร์ที่สตรีมออกจากผู้เล่น | | forplayerid | ไอดีของผู้เล่นที่แอคเตอร์สตรีมออกไป | ## ส่งคืน จะถูกเรียกใน Filterscripts ก่อนเป็นอันดับแรกเสมอ ## ตัวอย่าง ```c public OnActorStreamOut(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/OnActorStreamOut.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/callbacks/OnActorStreamOut.md", "repo_id": "openmultiplayer", "token_count": 997 }
408
--- title: OnPlayerObjectMoved description: This callback is called when a player object is moved after MovePlayerObject (when it stops moving). tags: ["player"] --- ## คำอธิบาย This callback is called when a player object is moved after MovePlayerObject (when it stops moving). | Name | Description | | -------- | ------------------------------------------ | | playerid | The playerid the object is assigned to | | objectid | The ID of the player object that was moved | ## ส่งคืน มันถูกเรียกในฟิลเตอร์สคริปต์ก่อนเสมอ ## ตัวอย่าง ```c public OnPlayerObjectMoved(playerid, objectid) { printf("Player object moved: objectid: %d playerid: %d", objectid, playerid); return 1; } ``` ## บันทึก :::tip This callback can also be called for NPC. ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [MovePlayerObject](../../scripting/functions/MovePlayerObject.md): Move a player object. - [IsPlayerObjectMoving](../../scripting/functions/IsPlayerObjectMoving.md): Check if the player object is moving. - [StopPlayerObject](../../scripting/functions/StopPlayerObject.md): Stop a player object from moving. - [CreatePlayerObject](../../scripting/functions/CreatePlayerObject.md): Create an object for only one player. - [DestroyPlayerObject](../../scripting/functions/DestroyPlayerObject.md): Destroy a player object.
openmultiplayer/web/docs/translations/th/scripting/callbacks/OnPlayerObjectMoved.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/callbacks/OnPlayerObjectMoved.md", "repo_id": "openmultiplayer", "token_count": 566 }
409
--- title: OnRconLoginAttempt description: This callback is called when someone attempts to log in to RCON in-game; successful or not. tags: [] --- ## คำอธิบาย This callback is called when someone attempts to log in to RCON in-game; successful or not. | Name | Description | | ---------- | ------------------------------------------------------- | | ip[] | The IP of the player that tried to log in to RCON. | | password[] | The password used to login with. | | success | 0 if the password was incorrect or 1 if it was correct. | ## ส่งคืน มันถูกเรียกในฟิลเตอร์สคริปต์ก่อนเสมอ ## ตัวอย่าง ```c public OnRconLoginAttempt(ip[], password[], success) { if (!success) //If the password was incorrect { printf("FAILED RCON LOGIN BY IP %s USING PASSWORD %s",ip, password); new pip[16]; for(new i = GetPlayerPoolSize(); i != -1; --i) //Loop through all players { GetPlayerIp(i, pip, sizeof(pip)); if (!strcmp(ip, pip, true)) //If a player's IP is the IP that failed the login { SendClientMessage(i, 0xFFFFFFFF, "Wrong Password. Bye!"); //Send a message Kick(i); //They are now kicked. } } } return 1; } ``` ## บันทึก :::tip This callback is only called when /rcon login is used in-game. This callback is only called when the player is not yet logged in. When the player is logged in, OnRconCommand is called instead. ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [IsPlayerAdmin](../../scripting/functions/IsPlayerAdmin.md): Checks if a player is logged into RCON. - [SendRconCommand](../../scripting/functions/SendRconCommand.md): Sends an RCON command via the script.
openmultiplayer/web/docs/translations/th/scripting/callbacks/OnRconLoginAttempt.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/callbacks/OnRconLoginAttempt.md", "repo_id": "openmultiplayer", "token_count": 847 }
410
--- title: AddPlayerClassEx description: This function is exactly the same as the AddPlayerClass function, with the addition of a team parameter. tags: ["player"] --- ## คำอธิบาย This function is exactly the same as the AddPlayerClass function, with the addition of a team parameter. | Name | Description | | ------------- | ----------------------------------------------------------- | | teamid | The team you want the player to spawn in. | | modelid | The skin which the player will spawn with. | | Float:spawn_x | The X coordinate of the class' spawn position. | | Float:spawn_y | The Y coordinate of the class' spawn position. | | Float:spawn_z | The Z coordinate of the class' spawn position. | | Float:z_angle | The direction in which the player will face after spawning. | | weapon1 | The first spawn-weapon for the player. | | weapon1_ammo | The amount of ammunition for the first 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 as either: // 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; } ``` ## บันทึก :::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. ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [AddPlayerClass](../../scripting/functions/AddPlayerClass.md): Add a class. - [SetSpawnInfo](../../scripting/functions/SetSpawnInfo.md): Set the spawn setting for a player. - [SetPlayerTeam](../../scripting/functions/SetPlayerTeam.md): Set a player's team. - [SetPlayerSkin](../../scripting/functions/SetPlayerSkin.md): Set a player's skin.
openmultiplayer/web/docs/translations/th/scripting/functions/AddPlayerClassEx.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/AddPlayerClassEx.md", "repo_id": "openmultiplayer", "token_count": 1008 }
411
--- title: AttachObjectToObject description: You can use this function to attach objects to other objects. tags: [] --- :::warning This function was added in SA-MP 0.3d and will not work in earlier versions! ::: ## คำอธิบาย You can use this function to attach objects to other objects. The objects will folow the main object. | Name | Description | | ------------- | ----------------------------------------------------------------------- | | objectid | The object to attach to another object. | | attachtoid | The object to attach the object to. | | Float:OffsetX | The distance between the main object and the object in the X direction. | | Float:OffsetY | The distance between the main object and the object in the Y direction. | | Float:OffsetZ | The distance between the main object and the object in the Z direction. | | Float:RotX | The X rotation between the object and the main object. | | Float:RotY | The Y rotation between the object and the main object. | | Float:RotZ | The Z rotation between the object and the main object. | | SyncRotation | If set to 0, objectid's rotation will not change with attachtoid's. | ## ส่งคืน 1: The function executed successfully. 0: The function failed to execute. This means the first object (objectid) does not exist. There are no internal checks to verify that the second object (attachtoid) exists. ## ตัวอย่าง ```c new objectid = CreateObject(...); new attachtoid = CreateObject(...); AttachObjectToObject(objectid, attachtoid, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1); ``` ## บันทึก :::tip Both objects need to be created before attempting to attach them. There is no player-object version of this function (AttachPlayerObjectToObject), meaning it will not be supported by streamers. ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [AttachObjectToPlayer](../../scripting/functions/AttachObjectToPlayer.md): Attach an object to a player. - [AttachObjectToVehicle](../../scripting/functions/AttachObjectToVehicle.md): Attach an object to a vehicle. - [AttachPlayerObjectToPlayer](../../scripting/functions/AttachPlayerObjectToPlayer.md): Attach a player object to a player. - [CreateObject](../../scripting/functions/CreateObject.md): Create an object. - [DestroyObject](../../scripting/functions/DestroyObject.md): Destroy an object. - [IsValidObject](../../scripting/functions/IsValidObject.md): Checks if a certain object is vaild. - [MoveObject](../../scripting/functions/MoveObject.md): Move an object. - [StopObject](../../scripting/functions/StopObject.md): Stop an object from moving. - [SetObjectPos](../../scripting/functions/SetObjectPos.md): Set the position of an object. - [SetObjectRot](../../scripting/functions/SetObjectRot.md): Set the rotation of an object. - [GetObjectPos](../../scripting/functions/GetObjectPos.md): Locate an object. - [GetObjectRot](../../scripting/functions/GetObjectRot.md): Check the rotation of an object. - [CreatePlayerObject](../../scripting/functions/CreatePlayerObject.md): Create an object for only one player. - [DestroyPlayerObject](../../scripting/functions/DestroyPlayerObject.md): Destroy a player object. - [IsValidPlayerObject](../../scripting/functions/IsValidPlayerObject.md): Checks if a certain player object is vaild. - [MovePlayerObject](../../scripting/functions/MovePlayerObject.md): Move a player object. - [StopPlayerObject](../../scripting/functions/StopPlayerObject.md): Stop a player object from moving. - [SetPlayerObjectPos](../../scripting/functions/SetPlayerObjectPos.md): Set the position of a player object. - [SetPlayerObjectRot](../../scripting/functions/SetPlayerObjectRot.md): Set the rotation of a player object. - [GetPlayerObjectPos](../../scripting/functions/GetPlayerObjectPos.md): Locate a player object. - [GetPlayerObjectRot](../../scripting/functions/GetPlayerObjectRot.md): Check the rotation of a player object.
openmultiplayer/web/docs/translations/th/scripting/functions/AttachObjectToObject.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/AttachObjectToObject.md", "repo_id": "openmultiplayer", "token_count": 1379 }
412
--- title: ClearAnimations description: Clears all animations for the given player (it also cancels all current tasks such as jetpacking, parachuting,entering vehicles, driving (removes player out of vehicle), swimming, etc. tags: [] --- ## คำอธิบาย Clears all animations for the given player (it also cancels all current tasks such as jetpacking, parachuting,entering vehicles, driving (removes player out of vehicle), swimming, etc.. ). | Name | Description | | --------- | -------------------------------------------------------------------------------------------------- | | playerid | The ID of the player to clear the animations of. | | forcesync | Set to 1 to force playerid to sync the animation with other players in streaming radius (optional) | ## ส่งคืน This function always returns 1, even when the player specified is not connected. ## ตัวอย่าง ```c public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/animclear", true)) { ClearAnimations(playerid); return 1; } return 0; } ``` ## บันทึก :::tip ClearAnimations doesn't do anything when the animation ends if we pass 1 for the freeze parameter in ApplyAnimation. ::: :::tip Unlike some other ways to remove player from a vehicle, this will also reset the vehicle's velocity to zero, instantly stopping the car. Player will appear on top of the vehicle with the same location as he was in his car seat. ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [ApplyAnimation](../../scripting/functions/ApplyAnimation.md): Apply an animation to a player.
openmultiplayer/web/docs/translations/th/scripting/functions/ClearAnimations.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/ClearAnimations.md", "repo_id": "openmultiplayer", "token_count": 652 }
413
--- title: DeleteSVar description: Deletes a previously set server variable. tags: [] --- ## คำอธิบาย Deletes a previously set server variable. | Name | Description | | ------- | ------------------------------------------ | | varname | The name of the server variable to delete. | ## ส่งคืน 1: The function executed successfully. 0: The function failed to execute. There is no variable set with the given name. ## ตัวอย่าง ```c SetSVarInt("SomeVarName", 69); // Later on, when the variable is no longer needed... DeleteSVar("SomeVarName"); ``` ## บันทึก :::tip Once a variable is deleted, attempts to retrieve the value will return 0 (for integers and floats and NULL for strings. ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [SetSVarInt](../../scripting/functions/SetSVarInt.md): Set an integer for a server variable. - [GetSVarInt](../../scripting/functions/GetSVarInt.md): Get a player server as an integer. - [SetSVarString](../../scripting/functions/SetSVarString.md): Set a string for a server variable. - [GetSVarString](../../scripting/functions/GetSVarString.md): Get the previously set string from a server variable. - [SetSVarFloat](../../scripting/functions/SetSVarFloat.md): Set a float for a server variable. - [GetSVarFloat](../../scripting/functions/GetSVarFloat.md): Get the previously set float from a server variable.
openmultiplayer/web/docs/translations/th/scripting/functions/DeleteSVar.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/DeleteSVar.md", "repo_id": "openmultiplayer", "token_count": 523 }
414
--- title: EditObject description: Allows a player to edit an object (position and rotation) using their mouse on a GUI (Graphical User Interface). tags: [] --- ## คำอธิบาย Allows a player to edit an object (position and rotation) using their mouse on a GUI (Graphical User Interface). | Name | Description | | -------- | ------------------------------------------------- | | playerid | The ID of the player that should edit the object. | | objectid | The ID of the object to be edited by the player. | ## ส่งคืน 1: The function executed successfully. Success is reported when a non-existent object is specified, but nothing will happen. 0: The function failed to execute. The player is not connected. ## ตัวอย่าง ```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: You can now edit the object!"); 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. ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [CreateObject](../functions/CreateObject): Create an object. - [DestroyObject](../functions/DestroyObject): Destroy an object. - [MoveObject](../functions/MoveObject): Move an object. - [EditPlayerObject](../functions/EditPlayerObject): Edit an object. - [EditAttachedObject](../functions/EditAttachedObject): Edit an attached object. - [SelectObject](../functions/SelectObject): Select an object. - [CancelEdit](../functions/CancelEdit): Cancel the edition of an object.
openmultiplayer/web/docs/translations/th/scripting/functions/EditObject.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/EditObject.md", "repo_id": "openmultiplayer", "token_count": 674 }
415
--- title: GangZoneFlashForAll description: GangZoneFlashForAll flashes a gangzone for all players. tags: ["gangzone"] --- ## คำอธิบาย GangZoneFlashForAll flashes a gangzone for all players. | Name | Description | | ---------- | ---------------------------------------------------------------------------------------------------------- | | zone | The zone to flash. | | flashcolor | The color to flash the gang zone, as an integer or hex in RGBA color format. Alpha transparency supported. | ## ส่งคืน This function does not return any specific values. ## ตัวอย่าง ```c new gangzone; public OnGameModeInit() { gangzone = GangZoneCreate(1248.011, 2072.804, 1439.348, 2204.319); return 1; } public OnPlayerDeath(playerid, killerid, WEAPON:reason) { GangZoneFlashForAll(gangzone,COLOR_RED); return 1; } ``` ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [GangZoneCreate](../functions/GangZoneCreate): Create a gangzone. - [GangZoneDestroy](../functions/GangZoneDestroy): Destroy 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. - [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/GangZoneFlashForAll.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/GangZoneFlashForAll.md", "repo_id": "openmultiplayer", "token_count": 787 }
416
--- title: GetConsoleVarAsString description: Get the string value of a console variable. tags: [] --- ## คำอธิบาย Get the string value of a console variable. | Name | Description | | --------------- | ------------------------------------------------------------ | | const varname[] | The name of the string variable to get the value of. | | buffer[] | An array into which to store the value, passed by reference. | | len | The length of the string that should be stored. | ## ส่งคืน The length of the returned string. 0 if the specified console variable is not a string or doesn't exist. ## ตัวอย่าง ```c public OnGameModeInit() { new hostname[64]; GetConsoleVarAsString("hostname", hostname, sizeof(hostname)); printf("Hostname: %s", hostname); } ``` ## บันทึก :::tip When filterscripts or plugins are specified as the varname, this function only returns the name of the first specified filterscript or plugin. ::: :::tip Type 'varlist' in the server console to display a list of available console variables and their types. ::: :::warning Using this function with anything other than a string (integer, boolean or float) will cause your server to crash. Using it with a nonexistent console variable will also cause your server to crash. ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [GetConsoleVarAsInt](../functions/GetConsoleVarAsInt): Retreive a server variable as an integer. - [GetConsoleVarAsBool](../functions/GetConsoleVarAsBool): Retreive a server variable as a boolean.
openmultiplayer/web/docs/translations/th/scripting/functions/GetConsoleVarAsString.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/GetConsoleVarAsString.md", "repo_id": "openmultiplayer", "token_count": 605 }
417
--- title: GetPlayerAnimationIndex description: Returns the index of any running applied animations. tags: ["player"] --- ## คำอธิบาย Returns the index of any running applied animations. | Name | Description | | -------- | ---------------------------------------------------------------- | | playerid | ID of the player of whom you want to get the animation index of. | ## ส่งคืน 0 if there is no animation applied ## ตัวอย่าง ```c public OnPlayerUpdate(playerid) { if (GetPlayerAnimationIndex(playerid)) { new animlib[32]; new animname[32]; new msg[128]; GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32); format(msg, 128, "Running anim: %s %s", animlib, animname); SendClientMessage(playerid, 0xFFFFFFFF, msg); } return 1; } ``` ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [GetAnimationName](../functions/GetAnimationName): Get the animation library/name for the index.
openmultiplayer/web/docs/translations/th/scripting/functions/GetPlayerAnimationIndex.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/GetPlayerAnimationIndex.md", "repo_id": "openmultiplayer", "token_count": 450 }
418
--- title: GetPlayerFacingAngle description: Gets the angle a player is facing. tags: ["player"] --- ## คำอธิบาย Gets the angle a player is facing. | Name | Description | | ---------- | ----------------------------------------------------- | | playerid | The player you want to get the angle of. | | &Float:ang | The Float to store the angle in, passed by reference. | ## ส่งคืน 1: The function executed successfully. 0: The function failed to execute. This means the player does not exist. The player's angle is stored in the specified variable. ## ตัวอย่าง ```c new Float:Angle, string[26]; GetPlayerFacingAngle(playerid, Angle); format(string, sizeof(string), "Your facing angle: %0.2f", Angle); SendClientMessage(playerid, 0xFFFFFFFF, string); ``` ## บันทึก :::tip Angles returned when inside a vehicle is rarely correct. To get the correct facing angle while inside a vehicle, use GetVehicleZAngle. ::: :::warning Angles are reversed in GTA:SA; 90 degrees would be East in the real world, but in GTA:SA 90 degrees is in fact West. North and South are still 0/360 and 180. To convert this, simply do 360 - angle. ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [GetVehicleZAngle](../functions/GetVehicleZAngle): Check the current angle of a vehicle. - [SetPlayerFacingAngle](../functions/SetPlayerFacingAngle): Set a player's facing angle.
openmultiplayer/web/docs/translations/th/scripting/functions/GetPlayerFacingAngle.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/GetPlayerFacingAngle.md", "repo_id": "openmultiplayer", "token_count": 553 }
419
--- title: GetPlayerPoolSize description: Gets the highest playerid currently in use on the server. tags: ["player"] --- :::warning ฟังก์ชั่นนี้ถูกเพิ่มใน SA-MP 0.3.7 และจะไม่ทำงานในเวอร์ชั่นก่อนหน้านี้! ::: ## คำอธิบาย Gets the highest playerid currently in use on the server. | Name | Description | | ---- | ----------- | ## ตัวอย่าง ```c FreezeAll() { // note that we assign the return value to a new variable (j) to avoid calling the function with each iteration for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++) { TogglePlayerControllable(i, 0); } } ``` ## ฟังก์ชั่นที่เกี่ยวข้องกัน - GetVehiclePoolSize: Gets the highest vehicleid currently in use on the server. - GetMaxPlayers: Gets the maximum number of players that can join the server.
openmultiplayer/web/docs/translations/th/scripting/functions/GetPlayerPoolSize.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/GetPlayerPoolSize.md", "repo_id": "openmultiplayer", "token_count": 425 }
420
--- title: GetPlayerVirtualWorld description: Retrieves the current virtual world the player is in. tags: ["player"] --- ## คำอธิบาย Retrieves the current virtual world the player is in. | Name | Description | | -------- | ------------------------------------------------- | | playerid | The ID of the player to get the virtual world of. | ## ส่งคืน The ID of the virtual world the player is currently in. ## ตัวอย่าง ```c public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/world", true)) { new string[32]; format(string, sizeof(string), "Your virtual world: %i", GetPlayerVirtualWorld(playerid)); SendClientMessage(playerid, 0xFFFFFFFF, string); return 1; } return 0; } ``` ## บันทึก :::tip Virtual worlds are not the same as interiors. ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน - SetPlayerVirtualWorld: Set the virtual world of a player. - GetVehicleVirtualWorld: Check what virtual world a vehicle is in. - GetPlayerInterior: Get the current interior of a player.
openmultiplayer/web/docs/translations/th/scripting/functions/GetPlayerVirtualWorld.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/GetPlayerVirtualWorld.md", "repo_id": "openmultiplayer", "token_count": 468 }
421
--- title: GetVehicleComponentInSlot description: Retrieves the installed component ID (modshop mod(ification)) on a vehicle in a specific slot. tags: ["vehicle"] --- ## คำอธิบาย Retrieves the installed component ID (modshop mod(ification)) on a vehicle in a specific slot. | Name | Description | | --------- | ------------------------------------------------- | | vehicleid | The ID of the vehicle to check for the component. | | slot | The component slot to check for components. | ## ส่งคืน The ID of the component installed in the specified slot. Returns 0 if no component in specified vehicle's specified slot, or if vehicle doesn't exist. ## ตัวอย่าง ```c public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp("/myspoiler", cmdtext) && IsPlayerInAnyVehicle(playerid)) { new component; component = GetVehicleComponentInSlot(GetPlayerVehicleID(playerid), CARMODTYPE_SPOILER); if (component == 1049) { SendClientMessage(playerid,0xFFFFFFFF,"You have an Alien spoiler installed in your Elegy!"); } } } ``` ## บันทึก :::warning Known Bug(s): Doesn't work for CARMODTYPE_STEREO. Both front bull bars and front bumper components are saved in the CARMODTYPE_FRONT_BUMPER slot. If a vehicle has both of them installed, this function will only return the one which was installed last. Both rear bull bars and rear bumper components are saved in the CARMODTYPE_REAR_BUMPER slot. If a vehicle has both of them installed, this function will only return the one which was installed last. Both left side skirt and right side skirt are saved in the CARMODTYPE_SIDESKIRT slot. If a vehicle has both of them installed, this function will only return the one which was installed last. ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน - AddVehicleComponent: Add a component to a vehicle. - GetVehicleComponentType: Check the type of component via the ID. - OnVehicleMod: Called when a vehicle is modded. - OnEnterExitModShop: Called when a vehicle enters or exits a mod shop.
openmultiplayer/web/docs/translations/th/scripting/functions/GetVehicleComponentInSlot.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/GetVehicleComponentInSlot.md", "repo_id": "openmultiplayer", "token_count": 730 }
422
--- title: GetVehicleVirtualWorld description: Get the virtual world of a vehicle. tags: ["vehicle"] --- ## คำอธิบาย Get the virtual world of a vehicle. | Name | Description | | --------- | -------------------------------------------------- | | vehicleid | The ID of the vehicle to get the virtual world of. | ## ส่งคืน The virtual world that the vehicle is in. ## ตัวอย่าง ```c new world = GetVehicleVirtualWorld(vehicleid); SetPlayerVirtualWorld(playerid, world); ``` ## ฟังก์ชั่นที่เกี่ยวข้องกัน - SetVehicleVirtualWorld: Set the virtual world of a vehicle. - GetPlayerVirtualWorld: Check what virtual world a player is in.
openmultiplayer/web/docs/translations/th/scripting/functions/GetVehicleVirtualWorld.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/GetVehicleVirtualWorld.md", "repo_id": "openmultiplayer", "token_count": 304 }
423
--- title: IsPlayerInCheckpoint description: Check if the player is currently inside a checkpoint, this could be used for properties or teleport points for example. tags: ["player", "checkpoint"] --- ## คำอธิบาย Check if the player is currently inside a checkpoint, this could be used for properties or teleport points for example. | Name | Description | | -------- | ------------------------------------------ | | playerid | The player you want to know the status of. | ## ส่งคืน false if player isn't in his checkpoint else true ## ตัวอย่าง ```c if (IsPlayerInCheckpoint(playerid)) { SetPlayerHealth(playerid, 100.0); } ``` ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [SetPlayerCheckpoint](../../scripting/functions/SetPlayerCheckpoint.md): Create a checkpoint for a player. - [DisablePlayerCheckpoint](../../scripting/functions/DisablePlayerCheckpoint.md): Disable the player's current checkpoint. - [SetPlayerRaceCheckpoint](../../scripting/functions/SetPlayerRaceCheckpoint.md): Create a race checkpoint for a player. - [DisablePlayerRaceCheckpoint](../../scripting/functions/DisablePlayerRaceCheckpoint.md): Disable the player's current race checkpoint. - [IsPlayerInRaceCheckpoint](../../scripting/functions/IsPlayerInRaceCheckpoint.md): Check if a player is in a race checkpoint. - [OnPlayerEnterCheckpoint](../../scripting/callbacks/OnPlayerEnterCheckpoint.md): Called when a player enters a checkpoint. - [OnPlayerLeaveCheckpoint](../../scripting/callbacks/OnPlayerLeaveCheckpoint.md): Called when a player leaves a checkpoint. - [OnPlayerEnterRaceCheckpoint](../../scripting/callbacks/OnPlayerEnterRaceCheckpoint.md): Called when a player enters a race checkpoint. - [OnPlayerLeaveRaceCheckpoint](../../scripting/callbacks/OnPlayerLeaveRaceCheckpoint.md): Called when a player leaves a race checkpoint.
openmultiplayer/web/docs/translations/th/scripting/functions/IsPlayerInCheckpoint.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/IsPlayerInCheckpoint.md", "repo_id": "openmultiplayer", "token_count": 597 }
424
--- title: LimitPlayerMarkerRadius description: Set the player marker radius. tags: ["player"] --- ## คำอธิบาย Set the player marker radius. | Name | Description | | ------------------- | ------------------------------------ | | Float:marker_radius | The radius that markers will show at | ## ส่งคืน This function does not return any specific values. ## ตัวอย่าง ```c public OnGameModeInit() { LimitPlayerMarkerRadius(100.0); } ``` ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [ShowPlayerMarkers](../functions/ShowPlayerMarkers.md): Decide if the server should show markers on the radar. - [SetPlayerMarkerForPlayer](../functions/SetPlayerMarkerForPlayer.md): Set a player's marker. - [LimitGlobalChatRadius](../functions/LimitGlobalChatRadius.md): Limit the distance between players needed to see their chat.
openmultiplayer/web/docs/translations/th/scripting/functions/LimitPlayerMarkerRadius.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/LimitPlayerMarkerRadius.md", "repo_id": "openmultiplayer", "token_count": 356 }
425
--- title: PlayerPlaySound description: Plays the specified sound for a player. tags: ["player"] --- ## คำอธิบาย Plays the specified sound for a player. For a library that lists all sounds, check out [this](https://github.com/WoutProvost/samp-sound-array). | Name | Description | | -------- | ------------------------------------------------------------ | | playerid | The ID of the player for whom to play the sound. | | soundid | The sound to play. | | Float:x | X coordinate for the sound to play at. (0.0 for no position) | | Float:y | Y coordinate for the sound to play at. (0.0 for no position) | | Float:z | Z coordinate for the sound to play at. (0.0 for no position) | ## ส่งคืน 1: The function was executed successfully. 0: The function failed to execute. This means the player is not connected. ## ตัวอย่าง ```c // player punching sound (fits for commands such as /slap well). The sound will be quiet, as the source is actually 10 meters above the player. PlayerPlaySound(playerid, 1130, 0.0, 0.0, 10.0); ``` ## บันทึก :::tip Only use the coordinates if you want the sound to be played at a certain position. Set coordinates all to 0.0 to just play the sound. ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน - PlayCrimeReportForPlayer: Play a crime report for a player. - PlayAudioStreamForPlayer: Plays a audio stream for a player. - StopAudioStreamForPlayer: Stops the current audio stream for a player.
openmultiplayer/web/docs/translations/th/scripting/functions/PlayerPlaySound.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/PlayerPlaySound.md", "repo_id": "openmultiplayer", "token_count": 608 }
426
--- title: PlayerTextDrawSetSelectable description: Toggles whether a player-textdraw can be selected or not. tags: ["player", "textdraw", "playertextdraw"] --- ## คำอธิบาย Toggles whether a player-textdraw can be selected or not. | Name | Description | |-----------------|--------------------------------------------------------------------------------------------------| | playerid | The ID of the player whose player-textdraw to set the selectability of. | | PlayerText:text | The ID of the player-textdraw to set the selectability of. | | bool:set | Set the player-textdraw selectable (true) or non-selectable (false). By default this is (false). | ## ส่งคืน This function does not return any specific values. ## ตัวอย่าง ```c public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/select_ptd", true)) { for (new i = 0; i < MAX_PLAYER_TEXT_DRAWS; i++) { PlayerTextDrawSetSelectable(playerid, PlayerText:i, true); } SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: All player-textdraws can be selected now!"); return 1; } return 0; } ``` ## บันทึก :::tip Use [PlayerTextDrawTextSize](PlayerTextDrawTextSize) to define the clickable area. ::: :::warning PlayerTextDrawSetSelectable MUST be used BEFORE the textdraw is shown to the player. ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [SelectTextDraw](SelectTextDraw): Enables the mouse, so the player can select a textdraw - [CancelSelectTextDraw](CancelSelectTextDraw): Cancel textdraw selection with the mouse ## Related Callbacks - [OnPlayerClickPlayerTextDraw](../callbacks/OnPlayerClickPlayerTextDraw): Called when a player clicks on a player-textdraw.
openmultiplayer/web/docs/translations/th/scripting/functions/PlayerTextDrawSetSelectable.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/PlayerTextDrawSetSelectable.md", "repo_id": "openmultiplayer", "token_count": 802 }
427
--- title: SelectObject description: Display the cursor and allow the player to select an object. tags: [] --- ## คำอธิบาย Display the cursor and allow the player to select an object. OnPlayerSelectObject is called when the player selects an object. | Name | Description | | -------- | ------------------------------------------------------------- | | playerid | The ID of the player that should be able to select the object | ## ส่งคืน This function does not return any specific values. ## ตัวอย่าง ```c public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/select", true)) { SelectObject(playerid); SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: Please select the object you'd like to edit!"); return 1; } return 0; } ``` ## ฟังก์ชั่นที่เกี่ยวข้องกัน - CreateObject: Create an object. - DestroyObject: Destroy an object. - MoveObject: Move an object. - EditObject: Edit an object. - EditPlayerObject: Edit an object. - EditAttachedObject: Edit an attached object. - CancelEdit: Cancel the edition of an object. - OnPlayerSelectObject: Called when a player selected an object.
openmultiplayer/web/docs/translations/th/scripting/functions/SelectObject.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/SelectObject.md", "repo_id": "openmultiplayer", "token_count": 470 }
428
--- title: SetGameModeText description: Set the name of the game mode, which appears in the server browser. tags: [] --- ## คำอธิบาย Set the name of the game mode, which appears in the server browser. | Name | Description | | -------- | ----------------------------- | | string[] | The gamemode name to display. | ## ส่งคืน This function does not return any specific values. ## ตัวอย่าง ```c public OnGameModeInit() { SetGameModeText("Team Deathmatch"); return 1; } ``` ## ฟังก์ชั่นที่เกี่ยวข้องกัน
openmultiplayer/web/docs/translations/th/scripting/functions/SetGameModeText.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/SetGameModeText.md", "repo_id": "openmultiplayer", "token_count": 260 }
429
--- title: SetPlayerAttachedObject description: Attach an object to a specific bone on a player. tags: ["player"] --- ## คำอธิบาย Attach an object to a specific bone on a player. | Name | Description | | -------------- | ------------------------------------------------------------------------------------ | | playerid | The ID of the player to attach the object to. | | index | The index (slot) to assign the object to (0-9 since 0.3d, 0-4 in previous versions). | | modelid | The model to attach. | | bone | The bone to attach the object to. | | fOffsetX | (optional) X axis offset for the object position. | | fOffsetY | (optional) Y axis offset for the object position. | | fOffsetZ | (optional) Z axis offset for the object position. | | fRotX | (optional) X axis rotation of the object. | | fRotY | (optional) Y axis rotation of the object. | | fRotZ | (optional) Z axis rotation of the object. | | fScaleX | (optional) X axis scale of the object. | | fScaleY | (optional) Y axis scale of the object. | | fScaleZ | (optional) Z axis scale of the object. | | materialcolor1 | (optional) The first object color to set, as an integer or hex in ARGB color format. | | materialcolor2 | (optional) The second object color to set, as an integer or hex in ARGB color format | ## ส่งคืน 1 on success, 0 on failure. ## ตัวอย่าง ```c public OnPlayerSpawn(playerid) { SetPlayerAttachedObject(playerid, 3, 1609, 2); //Attach a turtle to the playerid's head, in slot 3 // example of using colors on an object being attached to the player: SetPlayerAttachedObject(playerid, 3, 19487, 2, 0.101, -0.0, 0.0, 5.50, 84.60, 83.7, 1.0, 1.0, 1.0, 0xFF00FF00); // Attach a white hat to the head of the player and paint it green return 1; } #define SetPlayerHoldingObject(%1,%2,%3,%4,%5,%6,%7,%8,%9) SetPlayerAttachedObject(%1,MAX_PLAYER_ATTACHED_OBJECTS-1,%2,%3,%4,%5,%6,%7,%8,%9) #define StopPlayerHoldingObject(%1) RemovePlayerAttachedObject(%1,MAX_PLAYER_ATTACHED_OBJECTS-1) #define IsPlayerHoldingObject(%1) IsPlayerAttachedObjectSlotUsed(%1,MAX_PLAYER_ATTACHED_OBJECTS-1) ``` ## บันทึก :::tip This function is separate from the CreateObject / CreatePlayerObject pools. ::: :::warning In version 0.3d and onwards, 10 objects can be attached to a single player (index 0-9). In earlier versions, the limit is 5 (index 0-4). ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน - RemovePlayerAttachedObject: Remove an attached object from a player - IsPlayerAttachedObjectSlotUsed: Check whether an object is attached to a player in a specified index - EditAttachedObject: Edit an attached object.
openmultiplayer/web/docs/translations/th/scripting/functions/SetPlayerAttachedObject.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/SetPlayerAttachedObject.md", "repo_id": "openmultiplayer", "token_count": 1638 }
430
--- title: SetPlayerObjectMaterialText description: Replace the texture of a player object with text. tags: ["player"] --- ## คำอธิบาย Replace the texture of a player object with text. | Name | Description | | ------------- | ------------------------------------------------------------ | | playerid | The ID of the player whose player object to set the text of. | | objectid | The ID of the object on which to place the text. | | text | The text to set. | | materialindex | The material index to replace with text (DEFAULT: 0). | | materialsize | The size of the material (DEFAULT: 256x128). | | fontface | The font to use (DEFAULT: Arial). | | fontsize | The size of the text (DEFAULT: 24) (MAX 255). | | bold | Bold text. Set to 1 for bold, 0 for not (DEFAULT: 1). | | fontcolor | The color of the text (DEFAULT: White). | | backcolor | The background color (DEFAULT: None (transparent)). | | textalignment | The alignment of the text (DEFAULT: Left). | ## ส่งคืน This function does not return any specific values. ## ตัวอย่าง ```c if (strcmp("/text", cmdtext, true) == 0) { new myobject = CreatePlayerObject(playerid, 19353, 0, 0, 10, 0.0, 0.0, 90.0); //create the object SetPlayerObjectMaterialText(playerid, myobject, "SA-MP {FFFFFF}0.3{008500}e {FF8200}RC7", 0, OBJECT_MATERIAL_SIZE_256x128,\ "Arial", 28, 0, 0xFFFF8200, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER); // write "SA-MP 0.3e RC7" on the object, with orange font color and black background return 1; } ``` ## บันทึก :::tip Color embedding can be used for multiple colors in the text. ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน - SetObjectMaterialText: Replace the texture of an object with text. - SetPlayerObjectMaterial: Replace the texture of a player object with the texture from another model in the game. - Ultimate Creator by Nexius - Texture Studio by [uL]Pottus - Fusez's Map Editor by RedFusion - Map Editor I by adri1
openmultiplayer/web/docs/translations/th/scripting/functions/SetPlayerObjectMaterialText.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/SetPlayerObjectMaterialText.md", "repo_id": "openmultiplayer", "token_count": 975 }
431
--- title: SetPlayerWantedLevel description: Set a player's wanted level (6 brown stars under HUD). tags: ["player"] --- ## คำอธิบาย Set a player's wanted level (6 brown stars under HUD). | Name | Description | | -------- | ------------------------------------------------ | | playerid | The ID of the player to set the wanted level of. | | level | The wanted level to set for the player (0-6). | ## ส่งคืน 1: The function executed successfully. 0: The function failed to execute. The player specified does not exist. ## ตัวอย่าง ```c if (strcmp(cmdtext, "/turnuptheheat", true) == 0) { SetPlayerWantedLevel(playerid, 6); SendClientMessage(playerid, 0xFF0000FF, "Wanted Level: 6"); return 1; } ``` ## ฟังก์ชั่นที่เกี่ยวข้องกัน - GetPlayerWantedLevel: Check a player's wanted level. - PlayCrimeReportForPlayer: Play a crime report for a player.
openmultiplayer/web/docs/translations/th/scripting/functions/SetPlayerWantedLevel.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/SetPlayerWantedLevel.md", "repo_id": "openmultiplayer", "token_count": 392 }
432
--- title: SetVehicleParamsForPlayer description: Set the parameters of a vehicle for a player. tags: ["player", "vehicle"] --- ## คำอธิบาย Set the parameters of a vehicle for a player. | Name | Description | | ----------- | --------------------------------------------------------------------------------------------- | | vehicle | The ID of the vehicle to set the parameters of. | | playerid | The ID of the player to set the vehicle's parameters for. | | objective | 0 to disable the objective or 1 to show it. This is a bobbing yellow arrow above the vehicle. | | doorslocked | 0 to unlock the doors or 1 to lock them. | ## ส่งคืน 1: The function executed successfully. 0: The function failed to execute. The player and/or vehicle specified do not exist. ## ตัวอย่าง ```c // sometime earlier: SetVehicleParamsForPlayer(iPlayerVehicle, iPlayerID, 1, 0); // sometime later when you want the vehicle to respawn: new iEngine, iLights, iAlarm, iDoors, iBonnet, iBoot, iObjective; GetVehicleParamsEx(iPlayerVehicle, iEngine, iLights, iAlarm, iDoors, iBonnet, iBoot, iObjective); SetVehicleParamsEx(iPlayerVehicle, iEngine, iLights, iAlarm, iDoors, iBonnet, iBoot, 0); // Locks own car for all players, except the player who used the command. public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext,"/lock",true)) { if (!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFFFFFFAA,"You have to be inside a vehicle."); for(new i=0; i < MAX_PLAYERS; i++) { if (i == playerid) continue; SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,0,1); } return 1; } return 0; } // Will show vehicle markers for players streaming in for 0.3a+ new iVehicleObjective[MAX_VEHICLES][2]; public OnGameModeInit() //Or another callback { new temp = AddStaticVehicleEx(400, 0.0, 0.0, 5.0, 0.0, 0,0, -1); //ID 1 iVehicleObjective[temp][0] = 1; //Marker iVehicleObjective[temp][1] = 0; //Door Lock return 1; } stock SetVehicleParamsForPlayerEx(vehicleid, playerid, objective, doorslocked) { SetVehicleParamsForPlayer(vehicleid, playerid, objective, doorslocked); iVehicleObjective[vehicleid][0] = objective; iVehicleObjective[vehicleid][1] = doorslocked; } public OnVehicleStreamIn(vehicleid, forplayerid) { SetVehicleParamsForPlayer(vehicleid, forplayerid, iVehicleObjective[vehicleid][0], iVehicleObjective[vehicleid][1]); } //Top new myMarkedCar; public OnGameModeInit() //Or another callback { myMarkedCar = AddStaticVehicleEx(400, 0.0, 0.0, 5.0, 0.0, 0,0, -1); //For example: Black Landstalker near Blueberry Acres return 1; } //Whatever your want public OnVehicleStreamIn(vehicleid, forplayerid) { if (vehicleid == myMarkedCar) { SetVehicleParamsForPlayer(myMarkedCar, forplayerid, 1, 0); // marker can be visible only if the vehicle streamed for player } return 1; } ``` ## บันทึก :::tip Vehicles must be respawned for the 'objective' to be removed. ::: :::warning Since 0.3a you will have to reapply this function when OnVehicleStreamIn is called. ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน - SetVehicleParamsEx: Sets a vehicle's params for all players.
openmultiplayer/web/docs/translations/th/scripting/functions/SetVehicleParamsForPlayer.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/SetVehicleParamsForPlayer.md", "repo_id": "openmultiplayer", "token_count": 1478 }
433
--- title: StopObject description: Stop a moving object after MoveObject has been used. tags: [] --- ## คำอธิบาย Stop a moving object after MoveObject has been used. | Name | Description | | -------- | ------------------------------------ | | objectid | The ID of the object to stop moving. | ## ส่งคืน This function does not return any specific values. ## ตัวอย่าง ```c public OnGameModeInit() { new obj; obj = CreateObject(...); return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmd, "/stopobject", true) == 0) { StopObject(obj); return 1; } return 0; } ``` ## ฟังก์ชั่นที่เกี่ยวข้องกัน - CreateObject: Create an object. - DestroyObject: Destroy an object. - IsValidObject: Checks if a certain object is vaild. - MoveObject: Move an object. - SetObjectPos: Set the position of an object. - SetObjectRot: Set the rotation of an object. - GetObjectPos: Locate an object. - GetObjectRot: Check the rotation of an object. - AttachObjectToPlayer: Attach an object to a player. - CreatePlayerObject: Create an object for only one player. - DestroyPlayerObject: Destroy a player object. - IsValidPlayerObject: Checks if a certain player object is vaild. - MovePlayerObject: Move a player object. - StopPlayerObject: Stop a player object from moving. - SetPlayerObjectPos: Set the position of a player object. - SetPlayerObjectRot: Set the rotation of a player object. - GetPlayerObjectPos: Locate a player object. - GetPlayerObjectRot: Check the rotation of a player object. - AttachPlayerObjectToPlayer: Attach a player object to a player. - OnObjectMoved: Called when an object stops moving.
openmultiplayer/web/docs/translations/th/scripting/functions/StopObject.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/StopObject.md", "repo_id": "openmultiplayer", "token_count": 607 }
434
--- title: TextDrawSetPreviewRot description: Sets the rotation and zoom of a 3D model preview textdraw. tags: ["textdraw"] --- ## คำอธิบาย Sets the rotation and zoom of a 3D model preview textdraw. | Name | Description | | ----------- | ------------------------------------------------------------------------------------------------------------------------ | | Float:fRotX | The X rotation value. | | Float:fRotY | The Y rotation value. | | Float:fRotZ | The Z rotation value. | | Float:fZoom | The zoom value, default value 1.0, smaller values make the camera closer and larger values make the camera further away. | ## ส่งคืน This function does not return any specific values. ## ตัวอย่าง ```c new Text:textdraw public OnGameModeInit() { textdraw = TextDrawCreate(320.0, 240.0, "_"); TextDrawFont(textdraw, TEXT_DRAW_FONT_MODEL_PREVIEW); TextDrawUseBox(textdraw, 1); TextDrawBoxColor(textdraw, 0x000000FF); TextDrawTextSize(textdraw, 40.0, 40.0); TextDrawSetPreviewModel(textdraw, 411); TextDrawSetPreviewRot(textdraw, -10.0, 0.0, -20.0, 1.0); //You still have to use TextDrawShowForAll/TextDrawShowForPlayer to make the textdraw visible. return 1; } ``` ## บันทึก :::warning The textdraw MUST use the font type TEXT_DRAW_FONT_MODEL_PREVIEW and already have a model set in order for this function to have effect. ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [PlayerTextDrawSetPreviewRot](../functions/PlayerTextDrawSetPreviewRot.md): Set rotation of a 3D player textdraw preview. - [TextDrawSetPreviewModel](../functions/TextDrawSetPreviewModel.md): Set the 3D preview model of a textdraw. - [TextDrawSetPreviewVehCol](../functions/TextDrawSetPreviewVehCol.md): Set the colours of a vehicle in a 3D textdraw preview. - [TextDrawFont](../functions/TextDrawFont.md): Set the font of a textdraw. - [OnPlayerClickTextDraw](../callbacks/OnPlayerClickTextDraw.md): Called when a player clicks on a textdraw.
openmultiplayer/web/docs/translations/th/scripting/functions/TextDrawSetPreviewRot.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/TextDrawSetPreviewRot.md", "repo_id": "openmultiplayer", "token_count": 1105 }
435
--- title: UpdatePlayer3DTextLabelText description: Updates a player 3D Text Label's text and color. tags: ["player", "3dtextlabel"] --- ## คำอธิบาย Updates a player 3D Text Label's text and color | Name | Description | | --------------- | ------------------------------------------------------------- | | playerid | The ID of the player for which the 3D Text Label was created. | | PlayerText3D:textid | The 3D Text Label you want to update. | | color | The color the 3D Text Label should have from now on. | | text[] | The new text which the 3D Text Label should have from now on. | ## ส่งคืน This function does not return any specific values. ## บันทึก :::warning If text[] is empty, the server/clients next to the text might crash! ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [Create3DTextLabel](../functions/Create3DTextLabel.md): Create a 3D text label. - [Delete3DTextLabel](../functions/Delete3DTextLabel.md): Delete a 3D text label. - [Attach3DTextLabelToPlayer](../functions/Attach3DTextLabelToPlayer.md): Attach a 3D text label to a player. - [Attach3DTextLabelToVehicle](../functions/Attach3DTextLabelToVehicle.md): Attach a 3D text label to a vehicle. - [Update3DTextLabelText](../functions/Update3DTextLabelText.md): Change the text of a 3D text label. - [CreatePlayer3DTextLabel](../functions/CreatePlayer3DTextLabel.md): Create A 3D text label for one player. - [DeletePlayer3DTextLabel](../functions/DeletePlayer3DTextLabel.md): Delete a player's 3D text label.
openmultiplayer/web/docs/translations/th/scripting/functions/UpdatePlayer3DTextLabelText.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/UpdatePlayer3DTextLabelText.md", "repo_id": "openmultiplayer", "token_count": 647 }
436
--- title: db_get_field_assoc_float description: Get the contents of field as a float with specified name. tags: ["sqlite"] --- :::warning This function starts with lowercase letter. ::: ## คำอธิบาย Get the contents of field as a float with specified name. | Name | Description | | ----------------- | ---------------------------------- | | DBResult:dbresult | The result to get the data from | | field[] | The fieldname to get the data from | ## ส่งคืน Retrieved value as floating point number. ## บันทึก :::warning Using an invalid handle will crash your server! Get a valid handle by using db_query. But it's protected against NULL references. ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน - db_open: Open a connection to an SQLite database - db_close: Close the connection to an SQLite database - db_query: Query an SQLite database - db_free_result: Free result memory from a db_query - db_num_rows: Get the number of rows in a result - db_next_row: Move to the next row - db_num_fields: Get the number of fields in a result - db_field_name: Returns the name of a field at a particular index - db_get_field: Get content of field with specified ID from current result row - db_get_field_assoc: Get content of field with specified name from current result row - db_get_field_int: Get content of field as an integer with specified ID from current result row - db_get_field_assoc_int: Get content of field as an integer with specified name from current result row - db_get_field_float: Get content of field as a float with specified ID from current result row - db_get_field_assoc_float: Get content of field as a float with specified name from current result row - db_get_mem_handle: Get memory handle for an SQLite database that was opened with db_open. - db_get_result_mem_handle: Get memory handle for an SQLite query that was executed with db_query. - db_debug_openfiles - db_debug_openresults
openmultiplayer/web/docs/translations/th/scripting/functions/db_get_field_assoc_float.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/db_get_field_assoc_float.md", "repo_id": "openmultiplayer", "token_count": 652 }
437
--- title: fexist description: Checks if a specific file exists in the scriptfiles directory. tags: [] --- :::warning This function starts with lowercase letter. ::: ## คำอธิบาย Checks if a specific file exists in the scriptfiles directory. | Name | Description | | ----------- | ------------------------------------------------------ | | pattern[] | The name of the file, optionally containing wild-cards | | characters. | ## ส่งคืน The number of files that match the pattern. ## ตัวอย่าง ```c // Check, if "file.txt" exists if (fexist("file.txt")) { // Success // Print the success print("\"file.txt\" exists."); } else { // Error print("\"file.txt\" does not exist."); } ``` ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [fopen](../functions/fopen): Open a file. - [fclose](../functions/fclose): Close a file. - [ftemp](../functions/ftemp): Create a temporary file stream. - [fremove](../functions/fremove): Remove a file. - [fwrite](../functions/fwrite): Write to a file. - [fread](../functions/fread): Read a file. - [fputchar](../functions/fputchar): Put a character in a file. - [fgetchar](../functions/fgetchar): Get a character from a file. - [fblockwrite](../functions/fblockwrite): Write blocks of data into a file. - [fblockread](../functions/fblockread): Read blocks of data from a file. - [fseek](../functions/fseek): Jump to a specific character in a file. - [flength](../functions/flength): Get the file length. - [fexist](../functions/fexist): Check, if a file exists. - [fmatch](../functions/fmatch): Check, if patterns with a file name matches.
openmultiplayer/web/docs/translations/th/scripting/functions/fexist.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/fexist.md", "repo_id": "openmultiplayer", "token_count": 642 }
438
--- title: floatstr description: Converts a string to a float. tags: [] --- :::warning This function starts with lowercase letter. ::: ## คำอธิบาย Converts a string to a float. | Name | Description | | ------ | ----------------------------------- | | string | The string to convert into a float. | ## ส่งคืน The requested float value. ## ตัวอย่าง ```c new before[4] = "6.9"; // A STRING holding a FLOAT. SetPlayerPos(playerid, 0, 0, floatstr(before)); ``` ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [floatround](../functions/floatround): Convert a float to an integer (rounding). - [float](../functions/float): Convert an integer to a float.
openmultiplayer/web/docs/translations/th/scripting/functions/floatstr.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/floatstr.md", "repo_id": "openmultiplayer", "token_count": 312 }
439
--- title: gettime description: Get the current server time, which will be stored in the variables &hour, &minute and &second. tags: [] --- :::warning This function starts with lowercase letter. ::: ## คำอธิบาย Get the current server time, which will be stored in the variables &hour, &minute and &second. | Name | Description | | --------- | ---------------------------------------------------------- | | &hour=0 | The variable to store the hour in, passed by reference. | | &minute=0 | The variable to store the minute in, passed by reference. | | &second=0 | The variable to store the seconds in, passed by reference. | ## ส่งคืน The function itself returns a Unix Timestamp. ## ตัวอย่าง ```c new Hour, Minute, Second, Timestamp; Timestamp = gettime(Hour, Minute, Second); printf("%02d:%02d:%02d", Hour, Minute, Second); printf("Seconds since midnight 1st January 1970: %d", Timestamp); ``` ## บันทึก :::tip This function is useful for measuring time intervals by using its timestamp characteristics. This can be particularly useful if you want to restrict some functionality based on a time (e.g. a command that can only be executed every 30 seconds). Using this method you don't have to rely on timers. ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน - getdate: Get the current date of the server.
openmultiplayer/web/docs/translations/th/scripting/functions/gettime.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/gettime.md", "repo_id": "openmultiplayer", "token_count": 505 }
440
--- title: strcmp description: Compares two strings to see if they are the same. tags: [] --- :::warning This function starts with lowercase letter. ::: ## คำอธิบาย Compares two strings to see if they are the same. | Name | Description | | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | | string1 | The first string to compare. | | string2 | The second string to compare. | | ignorecase (optional) | When set to true, the case doesn't matter - HeLLo is the same as Hello. When false, they're not the same. | | length (optional) | When this length is set, the first x chars will be compared - doing "Hello" and "Hell No" with a length of 4 will say it's the same string. | ## ส่งคืน 0 if strings match each other on given length;1 o r -1 if some character do not match: string1[i] - string2[i] ('i' represents character index starting from 0);difference in number of characters if one string matches only part of another string. ## ตัวอย่าง ```c new string1[] = "Hello World"; new string2[] = "Hello World"; // Check if the strings are the same if (!strcmp(string1, string2)) new string3[] = "Hell"; // Check if the first 4 characters match if (!strcmp(string2, string3, false, 4)) // Check for null strings with isnull() if (!strcmp(string1, string2) && !isnull(string1) && !isnull(string2)) // Definition for isnull(): #if !defined isnull #define isnull(%1) ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1])))) #endif ``` ## บันทึก :::warning This function returns 0 if either string is empty. Check for null strings with isnull(). If you compare strings from a text file, you should take in to account the 'carriage return' and 'new line' special characters (\r \n), as they are included, when using fread. ::: ## ฟังก์ชั่นที่เกี่ยวข้องกัน - strfind: Search for a string in another string. - strtok: Get the next 'token' (word/parameter) in a string. - strdel: Delete part of a string. - strins: Insert text into a string. - strlen: Get the length of a string. - strmid: Extract part of a string into another string. - strpack: Pack a string into a destination string. - strval: Convert a string into an integer. - strcat: Concatenate two strings into a destination reference. - http://www.compuphase.com/pawn/String_Manipulation.pdf
openmultiplayer/web/docs/translations/th/scripting/functions/strcmp.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/functions/strcmp.md", "repo_id": "openmultiplayer", "token_count": 1211 }
441
--- title: Map Icons description: A list of Map Icons --- | ID | Icon | Name | | --- | -------------------------------- | --------------------------------- | | 0 | ![](/images/mapIcons/icon0.gif) | Colored Square/Triangle (Dynamic) | | 1 | ![](/images/mapIcons/icon1.gif) | White Square | | 2 | ![](/images/mapIcons/icon2.gif) | Player Position | | 3 | ![](/images/mapIcons/icon3.gif) | Player (Menu Map) | | 4 | ![](/images/mapIcons/icon4.gif) | North | | 5 | ![](/images/mapIcons/icon5.gif) | Air Yard | | 6 | ![](/images/mapIcons/icon6.gif) | Ammunation | | 7 | ![](/images/mapIcons/icon7.gif) | Barber | | 8 | ![](/images/mapIcons/icon8.gif) | Big Smoke | | 9 | ![](/images/mapIcons/icon9.gif) | Boat Yard | | 10 | ![](/images/mapIcons/icon10.gif) | Burger Shot | | 11 | ![](/images/mapIcons/icon11.gif) | Quarry | | 12 | ![](/images/mapIcons/icon12.gif) | Catalina | | 13 | ![](/images/mapIcons/icon13.gif) | Cesar | | 14 | ![](/images/mapIcons/icon14.gif) | Cluckin' Bell | | 15 | ![](/images/mapIcons/icon15.gif) | Carl Johnson | | 16 | ![](/images/mapIcons/icon16.gif) | C.R.A.S.H | | 17 | ![](/images/mapIcons/icon17.gif) | Diner | | 18 | ![](/images/mapIcons/icon18.gif) | Emmet | | 19 | ![](/images/mapIcons/icon19.gif) | Enemy Attack | | 20 | ![](/images/mapIcons/icon20.gif) | Fire | | 21 | ![](/images/mapIcons/icon21.gif) | Girlfriend | | 22 | ![](/images/mapIcons/icon22.gif) | Hospital | | 23 | ![](/images/mapIcons/icon23.gif) | Loco | | 24 | ![](/images/mapIcons/icon24.gif) | Madd Dogg | | 25 | ![](/images/mapIcons/icon25.gif) | Caligulus | | 26 | ![](/images/mapIcons/icon26.gif) | MCs | | 27 | ![](/images/mapIcons/icon27.gif) | Mod garage | | 28 | ![](/images/mapIcons/icon28.gif) | OG Loc | | 29 | ![](/images/mapIcons/icon29.gif) | Well Stacked Pizza Co | | 30 | ![](/images/mapIcons/icon30.gif) | Police | | 31 | ![](/images/mapIcons/icon31.gif) | Property (Green) | | 32 | ![](/images/mapIcons/icon32.gif) | Property (Red) | | 33 | ![](/images/mapIcons/icon33.gif) | Race | | 34 | ![](/images/mapIcons/icon34.gif) | Ryder | | 35 | ![](/images/mapIcons/icon35.gif) | Save Game | | 36 | ![](/images/mapIcons/icon36.gif) | School | | 37 | ![](/images/mapIcons/icon37.gif) | Unknown | | 38 | ![](/images/mapIcons/icon38.gif) | Sweet | | 39 | ![](/images/mapIcons/icon39.gif) | Tattoo | | 40 | ![](/images/mapIcons/icon40.gif) | The Truth | | 41 | ![](/images/mapIcons/icon41.gif) | Waypoint | | 42 | ![](/images/mapIcons/icon42.gif) | Toreno | | 43 | ![](/images/mapIcons/icon43.gif) | Triads | | 44 | ![](/images/mapIcons/icon44.gif) | Triads Casino | | 45 | ![](/images/mapIcons/icon45.gif) | Clothes | | 46 | ![](/images/mapIcons/icon46.gif) | Woozie | | 47 | ![](/images/mapIcons/icon47.gif) | Zero | | 48 | ![](/images/mapIcons/icon48.gif) | Club | | 49 | ![](/images/mapIcons/icon49.gif) | Bar | | 50 | ![](/images/mapIcons/icon50.gif) | Restaurant | | 51 | ![](/images/mapIcons/icon51.gif) | Truck | | 52 | ![](/images/mapIcons/icon52.gif) | Robbery | | 53 | ![](/images/mapIcons/icon53.gif) | Race | | 54 | ![](/images/mapIcons/icon54.gif) | Gym | | 55 | ![](/images/mapIcons/icon55.gif) | Car | | 56 | ![](/images/mapIcons/icon56.gif) | Light | | 57 | ![](/images/mapIcons/icon57.gif) | Closest airport | | 58 | ![](/images/mapIcons/icon58.gif) | Varrios Los Aztecas | | 59 | ![](/images/mapIcons/icon59.gif) | Ballas | | 60 | ![](/images/mapIcons/icon60.gif) | Los Santos Vagos | | 61 | ![](/images/mapIcons/icon61.gif) | San Fierro Rifa | | 62 | ![](/images/mapIcons/icon62.gif) | Grove Street Families | | 63 | ![](/images/mapIcons/icon63.gif) | Pay 'n' Spray | ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [SetPlayerMapIcon](/docs/scripting/functions/SetPlayerMapIcon): Create a mapicon for a player.
openmultiplayer/web/docs/translations/th/scripting/resources/mapicons.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/resources/mapicons.md", "repo_id": "openmultiplayer", "token_count": 3298 }
442
--- title: Weapon States description: Weapon State Constants --- | ID | Definition | Description | | --- | ------------------------ | ------------------------------------ | | -1 | WEAPONSTATE_UNKNOWN | Unknown (Set when in a vehicle) | | 0 | WEAPONSTATE_NO_BULLETS | The weapon has no remaining ammo | | 1 | WEAPONSTATE_LAST_BULLET | The weapon has one remaining bullet | | 2 | WEAPONSTATE_MORE_BULLETS | The weapon has multiple bullets | | 3 | WEAPONSTATE_RELOADING | The player is reloading their weapon | ## ฟังก์ชั่นที่เกี่ยวข้องกัน - [GetPlayerWeaponState](../functions/GetPlayerWeaponState): Check the state of a player's weapon.
openmultiplayer/web/docs/translations/th/scripting/resources/weaponstates.md/0
{ "file_path": "openmultiplayer/web/docs/translations/th/scripting/resources/weaponstates.md", "repo_id": "openmultiplayer", "token_count": 302 }
443
--- title: Katkıda Bulunmak description: SA-MP ve open.mp wikisine katkıda bulunmak istiyorsanız bu başlığı inceleyebilirsiniz. --- Bu dökümantasyon kaynağı katkıda bulunmak isteyen herkese açıktır. İhtiyacınız olan şeyler [GitHub](https://github.com) üzerinden bir hesap ve birazcık boş zaman. Git'i bilmenize gerek yok, giriş yaptığınız arayüz web arayüzünden her şeyi yapabilirsiniz. Belirli bir dilin sayfasını yaratmak istiyorsanız, [`CODEOWNERS`](https://github.com/openmultiplayer/web/blob/master/CODEOWNERS) dosyasına diliniz ve kullanıcı adınızı içeren bir satır yazın. (TR sayfalarını geliştirecekseniz bu sayfayı düzenlemenize gerek yok). ## İçerik Düzenlemek Her sayfada düzenleme yapabilmek Github düzenleme sayfasına yönlendiren buton vardır. ![Edit this page link present on each wiki page](images/contributing/edit-this-page.png) Örneğin, [SetVehicleAngularVelocity](../scripting/functions/SetVehicleAngularVelocity) bu tıklatma [bu sayfa](https://github.com/openmultiplayer/web/edit/master/docs/scripting/functions/SetVehicleAngularVelocity.md) sizi bu dosya üzerinde değişiklik yapmanız için yönlendirir. (eğer ki github üzerinden oturum açtıysanız). Düzenlemenizi yapın ve bir "Pull Request" gönderin. Wiki üzerinde çalışan takım üyeleri yaptığınız değişiklikleri onaylandığında(incelenmesi ardından) yaptığınız değişiklikler yayınlanır. ## Yeni Bir İçerik Eklemek Yeni içerik eklemek biraz daha fazla ilgi ister. Bunu iki şekilde yapabilirsiniz: ### Github Web Arayüzünü Kullanmak Github'da bir dizine göz atarken dosya listeninin en sağ üst köşesinde bir "Add File(Dosya Ekle)" düğmesini göreceksiniz. ![Add file button](images/contributing/add-new-file.png) Önceden yazdığınız bir Markdown(.md) dosyasını yükleyebilir veya doğrudan GitHub metin düzenleyicisini kullanarak yeni bir içerik ekleyebilirsiniz. Yarattığınız dosyaların bir uzantısı olmalı ve bu uzantı Markdown(.md) olmalıdır. Markdown hakkında daha fazla bilgi için bu dökümasyona göz atabilirsin. [this guide](https://guides.github.com/features/mastering-markdown/). Bu aşamalar bittikten sonra "Propose new file" tuşuna basarsanız "Pull Request" sayfasına yönlendirilirsiniz ve "İçerik Düzenlemek" başlığında yazıldığı gibi yeni içeriğinizi yaratabilirsiniz. ### Git Eğer Git'i kullanmak istiyorsanız, tek yapmanız gereken Wiki dosyalarını aşağıdaki kod ile klonlamaktır. ```sh git clone https://github.com/openmultiplayer/wiki.git ``` En sevdiğiniz editörü açın. Ben düzenleme yapmak için Visual Studio Code'yi öneriyorum. Markdown dosyalarını biçimlendirmek için güzel bir editör ve gördüğünüz gibi ben Visual Studio Code kullanıyorum. ![Visual Studio Code markdown preview](images/contributing/vscode.png) Bu işlemleri kolaylaştırmak ve daha rahat hale getirmek için iki Visual Studio Code eklentisi öneriyoruz. - [markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint) by David Anson - this is an extension that makes sure your Markdown is formatted correctly. It prevents some syntactical and semantic mistakes. Not all the warnings are important, but some can help improve readability. Use best judgement and if in doubt, just ask a reviewer! - [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) by the Prettier.js Team - this is a formatter that will automatically format your Markdown files so they all use a consistent style. The Wiki repository has some settings in its `package.json` that the extension should automatically use. Be sure to enable "Format On Save" in your editor settings so your Markdown files will be automatically formatted every time you save! ## Notlar, İpuçları ve Conventions ### Linkler Siteler arası bağlantılar için doğrudan URL'leri kullanmayın. Göreli yollar ile URL'leri tanıtın. Demek istenilen: - ❌ ```md To be used with [OnPlayerClickPlayer](https://www.open.mp/docs/scripting/callbacks/OnPlayerClickPlayer) ``` - ✔ ```md To be used with [OnPlayerClickPlayer](../callbacks/OnPlayerClickPlayer) ``` `../` olarak gördüğünüz şey "Bir dizin yukarı git" anlamına gelir, yani eğer `functions` klasörünün içerisindeki bir dosyayı düzenlerken `callbacks` klasörünün içerisindeki bir dosyaya yönlendirme yapmak istiyorsanız `../` kullanarak `scripting/` klasörüne geçmeli ve `callbacks/` yazarak callbacks klasörüne girmelisiniz, aradığınız dosyanın uzantısını eklemeden (`.md` olmadan) tanıtmalısınız. ### Resimler Resimler '/static/images' klasörünün içerisindeki bir alt dizine girer. Bir görüntüyü `![]()` ile gösterebilirsiniz. Temel yol olarak `/images/` kullanıyorsunuz. Eğer nasıl yapılacağını anlamadıysanız (anlatım İngilizce olarak da biraz sorunluydu bu yüzden biraz yanlış yazılmış olabilir). Başka sayfalarda resimlerin nasıl yayınlandığını inceleyin ve kopyalayıp yapıştırın. ### Meta Verileri _Herhangi_ bir sayfada ilk şey meta verileri olmalıdır: ```mdx --- title: Benim Döküm Sayfam description: Bu sayfa eşyalar ve burgerler hakkında bir sayfa, yaşasın! --- ``` Her sayfanın bir başlığı ve bir açıklaması olmalıdır. `---`, etiketlerinin arasında nelerin bulunabileceği için dökümasyonu inceleyin. [the Docusaurus documentation](https://v2.docusaurus.io/docs/markdown-features#markdown-headers). ### Başlıklar seviye 1 başlık için (`<h1>`) kullanmayın. `#` otomatik olarak oluşturduğu için _her zaman_ `##` ile 1. seviye başlık belirleyin. - ❌ ```md # Benim Başlığım Bu dökümasyon ... için # Sub-Section ``` - ✔ ```md Bu dökümasyon ... için ## Alt Bölüm ``` ### Use `Code` Snippets For Technical References When writing a paragraph that contains function names, numbers, expressions or anything that's not standard written language, surround them with \`backticks\` like that. This makes it easier to separate language for describing things from references to technical elements such as function names and pieces of code. - ❌ > The fopen function will return a value with a tag of type File:, there is no problem on that line as the return value is being stored to a variable also with a tag of File: (note the cases are the same too). However on the next line the value 4 is added to the file handle. 4 has no tag [...] - ✔ > The `fopen` function will return a value with a tag of type `File:`, there is no problem on that line as the return value is being stored to a variable also with a tag of `File:` (note the cases are the same too). However on the next line the value `4` is added to the file handle. `4` has no tag In the above example, `fopen` is a function name, not an English word, so surrounding it with `code` snippet markers helps distinguish it from other content. Also, if the paragraph is referring to a block of example code, this helps the reader associate the words with the example. ### Tables If a table has headings, they go in the top part: - ❌ ```md | | | | ------- | ------------------------------------ | | Health | Engine Status | | 650 | Undamaged | | 650-550 | White Smoke | | 550-390 | Grey Smoke | | 390-250 | Black Smoke | | < 250 | On fire (will explode seconds later) | ``` - ✔ ```md | Health | Engine Status | | ------- | ------------------------------------ | | 650 | Undamaged | | 650-550 | White Smoke | | 550-390 | Grey Smoke | | 390-250 | Black Smoke | | < 250 | On fire (will explode seconds later) | ``` ## Migrating from SA-MP Wiki Most of the content has been moved, but if you find a page that's missing, here's a short guide for converting content to Markdown. ### Getting the HTML 1. Click this button (Firefox) ![image](images/contributing/04f024579f8d.png) (Chrome) ![image](images/contributing/f62bb8112543.png) 2. Hover the top left of the main wiki page, in the left margin or the corner until you see `#content` ![image](images/contributing/65761ffbc429.png) Or search for `<div id=content>` ![image](images/contributing/77befe2749fd.png) 3. Copy the inner HTML of that element ![image](images/contributing/8c7c75cfabad.png) Now you have _only_ the HTML code for the actual _content_ of the page, the stuff we care about, and you can convert it to Markdown. ### Converting HTML to Markdown For converting basic HTML (no tables) to Markdown use: https://domchristie.github.io/turndown/ ![image](images/contributing/77f4ea555bbb.png) ^^ Notice now it screwed up the table completely... ### HTML Tables to Markdown Tables Because the above tool does not support tables, use this tool: https://jmalarcon.github.io/markdowntables/ And copy only the `<table>` element in: ![image](images/contributing/57f171ae0da7.png) ### Cleaning Up The conversion likely won't be perfect. So you'll have to do a bit of manual cleanup. The formatting extensions listed above should help with that but you may still need to just spend some time doing manual work. If you don't have time, don't worry! Submit an unfinished draft and someone else can pick up where you left off! ## License Agreement All open.mp projects have a [Contributor License Agreement](https://cla-assistant.io/openmultiplayer/homepage). This basically just means you agree to let us use your work, and put it under an open-source license. When you open a Pull Request for the first time, the CLA-Assistant bot will post a link where you can sign the agreement.
openmultiplayer/web/docs/translations/tr/meta/Contributing.md/0
{ "file_path": "openmultiplayer/web/docs/translations/tr/meta/Contributing.md", "repo_id": "openmultiplayer", "token_count": 3785 }
444
--- title: OnPlayerCommandText description: Bu callback oyuncu chat ekranında herhangi bir komut kullandığında çağrılır. tags: ["player"] --- ## Açıklama Bu callback oyuncu chat ekranında herhangi bir komut kullandığında çağrılır. '/' ile başlayan her şey komuttur ve bu callbacki çağırır. (örnek: /yardim) | Ad | Açıklama | | --------- | ---------------------------------------- | | playerid | Komutu kullanan oyuncunun id'si. | | cmdtext[] | Kullanılan komut ('/' işareti de dahil). | ## Çalışınca Vereceği Sonuçlar Her zaman öncelikle filterscriptlerde çalışır ve 1 değerini döndürmek diğer scriptlerin çağrılmasını engeller. ## Örnekler ```c public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/yardim", true)) { SendClientMessage(playerid, -1, "SUNUCU: /yardim komutunu kullandınız!"); return 1; // return 1 vermemiz sunucuya bu komutun işlendiğini bildirir. // OnPlayerCommandText diğer scriptlerde çağrılmaz. } return 0; // return 0 vermemiz sunucuya bu komutun bu script tarafından işlenmediğini bildirir. // 1 değeri dönene kadar OnPlayerCommandText diğer scriptlerde çağrılır. // Eğer hiç bir script 1 değerini döndürmezse 'SERVER: Unknown Command' mesajı belirir. } ``` ## Notlar :::tip Bu callback NPC tarafından da çağrılabilir. ::: ## Bağlı Fonksiyonlar - [SendRconCommand](../functions/SendRconCommand.md): RCON komutunun gönderilmesini sağlar.
openmultiplayer/web/docs/translations/tr/scripting/callbacks/OnPlayerCommandText.md/0
{ "file_path": "openmultiplayer/web/docs/translations/tr/scripting/callbacks/OnPlayerCommandText.md", "repo_id": "openmultiplayer", "token_count": 704 }
445
--- title: OnPlayerLeaveCheckpoint description: Bu fonksiyon, bir oyuncu SetPlayerCheckpoint tarafından kendisi için ayarlanan kontrol noktasından ayrıldığında çağrılır. tags: ["player", "checkpoint"] --- ## Açıklama Bu fonksiyon, bir oyuncu SetPlayerCheckpoint tarafından kendisi için ayarlanan kontrol noktasından ayrıldığında çağrılır. | Parametre | Açıklama | | --------- | ------------------------------------------------ | | playerid | Kontrol noktasından ayrılan oyuncunun ID'si. | ## Çalışınca Vereceği Sonuçlar Filterscript komutlarında her zaman ilk olarak çağrılır. ## Örnekler ```c public OnPlayerLeaveCheckpoint(playerid) { printf("%i ID'li oyuncu kontrol noktasından çıkış yaptı!", playerid); return 1; } ``` ## Notlar <TipNPCCallbacks /> ## Bağlantılı Fonksiyonlar - [SetPlayerCheckpoint](../functions/SetPlayerCheckpoint): Oyuncu için kontrol noktasını belirleme. - [DisablePlayerCheckpoint](../functions/DisablePlayerCheckpoint): Oyuncu için kontrol noktasını devre dışı bırakma. - [IsPlayerInCheckpoint](../functions/IsPlayerInCheckpoint): Oyuncunun kontrol noktasında olup olmadığını kontrol etme. - [SetPlayerRaceCheckpoint](../functions/SetPlayerRaceCheckpoint): Oyuncu için yarış kontrol noktasını belirleme. - [DisablePlayerRaceCheckpoint](../functions/DisablePlayerRaceCheckpoint): Oyuncu için yarış kontrol noktasını devre dışı bırakma. - [IsPlayerInRaceCheckpoint](../functions/IsPlayerInRaceCheckpoint): Oyuncunun yarış kontrol noktasında olup olmadığını kontrol etme.
openmultiplayer/web/docs/translations/tr/scripting/callbacks/OnPlayerLeaveCheckpoint.md/0
{ "file_path": "openmultiplayer/web/docs/translations/tr/scripting/callbacks/OnPlayerLeaveCheckpoint.md", "repo_id": "openmultiplayer", "token_count": 676 }
446
--- title: OnPlayerWeaponShot description: Bu fonksiyon, oyuncu ateş ettiğinde çağrılır. tags: ["player"] --- ## Açıklama Bu fonksiyon, oyuncu ateş ettiğinde çağrılır. Bu fonksiyon ateşli silahları destekler. Sadece yolcu drive-by'ını destekler.(buna sürücünün drive-by atması, sea sparrow/hunter gibi araçların silahları dahil değildir.). | Parametre | Açıklama | | --------- | --------------------------------------------------------------------------------------------------------- | | playerid | Ateş eden oyuncunun ID'si. | | weaponid | Ateşlenen silahın [silah ID'leri](../resources/weaponids) ID'si. | | hittype | Oyuncunun vuruş türü. [türler](../resources/bullethittypes). (oyuncu, obje veya araç gibi). | | hitid | Vurulan oyuncunun, objenin veya aracın ID'si. | | fX | Ateşlenen merminin gittiği X koordinatı. | | fY | Ateşlenen merminin gittiği Y koordinatı. | | fZ | Ateşlenen merminin gittiği Z koordinatı. | ## Çalışınca Vereceği Sonuçlar 0 - Merminin hasar vermesini önleyin. 1 - Merminin hasar vermesini sağlayın. Filterscript komut dosyalarında her zaman ilk olarak çağrılır, bu nedenle 0 döndürmek, diğer komut dosyalarının da görmesini engeller. ## Örnekler ```c public OnPlayerWeaponShot(playerid, WEAPON:weaponid, BULLET_HIT_TYPE:hittype, hitid, Float:fX, Float:fY, Float:fZ) { new szString[144]; format(szString, sizeof(szString), "Silah %i ateşlendi. vuruş türü: %i vurulan id: %i koordinatlar: %f, %f, %f", weaponid, hittype, hitid, fX, fY, fZ); SendClientMessage(playerid, -1, szString); return 1; } ``` ## Notlar :::tip Bu fonksiyon, yalnızca gecikme telafisi etkinleştirildiğinde çağrılır. İsabet türü eğer: - BULLET_HIT_TYPE_NONE ise : fX, fY ve fZ parametreleri normal koordinatlardır, eğer hiçbir şey vurulmadıysa koordinatlar için 0,0 döner. (örneğin, merminin ulaşamadığı uzak nesne) - Diğerleri ise : fX, fY ve fZ, hitid'ye göre ofsetlerdir. ::: :::tip GetPlayerLastShotVectors, detaylı mermi vektör bilgileri için bu çağrıda kullanılabilir. ::: :::warning Bilinen Hata(lar): Şoför olarak araca ateş ettiyseniz veya hedef etkinken arkanıza bakıyorsanız fonksiyon çağrılmaz. Araç içindeki bir oyuncuya ateş ediyorsanız vuruş tipi BULLET_HIT_TYPE_VEHICLE (vurulan oyuncunun araç ID'si) olarak geçer. Hiç BULLET_HIT_TYPE_PLAYER olarak çağrılmaz. SA-MP 0.3.7 sürümünde kısmen düzeltildi: Sahte silah verileri kötü niyetli bir kullanıcı tarafından gönderilirse, diğer oyuncu istemcileri donabilir veya çökebilir. Bunu önlemek için, ateşlenen silahın gerçekten mermi ateşleyip ateşleyemeyeceğini kontrol edin. ::: ## Bağlantılı Fonksiyonlar - [GetPlayerLastShotVectors](../functions/GetPlayerLastShotVectors): Oyuncunun attığı son merminin vektör bilgilerini kontrol etme.
openmultiplayer/web/docs/translations/tr/scripting/callbacks/OnPlayerWeaponShot.md/0
{ "file_path": "openmultiplayer/web/docs/translations/tr/scripting/callbacks/OnPlayerWeaponShot.md", "repo_id": "openmultiplayer", "token_count": 1803 }
447
--- title: AddPlayerClass description: Class seçimi sırasında yeni bir class oluşturur. tags: ["player"] --- ## Açıklama Class seçimine yeni bir class ekler. Kullanıcılar seçtikleri classın skinleriyle spawn olabilirler. | İsim | Açıklama | | ------------- | ------------------------------------------------------------- | | modelid | Oyuncunun doğacağı skin numarası. | | Float:spawn_x | Class oyuncularının doğacağı X koordinat bilgisi. | | Float:spawn_y | Class oyuncularının doğacağı Y koordinat bilgisi. | | Float:spawn_z | Class oyuncularının doğacağı Z koordinat bilgisi. | | Float:z_angle | Class oyuncularının doğduğu zaman yüzünün döneceği koordinat. | | weapon1 | Class oyuncularının birincil silah numarası. | | weapon1_ammo | Class oyuncularının birincil silahlarının mermi sayısı. | | weapon2 | Class oyuncularının ikincil silah numarası. | | weapon2_ammo | Class oyuncularının ikincil silahlarının mermi sayısı. | | weapon3 | Class oyuncularının üçüncül silah numarası. | | weapon3_ammo | Class oyuncularının üçüncül silahlarının mermi sayısı. | ## Çalışınca Vereceği Sonuçlar Bu fonksiyon, geri dönüş olarak oluşturulan classın ID bilgisini verecektir. En fazla 320 class olabileceği için, en fazla olarak 319 dönüşünü verecektir. ## Örnekler ```c public OnGameModeInit() { // Oyuncular CJ skiniyle (0) ya da The Truth skiniyle (1) doğacaklar. 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; } ``` ## Notes :::tip Maksimum class numarası 319 olabileceği için (class numaralı sıfırdan başlar, yani 320 adet class olabilir) sunucu içerisinde bulunan class sayısı maksimuma ulaştığı zaman en son eklenen class, bilgilerini 319 numaralı class'a aktaracaktır. ::: ## Bağlantılı Fonksiyonlar - [AddPlayerClassEx](AddPlayerClassEx.md): Classı bir takıma varsayılan bağlı olarak ekler. - [SetSpawnInfo](SetSpawnInfo.md): Oyuncunun doğacağı bölgeyi belirler. - [SetPlayerSkin](SetPlayerSkin.md): Oyuncunun skinini düzenler.
openmultiplayer/web/docs/translations/tr/scripting/functions/AddPlayerClass.md/0
{ "file_path": "openmultiplayer/web/docs/translations/tr/scripting/functions/AddPlayerClass.md", "repo_id": "openmultiplayer", "token_count": 1148 }
448
--- title: AttachCameraToObject description: Bu fonksiyonu, bir oyuncuya kamera yerleştirmek için kullanabilirsiniz. tags: [] --- ## Açıklama Bu fonksiyonu, bir oyuncuya kamera yerleştirmek için kullanabilirsiniz. | İsim | Açıklama | | -------- | -------------------------------------------------------------------- | | playerid | Kamera yerleştirilecek oyuncu numarası. | | objectid | Yerleştirmek istenilen objenin numarası. | ## Vereceği Geri Dönüş (Return) Değerleri Bu fonksiyon, herhangi bir return döndürmez. ## Örnekler ```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, "Kamera oyuncuya yerleştirildi."); return 1; } return 0; } ``` ## Notlar :::tip Oyuncuya kamera yerleştirmeden önce, objeyi yaratman gerekir. ::: ## Bağlantılı Fonksiyonlar - [AttachCameraToPlayerObject](AttachCameraToPlayerObject): Kamerayı bir oyuncunun objesine yerleştirir.
openmultiplayer/web/docs/translations/tr/scripting/functions/AttachCameraToObject.md/0
{ "file_path": "openmultiplayer/web/docs/translations/tr/scripting/functions/AttachCameraToObject.md", "repo_id": "openmultiplayer", "token_count": 604 }
449
--- title: Create3DTextLabel description: 3D Metin Etiketi oluşturma. tags: ["3dtextlabel"] --- ## Açıklama 3D Metin Etiketi oluşturma. | Parametre | Açıklama | | ------------ | --------------------------------------------------------------------- | | text[] | Metin dizesi. | | color | RGBA renk biçiminde renk kodu. | | x | X Koordinatı | | y | Y Koordinatı | | z | Z oordinatı | | DrawDistance | 3D Metin Etiketinin maksimum görülebileceği uzaklık. | VirtualWorld | 3D Metin Etiketinin sanal dünya değeri. | | testLOS | 3D Metin Etiketinin nesneler arasından görülüp/görülemeyeceği. | ## Çalışınca Vereceği Sonuçlar Yeni oluşturulan 3D Metin Etiketinin ID'si, veya 3D Metin Etiketinin limitine (MAX_3DTEXT_GLOBAL) ulaşıldığında INVALID_3DTEXT_ID. ## Örnekler ```c public OnGameModeInit() { Create3DTextLabel("Ben şu koordinattayım:\n30.0, 40.0, 50.0", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0, 0); return 1; } ``` ## Notlar :::tip İzlenme modundayken metin etiketleri daha küçük görülür. ::: :::tip Metinde birden çok renk için renk katıştırmayı kullanın. ::: :::warning Eğer metin alanı (text[]) boşsa sunucuyu çökertebilir! Sanal dünya değeri -1 olarak ayarlanmışsa metin görünmeyecektir. ::: ## Bağlantılı Fonksiyonlar - [Delete3DTextLabel](Delete3DTextLabel): 3D Metin etiketi siler. - [Attach3DTextLabelToPlayer](Attach3DTextLabelToPlayer): 3D Metin etiketini oyuncuya bağlar. - [Attach3DTextLabelToVehicle](Attach3DTextLabelToVehicle): 3D Metin etiketini araca bağlar. - [Update3DTextLabelText](Update3DTextLabelText): 3D Metin etiketinin metnini değiştirir. - [CreatePlayer3DTextLabel](CreatePlayer3DTextLabel): Oyuncu için 3D Metin etiketi oluşturur. - [DeletePlayer3DTextLabel](DeletePlayer3DTextLabel): Oyuncu için 3D Metin etiketi siler. - [UpdatePlayer3DTextLabelText](UpdatePlayer3DTextLabelText): Oyuncu için 3D Metin etiketinin metnini değiştirir.
openmultiplayer/web/docs/translations/tr/scripting/functions/Create3DTextLabel.md/0
{ "file_path": "openmultiplayer/web/docs/translations/tr/scripting/functions/Create3DTextLabel.md", "repo_id": "openmultiplayer", "token_count": 1290 }
450
--- title: db_close description: Closes a SQLite database connection that was opened with `db_open`. keywords: - sqlite --- <LowercaseNoteTR /> ## Açıklama Daha önceden [db_open](db_open) fonksiyonu ile açılmış olan veritabanı bağlantısını kapatır. | İsim | Açıklama | | ----- | --------------------------------------------------------------------------------- | | DB:db | Kapatılacak veritabanı bağlantısı adı. ([db_open](db_open)'dan geri döndürülür.). | ## Çalışınca Vereceği Sonuçlar 1: Fonksiyon başarılı bir şekilde gerçekleştirildi. 0: Fonksiyon gerçekleştirilemedi. Bu, veritabanı bağlantı adı geçersiz anlamına gelebilir. ## Örnekler ```c static DB:gDBConnectionHandle; // ... public OnGameModeInit() { // ... // Veritabanına bağlantı oluştur. gDBConnectionHandle = db_open("example.db"); // Eğer veritabanına bağlantı başarılıysa. if (gDBConnectionHandle) { // Başarılı bir şekilde veritabanına bağlanıldı. print(" Başarılı bir şekilde \"example.db\" veritabanına bağlanıldı."); } else { // Veritabanına bağlantı başarısız oldu. print("\"example.db\" veritabanına bağlantı başarısız oldu."); } // ... return 1; } public OnGameModeExit() { // Eğer bağlantı açıksa, veritabanına olan bağlantıyı kapat. if (db_close(gDBConnectionHandle)) { // Ekstra temizlik. gDBConnectionHandle = DB:0; } // ... return 1; } ``` ## Notlar :::warning Sıfırdan başka bir geçersiz işlem kullanmak sunucunuzu çökertir! [db_open](db_open) kullanarak geçerli bir veritabanı bağlantı işleyicisi alın. ::: ## Bağlantılı Fonksiyonlar _Replace me_
openmultiplayer/web/docs/translations/tr/scripting/functions/db_close.md/0
{ "file_path": "openmultiplayer/web/docs/translations/tr/scripting/functions/db_close.md", "repo_id": "openmultiplayer", "token_count": 884 }
451
--- title: Açı Modları description: Açı ölçüm birimleri için SI birim sabitleri. --- :::note Bu açı modları, [floatsin](../functions/floatsin), [floatcos](../functions/floatcos) ve [floattan](../functions/floattan) fonksiyonları tarafından kullanılır. ::: | Mod | Açıklama | | ------- | ----------- | | radian | Açı radyan cinsinden olacaktır. | | degrees | Açı derece cinsinden olacaktır. | | grades | Açı grad cinsinden olacaktır. |
openmultiplayer/web/docs/translations/tr/scripting/resources/anglemodes.md/0
{ "file_path": "openmultiplayer/web/docs/translations/tr/scripting/resources/anglemodes.md", "repo_id": "openmultiplayer", "token_count": 200 }
452
--- title: OnClientCheckResponse description: 当SendClientCheck请求完成时,调用这个回调 tags: [] --- ## 描述 当 SendClientCheck 请求完成时,调用这个回调。 | 参数名 | 描述 | | -------- | ------------------- | | playerid | 被检查的玩家 ID。 | | actionid | 执行的检查类型 ID。 | | memaddr | 请求的地址。 | | retndata | 检查的结果。 | ## 返回值 它在过滤脚本中总是先被调用。 ## 案例 ```c public OnPlayerConnect(playerid) { SendClientCheck(playerid, 0x48, 0, 0, 2); return 1; } public OnClientCheckResponse(playerid, actionid, memaddr, retndata) { if(actionid == 0x48) // 或者 72 { print("警告: 这个玩家似乎不是在使用普通的电脑!!"); Kick(playerid); } return 1; } ``` ## 要点 :::warning 这个回调只能在过滤脚本中被调用。 ::: ## 相关函数 - [SendClientCheck](../functions/SendClientCheck): 对客户端进行内存检查。
openmultiplayer/web/docs/translations/zh-cn/scripting/callbacks/OnClientCheckResponse.md/0
{ "file_path": "openmultiplayer/web/docs/translations/zh-cn/scripting/callbacks/OnClientCheckResponse.md", "repo_id": "openmultiplayer", "token_count": 574 }
453
--- title: OnObjectMoved description: 当物体在MoveObject之后移动时(当物体停止移动时)调用此回调。 tags: [] --- ## 描述 当物体在 MoveObject 之后移动时(当物体停止移动时)调用此回调。 | 参数名 | 描述 | | -------- | ------------- | | objectid | 移动的物体 ID | ## 返回值 它在过滤脚本中总是先被调用。 ## 案例 ```c public OnObjectMoved(objectid) { printf("物体 %d 完成了移动。", objectid); return 1; } ``` ## 要点 :::tip 在此回调中使用 SetObjectPos 时不起作用。要修复该问题,请重新创建该物体。 ::: ## 相关函数 - [MoveObject](../functions/MoveObject): 移动物体。 - [MovePlayerObject](../functions/MovePlayerObject): 移动玩家物体。 - [IsObjectMoving](../functions/IsObjectMoving): 检查物体是否在移动。 - [StopObject](../functions/StopObject): 阻止物体移动。 ## 相关回调 - [OnPlayerObjectMoved](OnPlayerObjectMoved): 当玩家物体停止移动时调用。
openmultiplayer/web/docs/translations/zh-cn/scripting/callbacks/OnObjectMoved.md/0
{ "file_path": "openmultiplayer/web/docs/translations/zh-cn/scripting/callbacks/OnObjectMoved.md", "repo_id": "openmultiplayer", "token_count": 566 }
454
--- title: OnPlayerFinishedDownloading description: 当玩家下载完自定义模型时,这个回调函数被调用。 tags: ["player"] --- <VersionWarnCN name='回调' version='SA-MP 0.3.DL R1' /> ## 描述 当玩家下载完自定义模型时,这个回调函数被调用。有关如何向服务器添加自定义模型的更多信息,请参见发布线程和本教程。 | 参数名 | 描述 | | ------------ | ----------------------------------------- | | playerid | 完成了自定义模型下载的玩家的 ID。 | | virtualworld | 玩家完成了自定义模型下载的虚拟世界的 ID。 | ## 返回值 这个回调函数不处理返回值。 ## 案例 ```c public OnPlayerFinishedDownloading(playerid, virtualworld) { SendClientMessage(playerid, 0xffffffff, "下载完成。"); return 1; } ``` ## 要点 :::tip 玩家每次改变虚拟世界的时候都会调用这个回调,即使在没有自定义模型的虚拟世界里也是如此。 ::: ## 相关回调
openmultiplayer/web/docs/translations/zh-cn/scripting/callbacks/OnPlayerFinishedDownloading.md/0
{ "file_path": "openmultiplayer/web/docs/translations/zh-cn/scripting/callbacks/OnPlayerFinishedDownloading.md", "repo_id": "openmultiplayer", "token_count": 655 }
455
--- title: OnPlayerStreamIn description: 当某个玩家从其他玩家的客户端流入时,这个回调被调用。 tags: ["player"] --- ## 描述 当某个玩家从其他玩家的客户端流入时,这个回调被调用。 | 参数名 | 描述 | | ----------- | --------------------- | | playerid | 已被流入的玩家 ID。 | | forplayerid | 接收到该流的玩家 ID。 | ## 返回值 它在过滤脚本中总是先被调用。 ## 案例 ```c public OnPlayerStreamIn(playerid, forplayerid) { new string[40]; format(string, sizeof(string), "玩家 %d 现在正被你流入", playerid); SendClientMessage(forplayerid, 0xFFFFFFFF, string); return 1; } ``` ## 要点 <TipNPCCallbacksCN />
openmultiplayer/web/docs/translations/zh-cn/scripting/callbacks/OnPlayerStreamIn.md/0
{ "file_path": "openmultiplayer/web/docs/translations/zh-cn/scripting/callbacks/OnPlayerStreamIn.md", "repo_id": "openmultiplayer", "token_count": 418 }
456
--- title: OnVehicleSirenStateChange description: 当车辆的警笛被触发时,这个回调被调用。 tags: ["vehicle"] --- :::warning SA-MP 0.3.7 版本增加了这个回调函数,无法在以前的版本使用! ::: ## 描述 当车辆的警笛被触发时,这个回调被调用。 | 参数名 | 描述 | | --------- | ---------------------------------- | | playerid | 触发警笛的玩家(司机)的 ID。 | | vehicleid | 打开警笛的那辆车的 ID。 | | newstate | 0 表示关闭警笛,1 如果警笛已经打开 | ## 返回值 1 - 将阻止其他游戏模式接收到这个回调。 0 - 表示这个回调函数将被传递给下一个游戏模式。 它在过滤脚本中总是先被调用。 ## 案例 ```c public OnVehicleSirenStateChange(playerid, vehicleid, newstate) { if (newstate) { GameTextForPlayer(playerid, "~W~警笛 ~G~开", 1000, 3); } else { GameTextForPlayer(playerid, "~W~警笛 ~r~关", 1000, 3); } return 1; } ``` ## 要点 :::tip 只有当汽车的警笛打开或关闭时,才会调用这个回调,当交替警笛在使用时(按住喇叭)不能使用。 ::: ## 相关函数 - [GetVehicleParamsSirenState](../functions/GetVehicleParamsSirenState): 检查车辆的警笛是否打开或关闭。
openmultiplayer/web/docs/translations/zh-cn/scripting/callbacks/OnVehicleSirenStateChange.md/0
{ "file_path": "openmultiplayer/web/docs/translations/zh-cn/scripting/callbacks/OnVehicleSirenStateChange.md", "repo_id": "openmultiplayer", "token_count": 854 }
457
--- title: AllowPlayerTeleport description: 为玩家启用/禁用在地图上点击右键传送的功能。 tags: ["player"] --- ## 描述 为玩家启用/禁用在地图上点击右键传送的功能。 | 参数名 | 说明 | | -------- | --------------------- | | playerid | 允许传送的玩家的 ID。 | | allow | 1-启用,0-禁用 | ## 返回值 该函数不返回任何特定的值。 ## 案例 ```c public OnPlayerConnect(playerid) { // 启用玩家在地图上点击右键传送的功能。 // 因为代码放在玩家连接的回调中,所以每个玩家都能传送。 AllowPlayerTeleport(playerid, 1); } ``` ## 要点 :::warning 这个函数只有在[AllowAdminTeleport](AllowAdminTeleport)被启用时才会起作用,而且你必须是管理员。 ::: ## 相关函数 - [AllowAdminTeleport](AllowAdminTeleport): 控制 RCON 管理员在设置导航点时是否会被传送。
openmultiplayer/web/docs/translations/zh-cn/scripting/functions/AllowPlayerTeleport.md/0
{ "file_path": "openmultiplayer/web/docs/translations/zh-cn/scripting/functions/AllowPlayerTeleport.md", "repo_id": "openmultiplayer", "token_count": 560 }
458
--- title: GetPlayerCameraAspectRatio description: 检索玩家视角的纵横比。 tags: ["player", "camera"] --- ## 描述 检索玩家视角的纵横比。 | 参数名 | 说明 | | -------- | ------------------------- | | playerid | 获得视角纵横比的玩家 ID。 | ## 返回值 玩家视角的纵横比,以浮点数表示。纵横比可以是以下三个值之一:关闭宽屏时为 4:3 (1.3333334,Float:0x3FAAAAAB);打开信箱模式时为 5:4 (1.2470589,Float:0x3F9F9FA0);无论信箱模式如何,打开宽屏时为 16:9 (1.7764707,Float:0x3FE36364)。 ## 案例 ```c new szString[144]; format(szString, sizeof(szString), "你的纵横比是: %f", GetPlayerCameraAspectRatio(playerid)); SendClientMessage(playerid, -1, szString); ``` ## 要点 :::tip 这个函数的返回值代表游戏显示设置中的"宽屏"选项的值,而不是玩家显示器的实际纵横比。 ::: ## 相关函数 - [GetPlayerCameraZoom](GetPlayerCameraZoom): 获取玩家视角的缩放级别。 - [GetPlayerCameraPos](GetPlayerCameraPos): 找出玩家的视角在哪里。 - [GetPlayerCameraFrontVector](GetPlayerVameraFrontVector): 获取玩家视角的前向量。
openmultiplayer/web/docs/translations/zh-cn/scripting/functions/GetPlayerCameraAspectRatio.md/0
{ "file_path": "openmultiplayer/web/docs/translations/zh-cn/scripting/functions/GetPlayerCameraAspectRatio.md", "repo_id": "openmultiplayer", "token_count": 719 }
459
--- title: acos description: 以度为单位求余弦函数的倒数。 tags: ["math"] --- <LowercaseNoteCN /> ## 描述 以度为单位求余弦函数的倒数。在三角函数中,反余弦是余弦的逆运算。 | 参数名 | 说明 | | ----------- | ------------------------------- | | Float:value | 在区间内计算其反余弦值 [-1,+1]. | ## 返回值 以度为单位的角度,在区间[0.0,180.0]内。 ## 案例 ```c // 余弦0.500000是60.000000度。 public OnGameModeInit() { new Float:param, Float:result; param = 0.5; result = acos(param); printf("反余弦 %f 等于 %f 度。", param, result); return 1; } ``` ## 相关函数 - [floatsin](floatsin): 从特定角度求正弦值。 - [floatcos](floatcos): 从特定角度求余弦值。 - [floattan](floattan): 从特定角度求正切值。 - [asin](asin): 以度为单位求正弦值的倒数。 - [atan](atan): 以度为单位求正切值的倒数。 - [atan2](atan2): 以度为单位求正切的多值倒数。
openmultiplayer/web/docs/translations/zh-cn/scripting/functions/acos.md/0
{ "file_path": "openmultiplayer/web/docs/translations/zh-cn/scripting/functions/acos.md", "repo_id": "openmultiplayer", "token_count": 613 }
460
--- title: 用戶端 description: 此分類包含 SA-MP 用戶端功能和支援相關的資訊。 --- 此分類包含 SA-MP 用戶端功能和支援相關的資訊。
openmultiplayer/web/docs/translations/zh-tw/client/_.md/0
{ "file_path": "openmultiplayer/web/docs/translations/zh-tw/client/_.md", "repo_id": "openmultiplayer", "token_count": 112 }
461
app = "openmultiplayer-web" kill_signal = "SIGINT" kill_timeout = 5 processes = [] [env] PORT = "3000" [build] dockerfile = "Dockerfile.frontend" [experimental] allowed_public_ports = [] auto_rollback = true [[services]] http_checks = [] internal_port = 3000 processes = ["app"] protocol = "tcp" script_checks = [] [services.concurrency] hard_limit = 100 soft_limit = 80 type = "connections" [[services.ports]] force_https = true handlers = ["http"] port = 80 [[services.ports]] handlers = ["tls", "http"] port = 443 [[services.tcp_checks]] grace_period = "1s" interval = "15s" restart_limit = 0 timeout = "2s"
openmultiplayer/web/frontend.fly.toml/0
{ "file_path": "openmultiplayer/web/frontend.fly.toml", "repo_id": "openmultiplayer", "token_count": 410 }
462
# Open Multiplayer მომავალი multiplayer მოდიფიკაცია თამაშისთვის - _Grand Theft Auto: San Andreas_ - რომელიც იქნება უკუთავსებადი ერთ-ერთ ამჟამინდელ მოდიფიკაციასთან - _San Andreas Multiplayer_. <br /> ეს ნიშნავს, რომ **მიმდინარე SA:MP კლიენტი და მისი არსებული სკრიპტები უპრობლემოდ იმუშავებს open.mp-ზეც**. ამასთანავე, ბევრი ბაგი იქნება გასწორებული სასერვერო პროგრამაშივე. შესაბამისად, აღარ მოგიწევთ დამატებითი პროგრამების გამოყენება. გაინტერესებთ როდის არის დაგეგმილი პირველი საჯარო გამოშვება ან გსურთ დაეხმაროთ პროექტს? - დამატებითი ინფორმაციისთვის წაიკითხეთ <a href="https://forum.open.mp/showthread.php?tid=99">ეს სტატია</a>. # [FAQ](/faq)
openmultiplayer/web/frontend/content/ka/index.mdx/0
{ "file_path": "openmultiplayer/web/frontend/content/ka/index.mdx", "repo_id": "openmultiplayer", "token_count": 1248 }
463
--- title: SA-MP за андроид (Смартфон верзија) date: "2021-01-30T12:46:46" author: Potassium --- Став open.mp тима о издању SA-MP-а за андроид. Здраво свима, Само смо хтели да напишемо један брзу блог објаву о нашем ставу о SA-MP андроид верзији, зато што смо добијали много коментара на о томе као и YouTube видеа на Discord-у. Као што смо истакли у нашем YouTube видеу, не подржавамо тренутну верзију SA-MP-а за Android. Апликација је креирана уз помоћ изворног кода украденог од SA-MP тима, што значи да је апликација илегална. Не можемо опростити крађу туђег кода као што ни не подржавамо коришћење украденог. Ми се такође не повезујемо са илегалним стварима. Видимо да је GTA SA мултиплејер за сматрфон има велику заједницу, и волели бисмо да позовемо ову заједницу на open.mp. Тренутно дискутујемо како бисмо могли да направимо наш мултиплејер мод за SA на смартфону, да би то било направљено легално и поштено! :) Ово значи да је веома могуће да ће у будућности бити верзија open.mp за смартфон, тако да вас молимо да нас наставите подржавати док ми не нађемо начин! Позивамо смартфон заједницу да се приклучи нашем званичном Discord серверу са преко 7000 чланова, креирали смо канал за вас0 #samp-android и надамо се да ћемо чути ваша мишљења! Видимо се! https://discord.gg/samp
openmultiplayer/web/frontend/content/sr/blog/samp-mobile.mdx/0
{ "file_path": "openmultiplayer/web/frontend/content/sr/blog/samp-mobile.mdx", "repo_id": "openmultiplayer", "token_count": 1266 }
464
--- title: Forum ve Wiki Çevrimdışı description: SA-MP Forum ve Wiki'nin neden çevrimdışı olduğunu merak ediyorsanız, bilgi ve sonraki adımlar için bunu okuyun --- # Forum ve Wiki neden çevrimdışı? 25 Eylül 2020 tarihinde forum.sa-mp.com ve wiki.sa-mp.com'un sertifikaları süresi dolmuştur. Birçok kullanıcı bunu fark etmiş ve konuyu Discord üzerinde gündeme getirmiştir. Site, HTTPS güvenliğini atlayarak hâlâ erişilebilir olsa da, açıkça daha büyük bir sorunun varlığı belliydi. Ertesi gün, kullanıcılar her iki siteyi de tarayıcıda görünen veritabanı hatalarıyla tamamen çevrimdışı bulmuşlardır. ![https://i.imgur.com/hJLmVTo.png](https://i.imgur.com/hJLmVTo.png) Şimdi, bu hata oldukça yaygın bir hatadır, genellikle bir veritabanı yedeği olduğunu gösterir. Ancak SSL sertifikası olayı göz önüne alındığında, bunun başka bir şeyin belirtisi gibi görünüyordu. Aynı günün ilerleyen saatlerinde, her iki site de tamamen çevrimdışı hale geldi ve hata sayfası bile yanıt vermiyordu. ![https://i.imgur.com/GjzURlq.png](https://i.imgur.com/GjzURlq.png) ## Bu ne anlama geliyor? SA-MP topluluğunda birçok spekülasyon var ancak ne olduğuna dair resmi bir açıklama yok. Ancak geçmişte öğrendiğimiz gibi, en kötüsünü varsaymak genellikle en iyisidir. Forum ve Wiki muhtemelen geri gelmeyecek. Bunun hakkında yanlış olmak harika olurdu. ## Alternatifler Şu anda, wiki içeriğine [Archive.org kopyalarını](http://web-old.archive.org/web/20200314132548/https://wiki.sa-mp.com/wiki/Main_Page) kullanarak hala erişilebilir. Bu açıkça iyi bir uzun vadeli çözüm değil. Bu sayfaların yüklenmesi uzun sürer ve Archive.org'un hizmetini (ki zaten yeterince fon almayan ve internet tarihinde çok önemli bir rol oynayan bir hizmet) zorlar. [SA-MP Wiki'nin kurtarılan versiyonu](/docs), harika bir modern alternatiftir. Markdown kullanır ve GitHub ve Vercel kullanılarak barındırılır. Kullanıcılara, mevcut tüm wiki sayfalarını yeni wiki'ye aktarmada yardımcı olabilmeleri için mümkün olan kadar katkıda bulunmalarını öneriyoruz. Daha fazla bilgi için şuraya bakabilirsiniz: https://github.com/openmultiplayer/wiki/issues/27
openmultiplayer/web/frontend/content/tr/missing-sites.mdx/0
{ "file_path": "openmultiplayer/web/frontend/content/tr/missing-sites.mdx", "repo_id": "openmultiplayer", "token_count": 1004 }
465
--- title: 我怎样才能加入这个团队? date: "2021-08-29T01:24:09" author: Potassium --- ➖ 我怎样才能加入这个团队? 我们经常被问到这个问题,所以我们认为应该发布一个关于这个问题的帖子! 首先,非常感谢你对贡献感兴趣! 如你所知,我们都是 SA-MP 的老玩家,聚集在一起是为了保持 SA 多人游戏世界的活力。我们热衷于这个项目,为玩家而存在,这就是为什么它最终将是开源的。 开发岗: 我们目前正在为测试版做最后的润色工作,一旦测试版上线,我们将非常感谢并欢迎社区的贡献!我们需要测试功能和提供边缘案例,当然也需要寻找错误和其他需要解决的问题等帮助。 测试版将是开发过程中极其重要的一环,我们希望每个人都能参与进来,所以请继续关注测试版的公告,我们保证很快就会公布。 区域协调岗: 你是否同时掌握英语和另一门语言,并且都能流利的表达?我们希望你能帮助我们翻译 Wiki 页面、博客帖子和社交媒体文章,并帮助我们管理 Discord 和论坛的语言部分。 这些职位的申请目前处于关闭状态,因为我们做了一些决策,但它们很快就会再次开放! 其他帮助方式: - 分享我们的社交媒体帖子 - 邀请其他 SA 玩家到我们的 Discord(discord.gg/samp) - 参与到我们的 Discord 社区中来 - 在 Discord 上帮助其他玩家(脚本,技术,一切力所能及的帮助!)
openmultiplayer/web/frontend/content/zh-cn/blog/how-to-join-the-team.mdx/0
{ "file_path": "openmultiplayer/web/frontend/content/zh-cn/blog/how-to-join-the-team.mdx", "repo_id": "openmultiplayer", "token_count": 1071 }
466
google-site-verification: google50096c476ab4ce72.html
openmultiplayer/web/frontend/public/google50096c476ab4ce72.html/0
{ "file_path": "openmultiplayer/web/frontend/public/google50096c476ab4ce72.html", "repo_id": "openmultiplayer", "token_count": 19 }
467
import { ChakraProvider, cookieStorageManager, localStorageManager, } from '@chakra-ui/react' import { GetServerSidePropsContext } from 'next' import theme from 'src/styles/theme' interface ChakraProps { cookies: string; children: React.ReactNode } // See: https://chakra-ui.com/docs/styled-system/features/color-mode#add-colormodemanager-optional-for-ssr export function Chakra({ cookies, children }: ChakraProps): JSX.Element { const colorModeManager = typeof cookies === 'string' ? cookieStorageManager(cookies) : localStorageManager return ( <ChakraProvider colorModeManager={colorModeManager} theme={theme}> {children} </ChakraProvider> ) } interface ServerSideProps { props: { cookies: string; } } export function getServerSideProps({ req }: GetServerSidePropsContext): ServerSideProps { return { props: { cookies: req.headers.cookie ?? '', }, } }
openmultiplayer/web/frontend/src/components/Chakra.tsx/0
{ "file_path": "openmultiplayer/web/frontend/src/components/Chakra.tsx", "repo_id": "openmultiplayer", "token_count": 323 }
468
/* eslint-disable @next/next/no-img-element */ /* eslint-disable jsx-a11y/alt-text */ import { trim } from "lodash"; import React, { FC } from "react"; const Img: FC< React.DetailedHTMLProps< React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement > > = (props) => { const { src } = props; if (src?.startsWith("http")) { return <img {...props} />; } const path = trim(src, "/"); return <img {...props} src={`https://assets.open.mp/assets/${path}`} />; }; export default Img;
openmultiplayer/web/frontend/src/components/templates/Image.tsx/0
{ "file_path": "openmultiplayer/web/frontend/src/components/templates/Image.tsx", "repo_id": "openmultiplayer", "token_count": 199 }
469
import Admonition from "../../../Admonition"; export default function NoteLowercase({ name = "function" }) { return ( <Admonition type="warning"> <p>Bu {name} öğesi küçük harfle başlar.</p> </Admonition> ); }
openmultiplayer/web/frontend/src/components/templates/translations/tr/lowercase-note.tsx/0
{ "file_path": "openmultiplayer/web/frontend/src/components/templates/translations/tr/lowercase-note.tsx", "repo_id": "openmultiplayer", "token_count": 90 }
470
import { Components } from "@mdx-js/react"; export type MarkdownContent = { compiledSource: string; renderedOutput?: string; scope?: any; }; export type MarkdownRenderConfig = { components: Components; mdxOptions?: any; scope?: any; };
openmultiplayer/web/frontend/src/mdx-helpers/types.ts/0
{ "file_path": "openmultiplayer/web/frontend/src/mdx-helpers/types.ts", "repo_id": "openmultiplayer", "token_count": 77 }
471
import { GetServerSidePropsContext, GetServerSidePropsResult } from "next"; const Page = () => null; export const getServerSideProps = async ( ctx: GetServerSidePropsContext ): Promise<GetServerSidePropsResult<unknown>> => { ctx.res.setHeader("clear-site-data", '"cookies"'); ctx.res.writeHead(302, { Location: "/dashboard" }); ctx.res.end(); return { props: {} }; }; export default Page;
openmultiplayer/web/frontend/src/pages/logout.tsx/0
{ "file_path": "openmultiplayer/web/frontend/src/pages/logout.tsx", "repo_id": "openmultiplayer", "token_count": 135 }
472
import { extendTheme } from "@chakra-ui/react"; import { mode } from '@chakra-ui/theme-tools'; import { theme as editorTheme } from 'rich-markdown-editor' const fonts = { body: `Frutiger, "Frutiger Linotype", Univers, Calibri, "Gill Sans", "Gill Sans MT", "Myriad Pro", Myriad, "DejaVu Sans Condensed", "Liberation Sans", "Nimbus Sans L", Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans-serif`, heading: `English Grotesque, Frutiger, "Frutiger Linotype", Univers, Calibri, "Gill Sans", "Gill Sans MT", "Myriad Pro", Myriad, "DejaVu Sans Condensed", "Liberation Sans", "Nimbus Sans L", Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans-serif`, mono: "Menlo, monospace", }; const styles = { global: (props: any) => ({ h1: { marginTop: "0.5em", fontFamily: "english-grotesque", fontSize: "1.6em", fontWeight: 700, }, h2: { marginTop: "0.5em", fontFamily: "english-grotesque", fontSize: "1.5em", fontWeight: 700, }, h3: { marginTop: "0.5em", fontFamily: "english-grotesque", fontSize: "1.4em", fontWeight: 300, }, h4: { marginTop: "0.5em", fontFamily: "english-grotesque", fontSize: "1.3em", fontWeight: 300, }, p: { marginTop: "0.5em", }, ul: { paddingLeft: "1em", }, a: { color: "#9083D2", _hover: { textDecoration: "underline", }, }, pre: { maxWidth: '100%', overflowX: 'auto', backgroundColor: mode('gray.200', 'gray.600')(props), padding: '0.5em', borderRadius: '0.2em' }, 'table tr:nth-child(2n)': { backgroundColor: mode('#f5f6f7', 'gray.800')(props), } }), }; const colors = { brand: { black: "#101013", darkpurple: "#282438", violet: "#463E55", bluepurple: "#8477B7", white: "#F3F2F5", }, }; export const editorLight = { ...editorTheme }; export const editorDark = { ...editorTheme, quote: "blue", background: 'gray.900', text: 'brand.white', code: 'brand.white', codeBackground: 'rgba(0, 0, 0, 0.3)', codeBorder: editorTheme.lightBlack, }; const theme = extendTheme({ colors, fonts, styles }); export default theme;
openmultiplayer/web/frontend/src/styles/theme.tsx/0
{ "file_path": "openmultiplayer/web/frontend/src/styles/theme.tsx", "repo_id": "openmultiplayer", "token_count": 991 }
473
import "react"; declare module "react" { interface StyleHTMLAttributes<T> extends React.HTMLAttributes<T> { jsx?: boolean; global?: boolean; } } declare module "react-twemoji" { // }
openmultiplayer/web/frontend/types.d.ts/0
{ "file_path": "openmultiplayer/web/frontend/types.d.ts", "repo_id": "openmultiplayer", "token_count": 72 }
474
package web import "net/http" func WithContentType(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Header().Add("Content-Type", "application/json") next.ServeHTTP(w, r) }) }
openmultiplayer/web/internal/web/content_type.go/0
{ "file_path": "openmultiplayer/web/internal/web/content_type.go", "repo_id": "openmultiplayer", "token_count": 87 }
475
-- AlterTable ALTER TABLE "Server" ADD COLUMN "deletedAt" TIMESTAMP(3);
openmultiplayer/web/prisma/migrations/20220108204808_server_deleted_at/migration.sql/0
{ "file_path": "openmultiplayer/web/prisma/migrations/20220108204808_server_deleted_at/migration.sql", "repo_id": "openmultiplayer", "token_count": 30 }
476
import { addons } from '@storybook/addons' import { create } from '@storybook/theming' import './global.css' import brandImage from '../public/img/ol-brand/overleaf.svg' const theme = create({ base: 'light', brandTitle: 'Overleaf', brandUrl: 'https://www.overleaf.com', brandImage, }) addons.setConfig({ theme })
overleaf/web/.storybook/manager.js/0
{ "file_path": "overleaf/web/.storybook/manager.js", "repo_id": "overleaf", "token_count": 113 }
477
const logger = require('logger-sharelatex') const OError = require('@overleaf/o-error') const AnalyticsRegistrationSourceHelper = require('./AnalyticsRegistrationSourceHelper') const SessionManager = require('../../Features/Authentication/SessionManager') function setSource(source) { return function (req, res, next) { if (req.session) { req.session.required_login_for = source } next() } } function clearSource() { return function (req, res, next) { AnalyticsRegistrationSourceHelper.clearSource(req.session) next() } } function setInbound() { return function setInbound(req, res, next) { if (req.session.inbound) { return next() // don't overwrite referrer } if (SessionManager.isUserLoggedIn(req.session)) { return next() // don't store referrer if user is alread logged in } const referrer = req.header('referrer') try { AnalyticsRegistrationSourceHelper.setInbound( req.session, req.url, req.query, referrer ) } catch (error) { // log errors and fail silently OError.tag(error, 'failed to parse inbound referrer', { referrer, }) logger.warn({ error }, error.message) } next() } } module.exports = { setSource, clearSource, setInbound, }
overleaf/web/app/src/Features/Analytics/AnalyticsRegistrationSourceMiddleware.js/0
{ "file_path": "overleaf/web/app/src/Features/Analytics/AnalyticsRegistrationSourceMiddleware.js", "repo_id": "overleaf", "token_count": 488 }
478
/* eslint-disable camelcase, node/handle-callback-err, max-len, no-unused-vars, */ // TODO: This file was created by bulk-decaffeinate. // Fix any style issues and re-enable lint. /* * decaffeinate suggestions: * DS101: Remove unnecessary use of Array.from * DS102: Remove unnecessary code created because of implicit returns * DS207: Consider shorter variations of null checks * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ let ChatController const ChatApiHandler = require('./ChatApiHandler') const EditorRealTimeController = require('../Editor/EditorRealTimeController') const SessionManager = require('../Authentication/SessionManager') const UserInfoManager = require('../User/UserInfoManager') const UserInfoController = require('../User/UserInfoController') const async = require('async') module.exports = ChatController = { sendMessage(req, res, next) { const { project_id } = req.params const { content } = req.body const user_id = SessionManager.getLoggedInUserId(req.session) if (user_id == null) { const err = new Error('no logged-in user') return next(err) } return ChatApiHandler.sendGlobalMessage( project_id, user_id, content, function (err, message) { if (err != null) { return next(err) } return UserInfoManager.getPersonalInfo( message.user_id, function (err, user) { if (err != null) { return next(err) } message.user = UserInfoController.formatPersonalInfo(user) EditorRealTimeController.emitToRoom( project_id, 'new-chat-message', message ) return res.sendStatus(204) } ) } ) }, getMessages(req, res, next) { const { project_id } = req.params const { query } = req return ChatApiHandler.getGlobalMessages( project_id, query.limit, query.before, function (err, messages) { if (err != null) { return next(err) } return ChatController._injectUserInfoIntoThreads( { global: { messages } }, function (err) { if (err != null) { return next(err) } return res.json(messages) } ) } ) }, _injectUserInfoIntoThreads(threads, callback) { // There will be a lot of repitition of user_ids, so first build a list // of unique ones to perform db look ups on, then use these to populate the // user fields let message, thread, thread_id, user_id if (callback == null) { callback = function (error, threads) {} } const user_ids = {} for (thread_id in threads) { thread = threads[thread_id] if (thread.resolved) { user_ids[thread.resolved_by_user_id] = true } for (message of Array.from(thread.messages)) { user_ids[message.user_id] = true } } const jobs = [] const users = {} for (user_id in user_ids) { const _ = user_ids[user_id] ;(user_id => jobs.push(cb => UserInfoManager.getPersonalInfo(user_id, function (error, user) { if (error != null) return cb(error) user = UserInfoController.formatPersonalInfo(user) users[user_id] = user cb() }) ))(user_id) } return async.series(jobs, function (error) { if (error != null) { return callback(error) } for (thread_id in threads) { thread = threads[thread_id] if (thread.resolved) { thread.resolved_by_user = users[thread.resolved_by_user_id] } for (message of Array.from(thread.messages)) { message.user = users[message.user_id] } } return callback(null, threads) }) }, }
overleaf/web/app/src/Features/Chat/ChatController.js/0
{ "file_path": "overleaf/web/app/src/Features/Chat/ChatController.js", "repo_id": "overleaf", "token_count": 1709 }
479
/* eslint-disable camelcase, node/handle-callback-err, max-len, no-unused-vars, */ // TODO: This file was created by bulk-decaffeinate. // Fix any style issues and re-enable lint. /* * decaffeinate suggestions: * DS102: Remove unnecessary code created because of implicit returns * DS207: Consider shorter variations of null checks * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ let ContactManager const OError = require('@overleaf/o-error') const request = require('request') const settings = require('@overleaf/settings') module.exports = ContactManager = { getContactIds(user_id, options, callback) { if (options == null) { options = { limits: 50 } } if (callback == null) { callback = function (error, contacts) {} } const url = `${settings.apis.contacts.url}/user/${user_id}/contacts` return request.get( { url, qs: options, json: true, jar: false, }, function (error, res, data) { if (error != null) { return callback(error) } if (res.statusCode >= 200 && res.statusCode < 300) { return callback( null, (data != null ? data.contact_ids : undefined) || [] ) } else { error = new OError( `contacts api responded with non-success code: ${res.statusCode}`, { user_id } ) return callback(error) } } ) }, addContact(user_id, contact_id, callback) { if (callback == null) { callback = function (error) {} } const url = `${settings.apis.contacts.url}/user/${user_id}/contacts` return request.post( { url, json: { contact_id, }, jar: false, }, function (error, res, data) { if (error != null) { return callback(error) } if (res.statusCode >= 200 && res.statusCode < 300) { return callback( null, (data != null ? data.contact_ids : undefined) || [] ) } else { error = new OError( `contacts api responded with non-success code: ${res.statusCode}`, { user_id, contact_id, } ) return callback(error) } } ) }, }
overleaf/web/app/src/Features/Contacts/ContactManager.js/0
{ "file_path": "overleaf/web/app/src/Features/Contacts/ContactManager.js", "repo_id": "overleaf", "token_count": 1107 }
480
const _ = require('underscore') const settings = require('@overleaf/settings') const moment = require('moment') const EmailMessageHelper = require('./EmailMessageHelper') const StringHelper = require('../Helpers/StringHelper') const BaseWithHeaderEmailLayout = require('./Layouts/BaseWithHeaderEmailLayout') const SpamSafe = require('./SpamSafe') const ctaEmailBody = require('./Bodies/cta-email') const NoCTAEmailBody = require('./Bodies/NoCTAEmailBody') function _emailBodyPlainText(content, opts, ctaEmail) { let emailBody = `${content.greeting(opts, true)}` emailBody += `\r\n\r\n` emailBody += `${content.message(opts, true).join('\r\n\r\n')}` if (ctaEmail) { emailBody += `\r\n\r\n` emailBody += `${content.ctaText(opts, true)}: ${content.ctaURL(opts, true)}` } if ( content.secondaryMessage(opts, true) && content.secondaryMessage(opts, true).length > 0 ) { emailBody += `\r\n\r\n` emailBody += `${content.secondaryMessage(opts, true).join('\r\n\r\n')}` } emailBody += `\r\n\r\n` emailBody += `Regards,\r\nThe ${settings.appName} Team - ${settings.siteUrl}` if ( settings.email && settings.email.template && settings.email.template.customFooter ) { emailBody += `\r\n\r\n` emailBody += settings.email.template.customFooter } return emailBody } function ctaTemplate(content) { if ( !content.ctaURL || !content.ctaText || !content.message || !content.subject ) { throw new Error('missing required CTA email content') } if (!content.title) { content.title = () => {} } if (!content.greeting) { content.greeting = () => 'Hi,' } if (!content.secondaryMessage) { content.secondaryMessage = () => [] } if (!content.gmailGoToAction) { content.gmailGoToAction = () => {} } return { subject(opts) { return content.subject(opts) }, layout: BaseWithHeaderEmailLayout, plainTextTemplate(opts) { return _emailBodyPlainText(content, opts, true) }, compiledTemplate(opts) { return ctaEmailBody({ title: content.title(opts), greeting: content.greeting(opts), message: content.message(opts), secondaryMessage: content.secondaryMessage(opts), ctaText: content.ctaText(opts), ctaURL: content.ctaURL(opts), gmailGoToAction: content.gmailGoToAction(opts), StringHelper, }) }, } } function NoCTAEmailTemplate(content) { if (content.greeting == null) { content.greeting = () => 'Hi,' } if (!content.message) { throw new Error('missing message') } return { subject(opts) { return content.subject(opts) }, layout: BaseWithHeaderEmailLayout, plainTextTemplate(opts) { return `\ ${content.greeting(opts)} ${content.message(opts, true).join('\r\n\r\n')} Regards, The ${settings.appName} Team - ${settings.siteUrl}\ ` }, compiledTemplate(opts) { return NoCTAEmailBody({ title: typeof content.title === 'function' ? content.title(opts) : undefined, greeting: content.greeting(opts), message: content.message(opts), StringHelper, }) }, } } function buildEmail(templateName, opts) { const template = templates[templateName] opts.siteUrl = settings.siteUrl opts.body = template.compiledTemplate(opts) return { subject: template.subject(opts), html: template.layout(opts), text: template.plainTextTemplate && template.plainTextTemplate(opts), } } const templates = {} templates.registered = ctaTemplate({ subject() { return `Activate your ${settings.appName} Account` }, message(opts) { return [ `Congratulations, you've just had an account created for you on ${ settings.appName } with the email address '${_.escape(opts.to)}'.`, 'Click here to set your password and log in:', ] }, secondaryMessage() { return [ `If you have any questions or problems, please contact ${settings.adminEmail}`, ] }, ctaText() { return 'Set password' }, ctaURL(opts) { return opts.setNewPasswordUrl }, }) templates.canceledSubscription = ctaTemplate({ subject() { return `${settings.appName} thoughts` }, message() { return [ `We are sorry to see you cancelled your ${settings.appName} premium subscription. Would you mind giving us some feedback on what the site is lacking at the moment via this quick survey?`, ] }, secondaryMessage() { return ['Thank you in advance!'] }, ctaText() { return 'Leave Feedback' }, ctaURL(opts) { return 'https://docs.google.com/forms/d/e/1FAIpQLSfa7z_s-cucRRXm70N4jEcSbFsZeb0yuKThHGQL8ySEaQzF0Q/viewform?usp=sf_link' }, }) templates.reactivatedSubscription = ctaTemplate({ subject() { return `Subscription Reactivated - ${settings.appName}` }, message(opts) { return ['Your subscription was reactivated successfully.'] }, ctaText() { return 'View Subscription Dashboard' }, ctaURL(opts) { return `${settings.siteUrl}/user/subscription` }, }) templates.passwordResetRequested = ctaTemplate({ subject() { return `Password Reset - ${settings.appName}` }, title() { return 'Password Reset' }, message() { return [`We got a request to reset your ${settings.appName} password.`] }, secondaryMessage() { return [ "If you ignore this message, your password won't be changed.", "If you didn't request a password reset, let us know.", ] }, ctaText() { return 'Reset password' }, ctaURL(opts) { return opts.setNewPasswordUrl }, }) templates.confirmEmail = ctaTemplate({ subject() { return `Confirm Email - ${settings.appName}` }, title() { return 'Confirm Email' }, message(opts) { return [ `Please confirm that you have added a new email, ${opts.to}, to your ${settings.appName} account.`, ] }, secondaryMessage() { return [ 'If you did not request this, you can simply ignore this message.', `If you have any questions or trouble confirming your email address, please get in touch with our support team at ${settings.adminEmail}.`, ] }, ctaText() { return 'Confirm Email' }, ctaURL(opts) { return opts.confirmEmailUrl }, }) templates.projectInvite = ctaTemplate({ subject(opts) { return `${_.escape( SpamSafe.safeProjectName(opts.project.name, 'New Project') )} - shared by ${_.escape( SpamSafe.safeEmail(opts.owner.email, 'a collaborator') )}` }, title(opts) { return `${_.escape( SpamSafe.safeProjectName(opts.project.name, 'New Project') )} - shared by ${_.escape( SpamSafe.safeEmail(opts.owner.email, 'a collaborator') )}` }, message(opts) { return [ `${_.escape( SpamSafe.safeEmail(opts.owner.email, 'a collaborator') )} wants to share ${_.escape( SpamSafe.safeProjectName(opts.project.name, 'a new project') )} with you.`, ] }, ctaText() { return 'View project' }, ctaURL(opts) { return opts.inviteUrl }, gmailGoToAction(opts) { return { target: opts.inviteUrl, name: 'View project', description: `Join ${_.escape( SpamSafe.safeProjectName(opts.project.name, 'project') )} at ${settings.appName}`, } }, }) templates.reconfirmEmail = ctaTemplate({ subject() { return `Reconfirm Email - ${settings.appName}` }, title() { return 'Reconfirm Email' }, message(opts) { return [ `Please reconfirm your email address, ${opts.to}, on your ${settings.appName} account.`, ] }, secondaryMessage() { return [ 'If you did not request this, you can simply ignore this message.', `If you have any questions or trouble confirming your email address, please get in touch with our support team at ${settings.adminEmail}.`, ] }, ctaText() { return 'Reconfirm Email' }, ctaURL(opts) { return opts.confirmEmailUrl }, }) templates.verifyEmailToJoinTeam = ctaTemplate({ subject(opts) { return `${_.escape( _formatUserNameAndEmail(opts.inviter, 'A collaborator') )} has invited you to join a team on ${settings.appName}` }, title(opts) { return `${_.escape( _formatUserNameAndEmail(opts.inviter, 'A collaborator') )} has invited you to join a team on ${settings.appName}` }, message(opts) { return [ `Please click the button below to join the team and enjoy the benefits of an upgraded ${settings.appName} account.`, ] }, ctaText(opts) { return 'Join now' }, ctaURL(opts) { return opts.acceptInviteUrl }, }) templates.testEmail = ctaTemplate({ subject() { return `A Test Email from ${settings.appName}` }, title() { return `A Test Email from ${settings.appName}` }, greeting() { return 'Hi,' }, message() { return [`This is a test Email from ${settings.appName}`] }, ctaText() { return `Open ${settings.appName}` }, ctaURL() { return settings.siteUrl }, }) templates.ownershipTransferConfirmationPreviousOwner = NoCTAEmailTemplate({ subject(opts) { return `Project ownership transfer - ${settings.appName}` }, title(opts) { const projectName = _.escape( SpamSafe.safeProjectName(opts.project.name, 'Your project') ) return `${projectName} - Owner change` }, message(opts, isPlainText) { const nameAndEmail = _.escape( _formatUserNameAndEmail(opts.newOwner, 'a collaborator') ) const projectName = _.escape( SpamSafe.safeProjectName(opts.project.name, 'your project') ) const projectNameDisplay = isPlainText ? projectName : `<b>${projectName}</b>` return [ `As per your request, we have made ${nameAndEmail} the owner of ${projectNameDisplay}.`, `If you haven't asked to change the owner of ${projectNameDisplay}, please get in touch with us via ${settings.adminEmail}.`, ] }, }) templates.ownershipTransferConfirmationNewOwner = ctaTemplate({ subject(opts) { return `Project ownership transfer - ${settings.appName}` }, title(opts) { const projectName = _.escape( SpamSafe.safeProjectName(opts.project.name, 'Your project') ) return `${projectName} - Owner change` }, message(opts, isPlainText) { const nameAndEmail = _.escape( _formatUserNameAndEmail(opts.previousOwner, 'A collaborator') ) const projectName = _.escape( SpamSafe.safeProjectName(opts.project.name, 'a project') ) const projectNameEmphasized = isPlainText ? projectName : `<b>${projectName}</b>` return [ `${nameAndEmail} has made you the owner of ${projectNameEmphasized}. You can now manage ${projectName} sharing settings.`, ] }, ctaText(opts) { return 'View project' }, ctaURL(opts) { const projectUrl = `${ settings.siteUrl }/project/${opts.project._id.toString()}` return projectUrl }, }) templates.userOnboardingEmail = NoCTAEmailTemplate({ subject(opts) { return `Getting more out of ${settings.appName}` }, greeting(opts) { return '' }, title(opts) { return `Getting more out of ${settings.appName}` }, message(opts, isPlainText) { const learnLatexLink = EmailMessageHelper.displayLink( 'Learn LaTeX in 30 minutes', `${settings.siteUrl}/learn/latex/Learn_LaTeX_in_30_minutes?utm_source=overleaf&utm_medium=email&utm_campaign=onboarding`, isPlainText ) const templatesLinks = EmailMessageHelper.displayLink( 'Find a beautiful template', `${settings.siteUrl}/latex/templates?utm_source=overleaf&utm_medium=email&utm_campaign=onboarding`, isPlainText ) const collaboratorsLink = EmailMessageHelper.displayLink( 'Work with your collaborators', `${settings.siteUrl}/learn/how-to/Sharing_a_project?utm_source=overleaf&utm_medium=email&utm_campaign=onboarding`, isPlainText ) const siteLink = EmailMessageHelper.displayLink( 'www.overleaf.com', settings.siteUrl, isPlainText ) const userSettingsLink = EmailMessageHelper.displayLink( 'here', `${settings.siteUrl}/user/settings`, isPlainText ) const onboardingSurveyLink = EmailMessageHelper.displayLink( 'Join our user feedback programme', 'https://forms.gle/DB7pdk2B1VFQqVVB9', isPlainText ) return [ `Thanks for signing up for ${settings.appName} recently. We hope you've been finding it useful! Here are some key features to help you get the most out of the service:`, `${learnLatexLink}: In this tutorial we provide a quick and easy first introduction to LaTeX with no prior knowledge required. By the time you are finished, you will have written your first LaTeX document!`, `${templatesLinks}: If you're looking for a template or example to get started, we've a large selection available in our template gallery, including CVs, project reports, journal articles and more.`, `${collaboratorsLink}: One of the key features of Overleaf is the ability to share projects and collaborate on them with other users. Find out how to share your projecs with your colleagues in this quick how-to guide.`, `${onboardingSurveyLink} to help us make Overleaf even better!`, 'Thanks again for using Overleaf :)', `John`, `Dr John Hammersley <br />Co-founder & CEO <br />${siteLink}<hr>`, `Don't want onboarding emails like this from us? Don't worry, this is the only one. If you've previously subscribed to emails about product offers and company news and events, you can unsubscribe ${userSettingsLink}.`, ] }, }) templates.securityAlert = NoCTAEmailTemplate({ subject(opts) { return `Overleaf security note: ${opts.action}` }, title(opts) { return opts.action.charAt(0).toUpperCase() + opts.action.slice(1) }, message(opts, isPlainText) { const dateFormatted = moment().format('dddd D MMMM YYYY') const timeFormatted = moment().format('HH:mm') const helpLink = EmailMessageHelper.displayLink( 'quick guide', `${settings.siteUrl}/learn/how-to/Keeping_your_account_secure`, isPlainText ) const actionDescribed = EmailMessageHelper.cleanHTML( opts.actionDescribed, isPlainText ) if (!opts.message) { opts.message = [] } const message = opts.message.map(m => { return EmailMessageHelper.cleanHTML(m, isPlainText) }) return [ `We are writing to let you know that ${actionDescribed} on ${dateFormatted} at ${timeFormatted} GMT.`, ...message, `If this was you, you can ignore this email.`, `If this was not you, we recommend getting in touch with our support team at ${settings.adminEmail} to report this as potentially suspicious activity on your account.`, `We also encourage you to read our ${helpLink} to keeping your ${settings.appName} account safe.`, ] }, }) templates.SAMLDataCleared = ctaTemplate({ subject(opts) { return `Institutional Login No Longer Linked - ${settings.appName}` }, title(opts) { return 'Institutional Login No Longer Linked' }, message(opts, isPlainText) { return [ `We're writing to let you know that due to a bug on our end, we've had to temporarily disable logging into your ${settings.appName} through your institution.`, `To get it going again, you'll need to relink your institutional email address to your ${settings.appName} account via your settings.`, ] }, secondaryMessage() { return [ `If you ordinarily log in to your ${settings.appName} account through your institution, you may need to set or reset your password to regain access to your account first.`, 'This bug did not affect the security of any accounts, but it may have affected license entitlements for a small number of users. We are sorry for any inconvenience that this may cause for you.', `If you have any questions, please get in touch with our support team at ${settings.adminEmail} or by replying to this email.`, ] }, ctaText(opts) { return 'Update my Emails and Affiliations' }, ctaURL(opts) { return `${settings.siteUrl}/user/settings` }, }) function _formatUserNameAndEmail(user, placeholder) { if (user.first_name && user.last_name) { const fullName = `${user.first_name} ${user.last_name}` if (SpamSafe.isSafeUserName(fullName)) { if (SpamSafe.isSafeEmail(user.email)) { return `${fullName} (${user.email})` } else { return fullName } } } return SpamSafe.safeEmail(user.email, placeholder) } module.exports = { templates, ctaTemplate, NoCTAEmailTemplate, buildEmail, }
overleaf/web/app/src/Features/Email/EmailBuilder.js/0
{ "file_path": "overleaf/web/app/src/Features/Email/EmailBuilder.js", "repo_id": "overleaf", "token_count": 6184 }
481
const { acceptsJson, } = require('../../infrastructure/RequestContentTypeDetection') module.exports = { redirect, } // redirect the request via headers or JSON response depending on the request // format function redirect(req, res, redir) { if (acceptsJson(req)) { res.json({ redir }) } else { res.redirect(redir) } }
overleaf/web/app/src/Features/Helpers/AsyncFormHelper.js/0
{ "file_path": "overleaf/web/app/src/Features/Helpers/AsyncFormHelper.js", "repo_id": "overleaf", "token_count": 114 }
482
let InstitutionsFeatures const UserGetter = require('../User/UserGetter') const PlansLocator = require('../Subscription/PlansLocator') const Settings = require('@overleaf/settings') module.exports = InstitutionsFeatures = { getInstitutionsFeatures(userId, callback) { InstitutionsFeatures.getInstitutionsPlan( userId, function (error, planCode) { if (error) { return callback(error) } const plan = planCode && PlansLocator.findLocalPlanInSettings(planCode) const features = plan && plan.features callback(null, features || {}) } ) }, getInstitutionsPlan(userId, callback) { InstitutionsFeatures.hasLicence(userId, function (error, hasLicence) { if (error) { return callback(error) } if (!hasLicence) { return callback(null, null) } callback(null, Settings.institutionPlanCode) }) }, hasLicence(userId, callback) { UserGetter.getUserFullEmails(userId, function (error, emailsData) { if (error) { return callback(error) } const hasLicence = emailsData.some( emailData => emailData.emailHasInstitutionLicence ) callback(null, hasLicence) }) }, }
overleaf/web/app/src/Features/Institutions/InstitutionsFeatures.js/0
{ "file_path": "overleaf/web/app/src/Features/Institutions/InstitutionsFeatures.js", "repo_id": "overleaf", "token_count": 487 }
483
const NotificationsHandler = require('./NotificationsHandler') const SessionManager = require('../Authentication/SessionManager') const _ = require('underscore') module.exports = { getAllUnreadNotifications(req, res) { const userId = SessionManager.getLoggedInUserId(req.session) NotificationsHandler.getUserNotifications( userId, function (err, unreadNotifications) { unreadNotifications = _.map( unreadNotifications, function (notification) { notification.html = req.i18n.translate( notification.templateKey, notification.messageOpts ) return notification } ) res.send(unreadNotifications) } ) }, markNotificationAsRead(req, res) { const userId = SessionManager.getLoggedInUserId(req.session) const { notificationId } = req.params NotificationsHandler.markAsRead(userId, notificationId, () => res.sendStatus(200) ) }, }
overleaf/web/app/src/Features/Notifications/NotificationsController.js/0
{ "file_path": "overleaf/web/app/src/Features/Notifications/NotificationsController.js", "repo_id": "overleaf", "token_count": 400 }
484
const path = require('path') const DocstoreManager = require('../Docstore/DocstoreManager') const Errors = require('../Errors/Errors') const ProjectGetter = require('./ProjectGetter') const { promisifyAll } = require('../../util/promises') const ProjectEntityHandler = { getAllDocs(projectId, callback) { // We get the path and name info from the project, and the lines and // version info from the doc store. DocstoreManager.getAllDocs(projectId, (error, docContentsArray) => { if (error != null) { return callback(error) } // Turn array from docstore into a dictionary based on doc id const docContents = {} for (const docContent of docContentsArray) { docContents[docContent._id] = docContent } ProjectEntityHandler._getAllFolders(projectId, (error, folders) => { if (folders == null) { folders = {} } if (error != null) { return callback(error) } const docs = {} for (const folderPath in folders) { const folder = folders[folderPath] for (const doc of folder.docs || []) { const content = docContents[doc._id.toString()] if (content != null) { docs[path.join(folderPath, doc.name)] = { _id: doc._id, name: doc.name, lines: content.lines, rev: content.rev, } } } } callback(null, docs) }) }) }, getAllFiles(projectId, callback) { ProjectEntityHandler._getAllFolders(projectId, (err, folders) => { if (folders == null) { folders = {} } if (err != null) { return callback(err) } const files = {} for (const folderPath in folders) { const folder = folders[folderPath] for (const file of folder.fileRefs || []) { if (file != null) { files[path.join(folderPath, file.name)] = file } } } callback(null, files) }) }, getAllEntities(projectId, callback) { ProjectGetter.getProject(projectId, (err, project) => { if (err != null) { return callback(err) } if (project == null) { return callback(new Errors.NotFoundError('project not found')) } ProjectEntityHandler.getAllEntitiesFromProject(project, callback) }) }, getAllEntitiesFromProject(project, callback) { ProjectEntityHandler._getAllFoldersFromProject(project, (err, folders) => { if (folders == null) { folders = {} } if (err != null) { return callback(err) } const docs = [] const files = [] for (const folderPath in folders) { const folder = folders[folderPath] for (const doc of folder.docs || []) { if (doc != null) { docs.push({ path: path.join(folderPath, doc.name), doc }) } } for (const file of folder.fileRefs || []) { if (file != null) { files.push({ path: path.join(folderPath, file.name), file }) } } } callback(null, docs, files) }) }, getAllDocPathsFromProjectById(projectId, callback) { ProjectGetter.getProjectWithoutDocLines(projectId, (err, project) => { if (err != null) { return callback(err) } if (project == null) { return callback(Errors.NotFoundError('no project')) } ProjectEntityHandler.getAllDocPathsFromProject(project, callback) }) }, getAllDocPathsFromProject(project, callback) { ProjectEntityHandler._getAllFoldersFromProject(project, (err, folders) => { if (folders == null) { folders = {} } if (err != null) { return callback(err) } const docPath = {} for (const folderPath in folders) { const folder = folders[folderPath] for (const doc of folder.docs || []) { docPath[doc._id] = path.join(folderPath, doc.name) } } callback(null, docPath) }) }, getDoc(projectId, docId, options, callback) { if (options == null) { options = {} } if (typeof options === 'function') { callback = options options = {} } DocstoreManager.getDoc(projectId, docId, options, callback) }, /** * @param {ObjectID | string} projectId * @param {ObjectID | string} docId * @param {Function} callback */ getDocPathByProjectIdAndDocId(projectId, docId, callback) { ProjectGetter.getProjectWithoutDocLines(projectId, (err, project) => { if (err != null) { return callback(err) } if (project == null) { return callback(new Errors.NotFoundError('no project')) } ProjectEntityHandler.getDocPathFromProjectByDocId( project, docId, (err, docPath) => { if (err) return callback(Errors.OError.tag(err)) if (docPath == null) { return callback(new Errors.NotFoundError('no doc')) } callback(null, docPath) } ) }) }, /** * @param {Project} project * @param {ObjectID | string} docId * @param {Function} callback */ getDocPathFromProjectByDocId(project, docId, callback) { function recursivelyFindDocInFolder(basePath, docId, folder) { const docInCurrentFolder = (folder.docs || []).find( currentDoc => currentDoc._id.toString() === docId.toString() ) if (docInCurrentFolder != null) { return path.join(basePath, docInCurrentFolder.name) } else { let docPath, childFolder for (childFolder of folder.folders || []) { docPath = recursivelyFindDocInFolder( path.join(basePath, childFolder.name), docId, childFolder ) if (docPath != null) { return docPath } } return null } } const docPath = recursivelyFindDocInFolder( '/', docId, project.rootFolder[0] ) callback(null, docPath) }, _getAllFolders(projectId, callback) { ProjectGetter.getProjectWithoutDocLines(projectId, (err, project) => { if (err != null) { return callback(err) } if (project == null) { return callback(new Errors.NotFoundError('no project')) } ProjectEntityHandler._getAllFoldersFromProject(project, callback) }) }, _getAllFoldersFromProject(project, callback) { const folders = {} function processFolder(basePath, folder) { folders[basePath] = folder for (const childFolder of folder.folders || []) { if (childFolder.name != null) { processFolder(path.join(basePath, childFolder.name), childFolder) } } } processFolder('/', project.rootFolder[0]) callback(null, folders) }, } module.exports = ProjectEntityHandler module.exports.promises = promisifyAll(ProjectEntityHandler, { multiResult: { getAllEntities: ['docs', 'files'], getAllEntitiesFromProject: ['docs', 'files'], getDoc: ['lines', 'rev', 'version', 'ranges'], }, })
overleaf/web/app/src/Features/Project/ProjectEntityHandler.js/0
{ "file_path": "overleaf/web/app/src/Features/Project/ProjectEntityHandler.js", "repo_id": "overleaf", "token_count": 3101 }
485
const { User } = require('../../models/User') module.exports = { getReferedUsers(userId, callback) { const projection = { refered_users: 1, refered_user_count: 1 } User.findById(userId, projection, function (err, user) { if (err) { return callback(err) } const referedUsers = user.refered_users || [] const referedUserCount = user.refered_user_count || referedUsers.length callback(null, referedUsers, referedUserCount) }) }, }
overleaf/web/app/src/Features/Referal/ReferalHandler.js/0
{ "file_path": "overleaf/web/app/src/Features/Referal/ReferalHandler.js", "repo_id": "overleaf", "token_count": 185 }
486
/* eslint-disable max-len, */ // TODO: This file was created by bulk-decaffeinate. // Fix any style issues and re-enable lint. /* * decaffeinate suggestions: * DS102: Remove unnecessary code created because of implicit returns * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ const HomeController = require('./HomeController') const UniversityController = require('./UniversityController') module.exports = { apply(webRouter, apiRouter) { webRouter.get('/', HomeController.index) webRouter.get('/home', HomeController.home) webRouter.get( '/planned_maintenance', HomeController.externalPage('planned_maintenance', 'Planned Maintenance') ) webRouter.get( '/track-changes-and-comments-in-latex', HomeController.externalPage('review-features-page', 'Review features') ) webRouter.get( '/dropbox', HomeController.externalPage('dropbox', 'Dropbox and ShareLaTeX') ) webRouter.get('/university', UniversityController.getIndexPage) return webRouter.get('/university/*', UniversityController.getPage) }, }
overleaf/web/app/src/Features/StaticPages/StaticPagesRouter.js/0
{ "file_path": "overleaf/web/app/src/Features/StaticPages/StaticPagesRouter.js", "repo_id": "overleaf", "token_count": 382 }
487
/* eslint-disable camelcase, node/handle-callback-err, max-len, no-unused-vars, */ // TODO: This file was created by bulk-decaffeinate. // Fix any style issues and re-enable lint. /* * decaffeinate suggestions: * DS102: Remove unnecessary code created because of implicit returns * DS207: Consider shorter variations of null checks * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ const { promisify } = require('util') const { Subscription } = require('../../models/Subscription') const { DeletedSubscription } = require('../../models/DeletedSubscription') const logger = require('logger-sharelatex') require('./GroupPlansData') // make sure dynamic group plans are loaded const SubscriptionLocator = { getUsersSubscription(user_or_id, callback) { const user_id = SubscriptionLocator._getUserId(user_or_id) return Subscription.findOne( { admin_id: user_id }, function (err, subscription) { logger.log({ user_id }, 'got users subscription') return callback(err, subscription) } ) }, getUserIndividualSubscription(user_or_id, callback) { const user_id = SubscriptionLocator._getUserId(user_or_id) return Subscription.findOne( { admin_id: user_id, groupPlan: false }, function (err, subscription) { logger.log({ user_id }, 'got users individual subscription') return callback(err, subscription) } ) }, getManagedGroupSubscriptions(user_or_id, callback) { if (callback == null) { callback = function (error, managedSubscriptions) {} } const user_id = SubscriptionLocator._getUserId(user_or_id) return Subscription.find({ manager_ids: user_or_id, groupPlan: true, }) .populate('admin_id') .exec(callback) }, getMemberSubscriptions(user_or_id, callback) { const user_id = SubscriptionLocator._getUserId(user_or_id) return Subscription.find({ member_ids: user_id }) .populate('admin_id') .exec(callback) }, getSubscription(subscription_id, callback) { return Subscription.findOne({ _id: subscription_id }, callback) }, getSubscriptionByMemberIdAndId(user_id, subscription_id, callback) { return Subscription.findOne( { member_ids: user_id, _id: subscription_id }, { _id: 1 }, callback ) }, getGroupSubscriptionsMemberOf(user_id, callback) { return Subscription.find( { member_ids: user_id }, { _id: 1, planCode: 1 }, callback ) }, getGroupsWithEmailInvite(email, callback) { return Subscription.find({ invited_emails: email }, callback) }, getGroupWithV1Id(v1TeamId, callback) { return Subscription.findOne({ 'overleaf.id': v1TeamId }, callback) }, getUserDeletedSubscriptions(userId, callback) { DeletedSubscription.find({ 'subscription.admin_id': userId }, callback) }, getDeletedSubscription(subscriptionId, callback) { DeletedSubscription.findOne( { 'subscription._id': subscriptionId, }, callback ) }, _getUserId(user_or_id) { if (user_or_id != null && user_or_id._id != null) { return user_or_id._id } else if (user_or_id != null) { return user_or_id } }, } SubscriptionLocator.promises = { getUsersSubscription: promisify(SubscriptionLocator.getUsersSubscription), getUserIndividualSubscription: promisify( SubscriptionLocator.getUserIndividualSubscription ), getManagedGroupSubscriptions: promisify( SubscriptionLocator.getManagedGroupSubscriptions ), getMemberSubscriptions: promisify(SubscriptionLocator.getMemberSubscriptions), getSubscription: promisify(SubscriptionLocator.getSubscription), getSubscriptionByMemberIdAndId: promisify( SubscriptionLocator.getSubscriptionByMemberIdAndId ), getGroupSubscriptionsMemberOf: promisify( SubscriptionLocator.getGroupSubscriptionsMemberOf ), getGroupsWithEmailInvite: promisify( SubscriptionLocator.getGroupsWithEmailInvite ), getGroupWithV1Id: promisify(SubscriptionLocator.getGroupWithV1Id), getUserDeletedSubscriptions: promisify( SubscriptionLocator.getUserDeletedSubscriptions ), getDeletedSubscription: promisify(SubscriptionLocator.getDeletedSubscription), } module.exports = SubscriptionLocator
overleaf/web/app/src/Features/Subscription/SubscriptionLocator.js/0
{ "file_path": "overleaf/web/app/src/Features/Subscription/SubscriptionLocator.js", "repo_id": "overleaf", "token_count": 1543 }
488