text
stringlengths
1
2.83M
id
stringlengths
16
152
metadata
dict
__index_level_0__
int64
0
949
import { TestResultError, TestSession, Logger } from '@web/test-runner-core'; import { gray, green, red } from 'nanocolors'; import * as diff from 'diff'; import { getFailedOnBrowsers } from './utils/getFailedOnBrowsers.js'; import { getFlattenedTestResults } from './utils/getFlattenedTestResults.js'; function renderDiff(actual: string, expected: string) { function cleanUp(line: string) { if (line[0] === '+') { return green(line); } if (line[0] === '-') { return red(line); } if (line.match(/@@/)) { return null; } if (line.match(/\\ No newline/)) { return null; } return line; } const diffMsg = diff .createPatch('string', actual, expected) .split('\n') .splice(4) .map(cleanUp) .filter(l => !!l) .join('\n'); return `${green('+ expected')} ${red('- actual')}\n\n${diffMsg}`; } export function formatError(error: TestResultError) { const strings: string[] = []; const { name, message = 'Unknown error' } = error; const errorMsg = name ? `${name}: ${message}` : message; const showDiff = typeof error.expected === 'string' && typeof error.actual === 'string'; strings.push(red(errorMsg)); if (showDiff) { strings.push(`${renderDiff(error.actual!, error.expected!)}\n`); } if (error.stack) { if (showDiff) { const dedented = error.stack .split('\n') .map(s => s.trim()) .join('\n'); strings.push(gray(dedented)); } else { strings.push(gray(error.stack)); } } if (!error.expected && !error.stack) { strings.push(red(error.message || 'Unknown error')); } return strings.join('\n'); } export function reportTestsErrors( logger: Logger, allBrowserNames: string[], favoriteBrowser: string, failedSessions: TestSession[], ) { const testErrorsPerBrowser = new Map<string, Map<string, TestResultError>>(); for (const session of failedSessions) { if (session.testResults) { const flattenedTests = getFlattenedTestResults(session.testResults); for (const test of flattenedTests) { if (test.error) { let testErrorsForBrowser = testErrorsPerBrowser.get(test.name); if (!testErrorsForBrowser) { testErrorsForBrowser = new Map<string, TestResultError>(); testErrorsPerBrowser.set(test.name, testErrorsForBrowser); } if (test.error) { testErrorsForBrowser.set(session.browser.name, test.error); } } } } } if (testErrorsPerBrowser.size > 0) { for (const [name, errorsForBrowser] of testErrorsPerBrowser) { const failedBrowsers = Array.from(errorsForBrowser.keys()); const error = errorsForBrowser.get(favoriteBrowser) ?? errorsForBrowser.get(failedBrowsers[0])!; const failedOn = getFailedOnBrowsers(allBrowserNames, failedBrowsers); logger.log(` ❌ ${name}${failedOn}`); logger.group(); logger.group(); logger.group(); logger.log(formatError(error)); logger.groupEnd(); logger.groupEnd(); logger.groupEnd(); logger.log(''); } } }
modernweb-dev/web/packages/test-runner/src/reporter/reportTestsErrors.ts/0
{ "file_path": "modernweb-dev/web/packages/test-runner/src/reporter/reportTestsErrors.ts", "repo_id": "modernweb-dev", "token_count": 1258 }
238
#!/usr/bin/env node const { readdirSync, existsSync, readFileSync, writeFileSync } = require('fs'); const getDirectories = source => readdirSync(source, { withFileTypes: true }) .filter(pathMeta => pathMeta.isDirectory()) .map(pathMeta => pathMeta.name); function readPackageJsonDeps(filePath) { if (existsSync(filePath)) { const jsonData = JSON.parse(readFileSync(filePath, 'utf-8')); const merged = { ...jsonData.dependencies, ...jsonData.devDependencies }; const result = {}; Object.keys(merged).forEach(dep => { if (merged[dep] && !merged[dep].includes('file:')) { result[dep] = merged[dep]; } }); return result; } return {}; } function readPackageJsonNameVersion(filePath) { if (existsSync(filePath)) { const jsonData = JSON.parse(readFileSync(filePath, 'utf-8')); const result = {}; result[jsonData.name] = `^${jsonData.version}`; return result; } return {}; } function compareVersions(versionsA, versionsB) { let output = {}; const newVersions = { ...versionsA }; Object.keys(versionsB).forEach(dep => { if (versionsA[dep] && versionsB[dep] && versionsA[dep] !== versionsB[dep]) { output[dep] = [versionsA[dep], versionsB[dep]]; } if (!newVersions[dep]) { newVersions[dep] = versionsB[dep]; } }); return { output, newVersions, }; } let currentVersions = readPackageJsonDeps('./package.json'); let endReturn = 0; // find all versions in the monorepo for (const subPackage of getDirectories('./packages')) { const filePath = `./packages/${subPackage}/package.json`; currentVersions = { ...currentVersions, ...readPackageJsonNameVersion(filePath) }; } const fixes = new Map(); // lint all versions in packages for (const subPackage of getDirectories('./packages')) { const filePath = `./packages/${subPackage}/package.json`; const subPackageVersions = readPackageJsonDeps(filePath); const { output, newVersions } = compareVersions(currentVersions, subPackageVersions); currentVersions = { ...newVersions }; const entries = Object.entries(output); if (entries.length) { fixes.set(filePath, output); console.log(`Version mismatches found in "${filePath}":`); console.log( entries.reduce( (acc, [dep, [should, is]]) => `${acc} - "${dep}" should be "${should}" but is "${is}"\n`, '', ), ); console.log(); endReturn = 1; } } function fixJSON(filePath, changes) { const json = JSON.parse(readFileSync(filePath, 'utf8')); for (const [dep, [should]] of Object.entries(changes)) { json.dependencies[dep] = should; } writeFileSync(filePath, JSON.stringify(json, null, 2)); } if (fixes.size && process.argv.includes('--fix')) { for (const [filePath, changes] of fixes) { fixJSON(filePath, changes); } console.log('package.json files updated, run `npm install`'); } if (endReturn === 0) { console.log('All versions are aligned 💪'); } process.exit(endReturn);
modernweb-dev/web/scripts/lint-versions.js/0
{ "file_path": "modernweb-dev/web/scripts/lint-versions.js", "repo_id": "modernweb-dev", "token_count": 1086 }
239
<svg xmlns="http://www.w3.org/2000/svg" height="480" width="640" viewBox="0 0 640 480"> <g fill-rule="evenodd" stroke-width="1pt"> <path fill="#d52b1e" d="M0 0h640v480H0z"/> <g fill="#fff"> <path d="M170 194.997h299.996v89.997H170z"/> <path d="M275 89.997h89.996v299.996H275z"/> </g> </g> </svg>
odota/web/public/assets/images/flags/ch.svg/0
{ "file_path": "odota/web/public/assets/images/flags/ch.svg", "repo_id": "odota", "token_count": 163 }
240
<svg xmlns="http://www.w3.org/2000/svg" height="480" width="640" viewBox="0 0 640 480"> <path fill="#c60c30" d="M0 0h640.1v480H0z"/> <path fill="#fff" d="M205.714 0h68.57v480h-68.57z"/> <path fill="#fff" d="M0 205.714h640.1v68.57H0z"/> </svg>
odota/web/public/assets/images/flags/dk.svg/0
{ "file_path": "odota/web/public/assets/images/flags/dk.svg", "repo_id": "odota", "token_count": 123 }
241
<svg xmlns="http://www.w3.org/2000/svg" height="480" width="640" viewBox="0 0 640 480"> <defs> <clipPath id="a"> <path fill-opacity=".67" d="M-78.015 32h640v480h-640z"/> </clipPath> </defs> <g fill-rule="evenodd" clip-path="url(#a)" transform="translate(78.02 -32)" stroke-width="0"> <path fill="#fff" d="M-78.015 32h663.91v480h-663.91z"/> <path d="M-76.033 218.67h185.9V32h106.23v186.67h371.79v106.67h-371.79v186.67h-106.23V325.34h-185.9V218.67z" fill="#003897"/> <path d="M-76.033 245.33h212.45V32h53.113v213.33h398.35v53.333H189.53v213.33h-53.113v-213.33h-212.45V245.33z" fill="#d72828"/> </g> </svg>
odota/web/public/assets/images/flags/fo.svg/0
{ "file_path": "odota/web/public/assets/images/flags/fo.svg", "repo_id": "odota", "token_count": 325 }
242
<svg xmlns="http://www.w3.org/2000/svg" height="480" width="640" viewBox="0 0 640 480"> <defs> <clipPath id="a"> <path fill-opacity=".67" d="M0-48h640v480H0z"/> </clipPath> </defs> <g fill-rule="evenodd" clip-path="url(#a)" transform="translate(0 48)" stroke-width="1pt"> <path fill="red" d="M0-128h640V85.33H0z"/> <path fill="#fff" d="M0 85.333h640v35.556H0z"/> <path fill="#009" d="M0 120.89h640v142.22H0z"/> <path fill="#fff" d="M0 263.11h640v35.556H0z"/> <path fill="#090" d="M0 298.67h640V512H0z"/> </g> </svg>
odota/web/public/assets/images/flags/gm.svg/0
{ "file_path": "odota/web/public/assets/images/flags/gm.svg", "repo_id": "odota", "token_count": 275 }
243
<svg xmlns="http://www.w3.org/2000/svg" height="480" width="640" viewBox="0 0 640 480"> <g fill-rule="evenodd" stroke-width="1pt"> <path fill="#e70011" d="M0 0h639.958v248.947H0z"/> <path fill="#fff" d="M0 240h639.958v240H0z"/> </g> </svg>
odota/web/public/assets/images/flags/id.svg/0
{ "file_path": "odota/web/public/assets/images/flags/id.svg", "repo_id": "odota", "token_count": 124 }
244
<svg xmlns="http://www.w3.org/2000/svg" height="480" width="640" viewBox="0 0 640 480"> <g fill-rule="evenodd" transform="matrix(.64143 0 0 .96773 0 0)" stroke-width="1pt"> <rect transform="matrix(.93865 0 0 .69686 0 0)" rx="0" ry="0" width="1063" height="708.66" fill="#007308"/> <rect transform="matrix(.93865 0 0 .69686 0 0)" rx="0" ry="0" width="1063" y="475.56" height="236.22" fill="#bf0000"/> <path fill="#ffb300" d="M0 0h997.77v164.61H0z"/> </g> </svg>
odota/web/public/assets/images/flags/lt.svg/0
{ "file_path": "odota/web/public/assets/images/flags/lt.svg", "repo_id": "odota", "token_count": 215 }
245
<svg xmlns="http://www.w3.org/2000/svg" height="480" width="640" viewBox="0 0 640 480"> <defs> <clipPath id="a"> <path fill-opacity=".67" d="M-53.421 0h682.67v512h-682.67z"/> </clipPath> </defs> <g clip-path="url(#a)" transform="translate(50.082) scale(.9375)"> <g fill-rule="evenodd" stroke-width="1pt"> <path fill="#006aa7" d="M-121.103.302h256V205.1h-256zM-121.103 307.178h256v204.8h-256z"/> <path fill="#fecc00" d="M-121.103 204.984h256v102.4h-256z"/> <path fill="#fecc00" d="M133.843.01h102.4v511.997h-102.4z"/> <path fill="#fecc00" d="M232.995 205.013h460.798v102.4H232.995z"/> <path fill="#006aa7" d="M236.155 307.208h460.797v204.799H236.155zM236.155.302h460.797V205.1H236.155z"/> </g> </g> </svg>
odota/web/public/assets/images/flags/se.svg/0
{ "file_path": "odota/web/public/assets/images/flags/se.svg", "repo_id": "odota", "token_count": 391 }
246
<svg xmlns="http://www.w3.org/2000/svg" height="480" width="640" viewBox="0 0 640 480"> <defs> <clipPath id="a"> <path fill-opacity=".67" d="M0 0h682.67v512H0z"/> </clipPath> </defs> <g fill-rule="evenodd" clip-path="url(#a)" transform="scale(.9375)" stroke-width="1pt"> <path fill="#de2110" d="M0 0h768v512H0z"/> <path fill="#08399c" d="M0 0h385.69v256H0z"/> <path fill="#fff" d="M282.098 178.555l-47.332-9.733 10.083 47.26-36.133-32.088-14.904 45.97-15.244-45.867-35.886 32.367 9.733-47.332-47.26 10.073 32.088-36.123-45.969-14.904 45.855-15.244-32.356-35.89 47.332 9.73-10.073-47.262 36.123 32.093 14.904-45.97 15.244 45.859 35.886-32.36-9.733 47.335 47.26-10.08-32.088 36.132 45.97 14.893-45.856 15.244z"/> <path fill="#005387" d="M238.47 174.924l-14.935 7.932-14.57 8.608-16.918-.583-16.919.198-14.36-8.941-14.759-8.275-7.953-14.906-8.631-14.52.574-16.874-.188-16.883 8.965-14.32 8.298-14.716 14.935-7.934 14.57-8.607 16.919.58 16.928-.193 14.362 8.94 14.747 8.275 7.953 14.901 8.632 14.52-.574 16.874.187 16.883-8.965 14.323z"/> <path d="M244.637 128.28c0 28.646-23.222 51.867-51.866 51.867s-51.867-23.221-51.867-51.866 23.222-51.866 51.867-51.866 51.866 23.221 51.866 51.866z" fill="#fff"/> </g> </svg>
odota/web/public/assets/images/flags/tw.svg/0
{ "file_path": "odota/web/public/assets/images/flags/tw.svg", "repo_id": "odota", "token_count": 669 }
247
<svg xmlns="http://www.w3.org/2000/svg" height="480" width="640" viewBox="0 0 640 480"> <g fill-rule="evenodd" stroke-width="1pt"> <path fill="#fff" d="M0-.001h640v480H0z"/> <path fill="#00267f" d="M0-.001h213.337v480H0z"/> <path fill="#f31830" d="M426.662-.001H640v480H426.662z"/> </g> </svg>
odota/web/public/assets/images/flags/wf.svg/0
{ "file_path": "odota/web/public/assets/images/flags/wf.svg", "repo_id": "odota", "token_count": 147 }
248
import { isRadiant, } from '../utility'; export default function transformPlayerMatches(fields) { return (response) => { // Check if player match parameters have an included account id, and add an extra variable which specifies if that player id is in the same team if (fields.included_account_id && !Array.isArray(fields.included_account_id)) { return response.map((match) => { let sameTeam = false; const found = Object.entries(match.heroes).find(([key, val]) => val.account_id && val.account_id.toString() === fields.included_account_id); const partnerHero = {...found?.[1], player_slot: Number(found?.[0])}; console.log(partnerHero, match); if (isRadiant(partnerHero.player_slot) === isRadiant(match.player_slot)) { sameTeam = true; } return { ...match, sameTeam }; }); } return response; }; }
odota/web/src/actions/transformPlayerMatches.js/0
{ "file_path": "odota/web/src/actions/transformPlayerMatches.js", "repo_id": "odota", "token_count": 331 }
249
import Api from './Api'; export default Api;
odota/web/src/components/Api/index.js/0
{ "file_path": "odota/web/src/components/Api/index.js", "repo_id": "odota", "token_count": 17 }
250
/* eslint-disable import/no-dynamic-require,global-require */ import React from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import Helmet from 'react-helmet'; import styled from 'styled-components'; import { sum, abbreviateNumber, getOrdinal, rankTierToString, } from '../../utility'; import { getDistributions } from '../../actions'; import Table from '../Table'; // import Warning from '../Alerts'; import TabBar from '../TabBar'; import Heading from '../Heading'; import { DistributionGraph } from '../Visualizations'; import constants from '../constants'; import DistributionsSkeleton from '../Skeletons/DistributionsSkeleton'; const CountryDiv = styled.div` & img { vertical-align: sub; margin-right: 7px; height: 24px; width: 32px; box-shadow: 0 0 5px ${constants.defaultPrimaryColor}; } & span { vertical-align: super; height: 24px; } `; class RequestLayer extends React.Component { static propTypes = { loading: PropTypes.bool, match: PropTypes.shape({ params: PropTypes.shape({ info: PropTypes.string, }), }), dispatchDistributions: PropTypes.func, data: PropTypes.shape({}), strings: PropTypes.shape({}), }; componentDidMount() { this.props.dispatchDistributions(); } render() { const { strings, loading } = this.props; const countryMmrColumns = [{ displayName: strings.th_rank, field: '', displayFn: (row, col, field, i) => getOrdinal(i + 1), }, { displayName: strings.th_country, field: 'common', sortFn: true, displayFn: (row) => { const code = row.loccountrycode.toLowerCase(); const image = `/assets/images/flags/${code}.svg`; let name = row.common; // Fill missed flags and country names if (code === 'yu') { name = 'Yugoslavia'; } else if (code === 'fx') { name = 'Metropolitan France'; } else if (code === 'tp') { name = 'East Timor'; } else if (code === 'zr') { name = 'Zaire'; } else if (code === 'bq') { name = 'Caribbean Netherlands'; } else if (code === 'sh') { name = 'Saint Helena, Ascension and Tristan da Cunha'; } return ( <CountryDiv> <img src={image} alt={`Flag for ${name}`} /> <span> {name} </span> </CountryDiv> ); }, }, { displayName: strings.th_players, field: 'count', sortFn: true, }, { displayName: strings.th_mmr, field: 'avg', sortFn: true, }]; const getPage = (data, key) => { let rows = data && data[key] && data[key].rows; if (key === 'ranks') { // Translate the rank integers into names rows = rows.map(r => ({ ...r, bin_name: rankTierToString(r.bin_name) })); } return ( <div> <Heading className="top-heading with-tabbar" title={strings[`distributions_heading_${key}`]} subtitle={` ${data[key] && data[key].rows && abbreviateNumber(data[key].rows.map(row => row.count).reduce(sum, 0))} ${strings.th_players} `} icon=" " twoLine /> {(key === 'mmr' || key === 'ranks') ? <DistributionGraph data={rows} xTickInterval={key === 'ranks' ? 4 : null} /> : <Table data={data && data[key] && data[key].rows} columns={countryMmrColumns} />} </div>); }; const distributionsPages = [ { name: strings.distributions_tab_ranks, key: 'ranks', content: getPage, route: '/distributions/ranks', }, ]; const info = this.props.match.params.info || 'ranks'; const page = distributionsPages.find(_page => (_page.key || _page.name.toLowerCase()) === info); return loading ? <DistributionsSkeleton /> : ( <div> <Helmet title={page ? page.name : strings.distributions_tab_ranks} /> <TabBar info={info} tabs={distributionsPages} /> {page && page.content(this.props.data, info)} </div>); } } const mapStateToProps = state => ({ data: state.app.distributions.data, loading: state.app.distributions.loading, strings: state.app.strings, }); const mapDispatchToProps = dispatch => ({ dispatchDistributions: () => dispatch(getDistributions()), }); export default connect(mapStateToProps, mapDispatchToProps)(RequestLayer);
odota/web/src/components/Distributions/index.jsx/0
{ "file_path": "odota/web/src/components/Distributions/index.jsx", "repo_id": "odota", "token_count": 1978 }
251
/* export default function redrawGraphs(rows, field, yAxis) { const hasSum = rows[0] && rows[0].sum; const hasAvg = rows[0] && rows[0].avg; c3.generate({ bindto: '#donut', data: { type: 'donut', columns: hasSum ? rows.map(row => [row[field], row.sum]) : [], empty: { label: { text: strings.explorer_chart_unavailable } }, }, donut: { title: hasSum ? `${strings.th_sum} - ${yAxis} - ${field}` : '', }, legend: { show: false, }, }); rows.sort((a, b) => b.sum - a.sum); c3.generate({ bindto: '#bar', data: { type: 'bar', columns: [ hasSum ? [strings.th_sum].concat(rows.map(row => row.sum)) : null, hasAvg ? [strings.th_average].concat(rows.map(row => row.avg)) : null, ].filter(Boolean), empty: { label: { text: strings.explorer_chart_unavailable } }, }, axis: { x: { type: 'category', categories: rows.map(row => row[field]), tick: { // format: i => i, }, label: field, }, y: { label: yAxis, }, }, tooltip: { format: { // title: i => i, }, }, }); rows.sort((a, b) => a[field] - b[field]); c3.generate({ bindto: '#timeseries', data: { type: 'spline', columns: [ hasAvg ? [strings.th_average].concat(rows.map(row => row.avg)) : null, ].filter(Boolean), empty: { label: { text: strings.explorer_chart_unavailable } }, }, axis: { x: { type: 'category', categories: rows.map(row => row[field]), label: field, }, y: { label: yAxis, }, }, }); } */
odota/web/src/components/Explorer/redrawGraphs.js/0
{ "file_path": "odota/web/src/components/Explorer/redrawGraphs.js", "repo_id": "odota", "token_count": 842 }
252
import React from 'react'; import PropTypes from 'prop-types'; import { Tooltip } from '@material-ui/core'; import { Link } from 'react-router-dom'; import { connect } from 'react-redux'; import RaisedButton from 'material-ui/RaisedButton'; import { StyledDiv, TwoLineDiv } from './Styled'; const Heading = ({ title = '', titleTo, icon, subtitle, buttonLabel, buttonTo, buttonIcon, twoLine, info, winner, strings, className }) => { const DivToUse = twoLine ? TwoLineDiv : StyledDiv; return ( <DivToUse className={className}> <span className="title"> {icon} {titleTo ? ( <Link to={titleTo}> {title.trim()} </Link> ) : title.trim()} </span> <span className="subtitle"> {subtitle} <Tooltip title={info}> <span className="info" style={{ display: info ? 'inline' : 'none' }}> (?) </span> </Tooltip> </span> {winner && <span className="winner"> {strings.th_winner} </span> } { buttonLabel && buttonTo && buttonIcon ? <span className="sponsor-button"> <RaisedButton label={buttonLabel} icon={<img src={buttonIcon} alt="" />} href={buttonTo} target="_blank" rel="noopener noreferrer" primary /> </span> : <div /> } </DivToUse>); }; const { string, element, oneOfType, bool, shape, } = PropTypes; Heading.propTypes = { title: string, titleTo: string, icon: oneOfType([ string, element, ]), subtitle: oneOfType([ shape({}), string, ]), twoLine: bool, info: string, buttonLabel: string, buttonTo: string, buttonIcon: string, winner: bool, strings: shape({}), }; const mapStateToProps = state => ({ strings: state.app.strings, }); export default connect(mapStateToProps)(Heading);
odota/web/src/components/Heading/Heading.jsx/0
{ "file_path": "odota/web/src/components/Heading/Heading.jsx", "repo_id": "odota", "token_count": 884 }
253
import React from 'react'; import { string, shape, func, bool, arrayOf, number } from 'prop-types'; import { connect } from 'react-redux'; import { getHeroDurations } from '../../actions'; import { HistogramGraph } from '../Visualizations'; import DurationsSkeleton from '../Skeletons/DurationsSkeleton'; class Durations extends React.Component { static propTypes = { match: shape({ params: shape({ heroId: string, }), }), onGetHeroDurations: func, isLoading: bool, data: arrayOf(shape({ duration_bin: number, gamed_played: number, wins: number, })), strings: shape({}), } componentDidMount() { const { onGetHeroDurations, match } = this.props; if (match.params && match.params.heroId) { onGetHeroDurations(match.params.heroId); } } render() { const { isLoading, data, strings } = this.props; if (isLoading) { return <DurationsSkeleton />; } const result = data.map(item => ({ win: item.wins, games: item.games_played, x: (item.duration_bin / 60), })).sort((a, b) => a.x - b.x); return ( <div> <HistogramGraph columns={result} xAxisLabel={strings.hero_duration_x_axis} /> </div> ); } } const mapDispatchToProps = { onGetHeroDurations: getHeroDurations, }; const mapStateToProps = ({ app }) => ({ isLoading: app.heroDurations.loading, data: Object.values(app.heroDurations.data), strings: app.strings, }); export default connect(mapStateToProps, mapDispatchToProps)(Durations);
odota/web/src/components/Hero/Durations.jsx/0
{ "file_path": "odota/web/src/components/Hero/Durations.jsx", "repo_id": "odota", "token_count": 604 }
254
import React from 'react'; import styled from 'styled-components'; import { connect } from 'react-redux'; import { IconOpenSource, IconStatsBars, IconWand } from '../Icons'; import constants from '../constants'; import { HomePageProps } from './Home'; const StyledDiv = styled.div` margin: 50px auto 0; text-align: center; max-width: 1920px; padding: 50px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); & .whyList { display: flex; justify-content: space-around; @media only screen and (max-width: 768px) { flex-direction: column; } & .whyElement { max-width: 25%; box-sizing: border-box; padding: 0 0.5rem; @media only screen and (max-width: 768px) { max-width: 100%; margin-bottom: 30px; } & svg { width: 85px; height: 85px; fill: ${constants.colorBlue}; } & .headline { font-size: 24px; line-height: 2; } & .description { font-weight: ${constants.fontWeightLight}; line-height: 1.5; color: rgb(190, 190, 190); } } } `; const Why = ({ strings }: HomePageProps) => ( <StyledDiv> <div className="whyList"> <div className="whyElement"> <IconOpenSource /> <div className="headline"> {strings.home_opensource_title} </div> <div className="description"> {strings.home_opensource_desc} </div> </div> <div className="whyElement"> <IconStatsBars /> <div className="headline"> {strings.home_indepth_title} </div> <div className="description"> {strings.home_indepth_desc} </div> </div> <div className="whyElement"> <IconWand /> <div className="headline"> {strings.home_free_title} </div> <div className="description"> {strings.home_free_desc} </div> </div> </div> </StyledDiv> ); const mapStateToProps = (state: any) => ({ strings: state.app.strings, }); export default connect(mapStateToProps)(Why);
odota/web/src/components/Home/Why.tsx/0
{ "file_path": "odota/web/src/components/Home/Why.tsx", "repo_id": "odota", "token_count": 980 }
255
import React from 'react'; export default props => ( <svg {...props} viewBox="0 0 300 300"> <circle cx="150" cy="150" r="130" stroke="black" strokeWidth="40" /> </svg> );
odota/web/src/components/Icons/Dot.jsx/0
{ "file_path": "odota/web/src/components/Icons/Dot.jsx", "repo_id": "odota", "token_count": 68 }
256
import React from 'react'; export default props => ( <svg {...props} viewBox="0 0 300 300"> <rect x="138" y="116.5" transform="matrix(0.7071 0.7071 -0.7071 0.7071 145.5402 -72.8379)" width="45.5" height="45.5" /> <rect x="52.3" y="141.6" transform="matrix(0.7071 0.7071 -0.7071 0.7071 181.0483 12.848)" width="45.5" height="166.7" /> <rect x="150" y="0" width="21.4" height="42.8" /> <rect x="233.3" y="34.5" transform="matrix(-0.7071 -0.7071 0.7071 -0.7071 377.0973 268.0186)" width="21.4" height="42.8" /> <rect x="66.6" y="34.5" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -16.9125 71.0886)" width="21.4" height="42.8" /> <rect x="233.3" y="201.2" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -85.918 237.758)" width="21.4" height="42.8" /> <rect x="257.2" y="128.5" width="42.8" height="21.4" /> </svg> );
odota/web/src/components/Icons/Wand.jsx/0
{ "file_path": "odota/web/src/components/Icons/Wand.jsx", "repo_id": "odota", "token_count": 409 }
257
import React from 'react'; import { connect } from 'react-redux'; import PropTypes from 'prop-types'; import Heading from '../../Heading'; import Heatmap from '../../Heatmap'; import Table from '../../Table'; import { unpackPositionData } from '../../../utility'; import mcs from '../matchColumns'; import { StyledFlexContainer, StyledFlexElement, StyledFlexElementFullWidth } from '../StyledMatch'; import Graph from './Graph'; import config from '../../../config'; class Laning extends React.Component { static propTypes = { match: PropTypes.shape({}), strings: PropTypes.shape({}), sponsorURL: PropTypes.string, sponsorIcon: PropTypes.string, } constructor(props) { super(props); this.state = { selectedPlayer: 0, }; } setSelectedPlayer = (playerSlot) => { this.setState({ ...this.state, selectedPlayer: playerSlot }); }; defaultSort = (r1, r2) => { if (r1.isRadiant !== r2.isRadiant) { return 1; } return r1.lane - r2.lane; } render() { const { match, strings, sponsorURL, sponsorIcon, } = this.props; const { laningColumns } = mcs(strings); const tableData = [...match.players].sort(this.defaultSort); return ( <StyledFlexContainer> <StyledFlexElementFullWidth> <Heading title={strings.heading_laning} /> <Table data={tableData} columns={laningColumns(this.state, this.setSelectedPlayer)} /> </StyledFlexElementFullWidth> <StyledFlexElement> <Heading title={strings.th_map} buttonLabel={config.VITE_ENABLE_GOSUAI ? strings.gosu_laning : null} buttonTo={`${sponsorURL}Laning`} buttonIcon={sponsorIcon} /> <Heatmap width={400} startTime={match.start_time} points={unpackPositionData((match.players.find(player => player.player_slot === this.state.selectedPlayer) || {}).lane_pos)} /> </StyledFlexElement> <StyledFlexElement> <Graph match={match} strings={strings} selectedPlayer={this.state.selectedPlayer} /> </StyledFlexElement> </StyledFlexContainer>); } } const mapStateToProps = state => ({ strings: state.app.strings, }); export default connect(mapStateToProps)(Laning);
odota/web/src/components/Match/Laning/index.jsx/0
{ "file_path": "odota/web/src/components/Match/Laning/index.jsx", "repo_id": "odota", "token_count": 914 }
258
import React from 'react'; import PropTypes from 'prop-types'; import styled from 'styled-components'; import { gameCoordToUV, getWardSize } from '../../../utility'; import DotaMap from '../../DotaMap'; import constants from '../../constants'; const hoverMapStyle = { height: 300, position: 'absolute', bottom: '25px', left: '25px', border: '5px solid rgb(21, 23, 27)', outline: '1px solid #0E0E0E', }; const Styled = styled.div` .tooltipContainer { display: flex; align-items: center; flex-direction: row; padding: 10px; margin: -8px -12px; & > * { margin: 0 5px; &:first-child { margin-left: 0; } &:last-child { margin-right: 0; } } & > div { margin: 0; color: ${constants.colorMutedLight}; } } .radiantWardTooltip { border-width: 2px !important; border-color: ${constants.colorSuccess} !important; } .direWardTooltip { border-width: 2px !important; border-color: ${constants.colorDanger} !important; } div > img { width: 18px; } `; const wardStyle = (width, log) => { const gamePos = gameCoordToUV(log.entered.x, log.entered.y); const stroke = log.entered.player_slot < 5 ? constants.colorGreen : constants.colorRed; let fill; let strokeWidth; const wardSize = getWardSize(log.type, width); if (log.type === 'observer') { fill = constants.colorYelorMuted; strokeWidth = 2.5; } else { fill = constants.colorBlueMuted; strokeWidth = 2; } return { position: 'absolute', width: wardSize, height: wardSize, top: ((width / 127) * gamePos.y) - (wardSize / 2), left: ((width / 127) * gamePos.x) - (wardSize / 2), background: fill, borderRadius: '50%', border: `${strokeWidth}px solid ${stroke}`, display: 'flex', alignItems: 'center', justifyContent: 'center', }; }; const wardIcon = (log) => { const side = log.entered.player_slot < 5 ? 'goodguys' : 'badguys'; return `/assets/images/dota2/map/${side}_${log.type}.png`; }; export const WardPin = ({ width, log }) => { const id = `ward-${log.entered.player_slot}-${log.entered.time}`; return ( <Styled> <div style={wardStyle(width, log)} data-tip data-for={id} > <img src={wardIcon(log)} alt={log.type === 'observer' ? 'O' : 'S'} /> </div> </Styled> ); }; WardPin.propTypes = { width: PropTypes.number, log: PropTypes.shape({}) }; const LogHover = (ward, startTime) => ( <div style={hoverMapStyle}> <DotaMap maxWidth={300} width={300} startTime={startTime} > <WardPin key={ward.key} width={300} log={ward} /> </DotaMap> </div> ); export default LogHover;
odota/web/src/components/Match/Vision/LogHover.jsx/0
{ "file_path": "odota/web/src/components/Match/Vision/LogHover.jsx", "repo_id": "odota", "token_count": 1128 }
259
export { default } from './PiePercent';
odota/web/src/components/PiePercent/index.js/0
{ "file_path": "odota/web/src/components/PiePercent/index.js", "repo_id": "odota", "token_count": 11 }
260
import React from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { getPlayerItems } from '../../../../actions'; import Table from '../../../Table'; import Container from '../../../Container'; import playerItemsColumns from './playerItemsColumns'; const Items = ({ data, error, loading, strings, }) => ( <Container title="Items" error={error} loading={loading}> <Table paginated columns={playerItemsColumns(strings)} data={data} /> </Container> ); Items.propTypes = { data: PropTypes.shape({}), error: PropTypes.string, loading: PropTypes.bool, strings: PropTypes.shape({}), }; const getData = (props) => { props.getPlayerItems(props.playerId, props.location.search); }; class RequestLayer extends React.Component { static propTypes = { location: PropTypes.shape({ key: PropTypes.string, }), playerId: PropTypes.string, strings: PropTypes.shape({}), } componentDidMount() { getData(this.props); } componentDidUpdate(prevProps) { if (this.props.playerId !== prevProps.playerId || this.props.location.key !== prevProps.location.key) { getData(this.props); } } render() { return <Items {...this.props} />; } } const mapStateToProps = state => ({ data: state.app.playerItems.data, loading: state.app.playerItems.loading, error: state.app.playerItems.error, strings: state.app.strings, }); const mapDispatchToProps = dispatch => ({ getPlayerItems: (playerId, options) => dispatch(getPlayerItems(playerId, options)), }); export default connect(mapStateToProps, mapDispatchToProps)(RequestLayer);
odota/web/src/components/Player/Pages/Items/Items.jsx/0
{ "file_path": "odota/web/src/components/Player/Pages/Items/Items.jsx", "repo_id": "odota", "token_count": 553 }
261
import React from 'react'; import styled from 'styled-components'; import { connect } from 'react-redux'; import { shape } from 'prop-types'; import { formatTemplateToString } from '../../../../utility'; const fastPlurality = (val, singular, plural) => (val === 1 ? singular : plural); const formatDurationString = (sec, strings) => { const days = Math.floor(sec / 86400); const hours = Math.floor((sec - (days * 86400)) / 3600); const minutes = Math.floor((sec - (days * 86400) - (hours * 3600)) / 60); const seconds = Math.floor((sec - (days * 86400) - (hours * 3600) - (minutes * 60))); return [ formatTemplateToString(fastPlurality(days, strings.time_abbr_d, strings.time_abbr_dd), days), formatTemplateToString(fastPlurality(hours, strings.time_abbr_h, strings.time_abbr_hh), hours), formatTemplateToString(fastPlurality(minutes, strings.time_abbr_m, strings.time_abbr_mm), minutes), formatTemplateToString(fastPlurality(seconds, strings.time_abbr_s, strings.time_abbr_ss), seconds), ].join(' '); }; const Wrapper = styled.div` box-sizing: border-box; margin-bottom: 8px; margin-top: 8px; padding-left: 8px; padding-right: 8px; width: 20%; @media screen and (max-width: 1000px) { width: 25%; } @media screen and (max-width: 850px) { width: 33.333%; } @media screen and (max-width: 560px) { width: 50%; } @media screen and (max-width: 380px) { width: 100%; } `; const Box = styled.div` border-radius: 4px; border: 1px solid rgba(0, 0, 0, .35); overflow: hidden; `; const Header = styled.div` background: rgba(0, 0, 0, .15); font-size: 12px; font-weight: 600; letter-spacing: 1px; line-height: 1; padding: 16px 12px; text-align: center; text-shadow: 0 1px 1px rgba(0, 0, 0, .2); text-transform: uppercase; `; const Value = styled.div` font-size: 12px; line-height: 1; padding: 16px 12px; text-align: center; `; const Card = ({ total, strings }) => ( <Wrapper> <Box> <Header>{strings[`heading_${total.field}`]}</Header> <Value>{total.field === 'duration' ? formatDurationString(total.sum, strings) : Math.floor(total.sum).toLocaleString()}</Value> </Box> </Wrapper> ); Card.propTypes = { total: shape({}), strings: shape({}), }; const mapStateToProps = state => ({ strings: state.app.strings, }); export default connect(mapStateToProps)(Card);
odota/web/src/components/Player/Pages/Totals/Card.jsx/0
{ "file_path": "odota/web/src/components/Player/Pages/Totals/Card.jsx", "repo_id": "odota", "token_count": 905 }
262
import React from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import Helmet from 'react-helmet'; import CircularProgress from 'material-ui/CircularProgress'; import RaisedButton from 'material-ui/RaisedButton'; import TextField from 'material-ui/TextField'; import { postRequest } from '../../actions/requestActions'; class Request extends React.Component { static propTypes = { dispatchPostRequest: PropTypes.func, progress: PropTypes.number, error: PropTypes.string, loading: PropTypes.bool, strings: PropTypes.shape({}), } constructor() { super(); this.state = { matchId: window.location.hash.slice(1) }; } componentDidMount() { if (this.state.matchId) { this.handleSubmit(); } } handleSubmit = () => { const { dispatchPostRequest } = this.props; dispatchPostRequest(this.state.matchId); }; render() { const { progress, error, loading, strings, } = this.props; const progressIndicator = (progress ? <CircularProgress value={progress} mode="determinate" /> : <CircularProgress value={progress} mode="indeterminate" />); return ( <div style={{ textAlign: 'center' }}> <Helmet title={strings.title_request} /> <h1>{strings.request_title}</h1> <TextField id="match_id" floatingLabelText={strings.request_match_id} errorText={error && !loading ? strings.request_error : false} value={this.state.matchId} onChange={e => this.setState({ matchId: e.target.value })} /> <div>{loading ? progressIndicator : <RaisedButton label={strings.request_submit} onClick={this.handleSubmit} />}</div> </div> ); } } const mapStateToProps = (state) => { const { error, loading, progress } = state.app.request; return { error, loading, progress, strings: state.app.strings, }; }; const mapDispatchToProps = dispatch => ({ dispatchPostRequest: matchId => dispatch(postRequest(matchId)), }); export default connect(mapStateToProps, mapDispatchToProps)(Request);
odota/web/src/components/Request/Request.jsx/0
{ "file_path": "odota/web/src/components/Request/Request.jsx", "repo_id": "odota", "token_count": 772 }
263
export { default } from './TabbedContent';
odota/web/src/components/TabbedContent/index.js/0
{ "file_path": "odota/web/src/components/TabbedContent/index.js", "repo_id": "odota", "token_count": 12 }
264
import React from 'react'; import heroes from 'dotaconstants/build/heroes.json'; import { transformations, displayHeroId, subTextStyle, getTeamLogoUrl } from '../../utility'; import { TableLink } from '../Table'; import constants from '../constants'; import { TableRow, TableImage } from './TeamStyled'; import proPlayerImages from './proPlayerImages'; import { FromNowTooltip } from '../Visualizations'; const getPlayerImageUrl = (accountId) => { if (proPlayerImages[accountId]) { return `/assets/images/dota2/players/${accountId}.png`; } return '/assets/images/dota2/players/portrait.png'; }; export const matchColumns = strings => [{ displayName: strings.th_match_id, field: 'match_id', sortFn: true, displayFn: (row, col, field) => ( <div> <TableLink to={`/matches/${field}`}>{field}</TableLink> <div style={{ ...subTextStyle }}> <div style={{ float: 'left' }}> <FromNowTooltip timestamp={row.start_time + row.duration} /> </div> <span style={{ marginLeft: 1, marginRight: 1 }}>/</span> {row.league_name} </div> </div> ), }, { displayName: strings.th_duration, tooltip: strings.tooltip_duration, field: 'duration', sortFn: true, displayFn: transformations.duration, }, { displayName: strings.th_result, displayFn: (row) => { const won = row.radiant_win === row.radiant; const string = won ? strings.td_win : strings.td_loss; const textColor = won ? constants.colorGreen : constants.colorRed; return ( <span style={{ color: textColor }}>{string}</span> ); }, }, { displayName: strings.th_opposing_team, field: 'opposing_team_name', sortFn: true, displayFn: (row, col, field) => ( <TableRow> <TableImage src={getTeamLogoUrl(row.opposing_team_logo)} alt="" /> <TableLink to={`/teams/${row.opposing_team_id}`}>{field || strings.general_unknown}</TableLink> </TableRow> ), }, ]; export const memberColumns = strings => [{ displayName: strings.th_name, field: 'name', sortFn: true, displayFn: (row, col, field) => ( <TableRow> <TableImage src={getPlayerImageUrl(row.account_id)} /> <TableLink to={`/players/${row.account_id}`}>{field || strings.general_unknown}</TableLink> </TableRow> ), }, { displayName: strings.th_games_played, field: 'games_played', sortFn: true, relativeBars: true, }, { displayName: strings.th_winrate, field: 'wins', sortFn: row => row.wins / row.games_played, percentBars: true, }, ]; export const heroColumns = strings => [{ displayName: strings.th_hero_id, field: 'hero_id', displayFn: displayHeroId, sortFn: row => (heroes[row.hero_id] && heroes[row.hero_id].localized_name), }, { displayName: strings.th_games_played, field: 'games_played', sortFn: true, relativeBars: true, }, { displayName: strings.th_winrate, field: 'wins', sortFn: row => (row.wins / row.games_played), percentBars: true, }, ];
odota/web/src/components/Team/teamDataColumns.jsx/0
{ "file_path": "odota/web/src/components/Team/teamDataColumns.jsx", "repo_id": "odota", "token_count": 1136 }
265
import React from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { KDAContainer, TitleContainer, KDAPercentContainer } from './Styled'; import constants from '../../constants'; const KDA = ({ kills, deaths, assists, strings, }) => { const kdaSum = kills + deaths + assists; return ( <KDAContainer> <TitleContainer style={{ marginLeft: '10px' }}> {kills} </TitleContainer> <KDAPercentContainer data-hint={`${strings.th_kda}: ${Number(((kills + assists) / (deaths + 1)).toFixed(2))}`} data-hint-position="top" > <div style={{ width: `${(kills * 100) / kdaSum}%`, backgroundColor: constants.colorGreen }} /> <div style={{ width: `${(deaths * 100) / kdaSum}%`, backgroundColor: constants.colorRed }} /> <div style={{ width: `${(assists * 100) / kdaSum}%`, backgroundColor: constants.colorBlueGray }} /> </KDAPercentContainer> </KDAContainer> ); }; const { number, shape } = PropTypes; KDA.propTypes = { kills: number, deaths: number, assists: number, strings: shape({}), }; const mapStateToProps = state => ({ strings: state.app.strings, }); export default connect(mapStateToProps)(KDA);
odota/web/src/components/Visualizations/Table/KDA.jsx/0
{ "file_path": "odota/web/src/components/Visualizations/Table/KDA.jsx", "repo_id": "odota", "token_count": 473 }
266
{ "yes": "tak", "no": "nie", "abbr_thousand": " tys.", "abbr_million": "mln", "abbr_billion": "mld", "abbr_trillion": "tln", "abbr_quadrillion": "kln", "abbr_not_available": "Niedostępne", "abbr_pick": "P", "abbr_win": "W", "abbr_number": "Nr.", "analysis_eff": "Skuteczność na linii", "analysis_farm_drought": "Najniższe złoto/min w 5 minutowych przedziałach", "analysis_skillshot": "Skuteczne użycie umiejętności", "analysis_late_courier": "Opóźnienie w ulepszeniu kuriera", "analysis_wards": "Postawione wardy", "analysis_roshan": "Zabito Roshana", "analysis_rune_control": "Podniesione runy", "analysis_unused_item": "Nieużyte aktywne przedmioty", "analysis_expected": "z", "announce_dismiss": "Pomiń", "announce_github_more": "Zobacz w witrynie GitHub", "api_meta_description": "OpenDota API daję dostęp do wszystkich zaawansowanych statystyk Dota 2 oferowanych przez platformę OpenDota. Uzyskaj dostęp do wykresów wydajnośći, map termicznychm, słownej chmury oraz wiecej. Rozpocznij za darmo.", "api_title": "OpenDota API", "api_subtitle": "Zbudowane na bazie platformy OpenDota. Dodaj zaawansowane statysktyki do twojej aplikacji i pozwól na głęboki wgląd twoim użytkownikom.", "api_details_free_tier": "Free Tier", "api_details_premium_tier": "Premium Tier", "api_details_price": "Cena", "api_details_price_free": "Free", "api_details_price_prem": "$price per $unit calls", "api_details_key_required": "Key Required?", "api_details_key_required_free": "Nie", "api_details_key_required_prem": "Tak -- wymaga metodę płatnośći", "api_details_call_limit": "Call Limit", "api_details_call_limit_free": "$limit per month", "api_details_call_limit_prem": "Unlimited", "api_details_rate_limit": "Rate Limit", "api_details_rate_limit_val": "$num calls per minute", "api_details_support": "Support", "api_details_support_free": "Community support via Discord group", "api_details_support_prem": "Priority support from core developers", "api_get_key": "Get my key", "api_docs": "Read the docs", "api_header_details": "Details", "api_charging": "You're charged $cost per call, rounded up to the nearest cent.", "api_credit_required": "Getting an API key requires a linked payment method. We'll automatically charge the card at the beginning of the month for any fees owed.", "api_failure": "500 errors don't count as usage, since that means we messed up!", "api_error": "There was an error with the request. Please try again. If it continues, contact us at support@opendota.com.", "api_login": "Login to access API Key", "api_update_billing": "Update billing method", "api_delete": "Delete key", "api_key_usage": "To use your key, add $param as a query parameter to your API request:", "api_billing_cycle": "The current billing cycle ends on $date.", "api_billed_to": "We'll automatically bill the $brand ending in $last4.", "api_support": "Need support? Email $email.", "api_header_usage": "Your Usage", "api_usage_calls": "# API calls", "api_usage_fees": "Estimated Fees", "api_month": "Month", "api_header_key": "Your Key", "api_header_table": "Get started for free. Keep going at a ridiculously low price.", "app_name": "OpenDota", "app_language": "Język", "app_localization": "Lokalizacja", "app_description": "Platforma danych typu open source Dota 2", "app_about": "O programie", "app_privacy_terms": "Prywatność i warunki", "app_api_docs": "Dokumenty API", "app_blog": "Blog", "app_translate": "Tłumaczenie", "app_donate": "Donate", "app_gravitech": "A Gravitech LLC Site", "app_powered_by": "wykorzystuje", "app_donation_goal": "Miesięczne Wsparcie", "app_sponsorship": "Twój wkład pomaga utrzymać stronę darmową dla wszystkich.", "app_twitter": "Śledź nas na Twitterze", "app_github": "Źródło w usłudze GitHub", "app_discord": "Porozmawiaj na Discord", "app_steam_profile": "Profil Steam", "app_confirmed_as": "Potwierdzone konto jako", "app_untracked": "Ten użytkownik nie logował się ostatnio więc powtórki nowych meczy nie będą automatycznie analizowane.", "app_tracked": "Ten użytkownik logował się ostatnio więc powtórki nowych meczy będą automatycznie analizowane.", "app_cheese_bought": "Kupione sery", "app_contributor": "This user has contributed to the development of the OpenDota project", "app_dotacoach": "Zapytaj trenera", "app_pvgna": "Znajdź podręcznik", "app_pvgna_alt": "Znajdź poradnik Dota 2 na Pvgna", "app_rivalry": "Bet on Pro Matches", "app_rivalry_team": "Bet on {0} Matches", "app_refresh": "Odśwież historię meczu - zakolejkuj skan by odnaleźć brakujące mecze niewidoczne z powodu ustawień prywatności", "app_refresh_label": "Odśwież", "app_login": "Zaloguj się", "app_logout": "Wyloguj się", "app_results": "wyniki(i)", "app_report_bug": "Zgłoś błąd", "app_pro_players": "Profesjonalni gracze", "app_public_players": "Gracze publiczni", "app_my_profile": "Mój profil", "barracks_value_1": "Mroczni - dół - walka wręcz", "barracks_value_2": "Mroczni - dół- walka dystansowa", "barracks_value_4": "Mroczni - środek - walka wręcz", "barracks_value_8": "Mroczni - środek - walka dystansowa", "barracks_value_16": "Mroczni - góra - walka wręcz", "barracks_value_32": "Mroczni - góra - walka dystansowa", "barracks_value_64": "Świetliści - dół - walka wręcz", "barracks_value_128": "Świetliści - dół - walka dystansowa", "barracks_value_256": "Świetliści - środek - walka wręcz", "barracks_value_512": "Świetliści - środek - walka dystansowa", "barracks_value_1024": "Świetliści - góra - walka wręcz", "barracks_value_2048": "Świetliści - góra - walka dystansowa", "benchmarks_description": "{0} {1} is equal or higher than {2}% of recent performances on this hero", "fantasy_description": "{0} for {1} points", "building_melee_rax": "Baraki - walka wręcz", "building_range_rax": "Baraki - walka dystansowa", "building_lasthit": "zadał(a) ostatnie uderzenie", "building_damage": "otrzymane obrażenia", "building_hint": "Ikony na mapie zawierają tooltipy", "building_denied": "zanegował/a", "building_ancient": "Starożytny", "CHAT_MESSAGE_TOWER_KILL": "Wieża", "CHAT_MESSAGE_BARRACKS_KILL": "Baraki", "CHAT_MESSAGE_ROSHAN_KILL": "Roshan", "CHAT_MESSAGE_AEGIS": "zabrał(a) Egidę", "CHAT_MESSAGE_FIRSTBLOOD": "Pierwsza krew", "CHAT_MESSAGE_TOWER_DENY": "Wieża zanegowana", "CHAT_MESSAGE_AEGIS_STOLEN": "skradł(a) Egidę", "CHAT_MESSAGE_DENIED_AEGIS": "zanegował(a) Egidę", "distributions_heading_ranks": "Dystrybucja Medali", "distributions_heading_mmr": "Rozkład solo MMR", "distributions_heading_country_mmr": "Średnie solo MMR według kraju", "distributions_tab_ranks": "Medale", "distributions_tab_mmr": "Solo MMR", "distributions_tab_country_mmr": "Solo MMR według kraju", "distributions_warning_1": "Te dane są ograniczone tylko do graczy posiadających MMR na swoim profilu oraz udostępniających publiczne dane o meczach.", "distributions_warning_2": "Gracze nie muszą się rejestrować, jednak dane pochodzą od osób zarejestrowanych, więc średnie są prawdopodobnie wyższe od oczekiwanych.", "error": "Błąd", "error_message": "Ups! Coś poszło nie tak.", "error_four_oh_four_message": "Szukana strona nie została znaleziona.", "explorer_title": "Eksplorator danych", "explorer_subtitle": "Statystyki profesjonalistów Dota 2", "explorer_description": "Uruchom zaawansowane zapytania na mecze profesjonalne (z wyłączeniem amatorskich lig)", "explorer_schema": "Schemat", "explorer_results": "Wyniki", "explorer_num_rows": "wiersz(e)", "explorer_select": "Wybierz", "explorer_group_by": "Grupuj według", "explorer_hero": "Bohater", "explorer_patch": "Patch", "explorer_min_patch": "Min. łatka", "explorer_max_patch": "Maks. łatka", "explorer_min_mmr": "Min. MMR", "explorer_max_mmr": "Maks. MMR", "explorer_min_rank_tier": "Min. Medal", "explorer_max_rank_tier": "Maks. Medal", "explorer_player": "Gracz", "explorer_league": "Liga", "explorer_player_purchased": "Gracz kupił", "explorer_duration": "Czas trwania", "explorer_min_duration": "Min. czas trwania", "explorer_max_duration": "Maks. czas trwania", "explorer_timing": "Wyczucie czasu", "explorer_uses": "Użycia", "explorer_kill": "Czas zabójstwa", "explorer_side": "Strona", "explorer_toggle_sql": "Wł./Wył. SQL", "explorer_team": "Obecna drużyna", "explorer_lane_role": "Linia", "explorer_min_date": "Minimalna data", "explorer_max_date": "Maksymalna data", "explorer_hero_combos": "Combo bohaterów", "explorer_hero_player": "Bohater-Gracz", "explorer_player_player": "Gracz-Gracz", "explorer_sql": "SQL", "explorer_postgresql_function": "Funkcja PostgreSQL", "explorer_table": "Tabela", "explorer_column": "Kolumna", "explorer_query_button": "Tabela", "explorer_cancel_button": "Anuluj", "explorer_table_button": "Tabela", "explorer_api_button": "API", "explorer_json_button": "JSON", "explorer_csv_button": "CSV", "explorer_donut_button": "Pierścień", "explorer_bar_button": "Kolumnowy", "explorer_timeseries_button": "Szereg czasowy", "explorer_chart_unavailable": "Wykres nie jest dostępny. Spróbuj dodać filtr GRUPUJ WEDŁUG", "explorer_value": "Wartość", "explorer_category": "Kategoria", "explorer_region": "Region", "explorer_picks_bans": "Wybory/Bany", "explorer_counter_picks_bans": "Kontrwybory/Kontrbany", "explorer_organization": "Organizacja", "explorer_order": "Sortuj według", "explorer_asc": "Rosnaco", "explorer_desc": "Malejąco", "explorer_tier": "Poziom", "explorer_having": "Co najmniej tyle meczy", "explorer_limit": "Limit", "explorer_match": "Mecz", "explorer_is_ti_team": "Is TI{number} Team", "explorer_mega_comeback": "Won Against Mega Creeps", "explorer_max_gold_adv": "Max Gold Advantage", "explorer_min_gold_adv": "Min Gold Advantage", "farm_heroes": "Zabici bohaterowie", "farm_creeps": "Zabite creepy liniowe", "farm_neutrals": "Zabite neutralne creepy (w tym starożytne)", "farm_ancients": "Zabite starożytne creepy", "farm_towers": "Zniszczone wieże", "farm_couriers": "Zabitych kurierów", "farm_observers": "Zniszczonych Obserwatorów", "farm_sentries": "Zniszczonych wartowników", "farm_roshan": "Roshan - zabito", "farm_necronomicon": "Zabitych jednostek Necronomiconu", "filter_button_text_open": "Filtr", "filter_button_text_close": "Zamknij", "filter_hero_id": "Bohater", "filter_is_radiant": "Strona", "filter_win": "Wynik", "filter_lane_role": "Linia", "filter_patch": "Patch", "filter_game_mode": "Tryb gry", "filter_lobby_type": "Typ poczekalni", "filter_date": "Data", "filter_region": "Region", "filter_with_hero_id": "Sprzymierzeni bohaterowie", "filter_against_hero_id": "Wrodzy bohaterowie", "filter_included_account_id": "Uwzględniając ID konta", "filter_excluded_account_id": "Wykluczając ID konta", "filter_significant": "Nieistotne", "filter_significant_include": "Wliczając", "filter_last_week": "Ostatni tydzień", "filter_last_month": "Ostatni miesiąc", "filter_last_3_months": "Ostatnie 3 mięsiące", "filter_last_6_months": "Ostatnie 6 miesięcy", "filter_error": "Wybierz przedmiot z rozwijanej listy", "filter_party_size": "Party Size", "game_mode_0": "Nieznany", "game_mode_1": "Pełna pula", "game_mode_2": "Tryb kapitana", "game_mode_3": "Losowa pula", "game_mode_4": "Losowa trójka", "game_mode_5": "Wszyscy losowo", "game_mode_6": "Wprowadzenie", "game_mode_7": "Mroczny Czas", "game_mode_8": "Odwrócony tryb kapitana", "game_mode_9": "Złochciwość", "game_mode_10": "Samouczek", "game_mode_11": "Tylko środek", "game_mode_12": "Najmniej grane", "game_mode_13": "Ograniczeni bohaterowie", "game_mode_14": "Kompendium", "game_mode_15": "Niestandardowe", "game_mode_16": "Kapitańska pula", "game_mode_17": "Zbalansowana pula", "game_mode_18": "Umiejętnościowa pula", "game_mode_19": "Wydarzenie", "game_mode_20": "Deathmatch Wszyscy Losowo", "game_mode_21": "1 na 1 Solo Środek", "game_mode_22": "Pełna pula", "game_mode_23": "Turbo", "game_mode_24": "Mutation", "general_unknown": "Nieznany", "general_no_hero": "Brak bohatera", "general_anonymous": "Anonimowy", "general_radiant": "Świetliści", "general_dire": "Mroczni", "general_standard_deviation": "Standardowe odchylenie", "general_matches": "Mecze", "general_league": "Liga", "general_randomed": "Losowo", "general_repicked": "Wybrane ponownie", "general_predicted_victory": "Przewidziane zwycięstwo", "general_show": "Show", "general_hide": "Hide", "gold_reasons_0": "Inne", "gold_reasons_1": "Zgony", "gold_reasons_2": "Wykupienie", "NULL_gold_reasons_5": "Opuszczenie", "NULL_gold_reasons_6": "Sprzedaż", "gold_reasons_11": "Budynek", "gold_reasons_12": "Bohater", "gold_reasons_13": "Creep", "gold_reasons_14": "Roshan", "NULL_gold_reasons_15": "Kurier", "header_request": "Zapytanie", "header_distributions": "Rankingi", "header_heroes": "Bohaterowie", "header_blog": "Blog", "header_ingame": "W grze", "header_matches": "Mecze", "header_records": "Wpisy", "header_explorer": "Eksplorator", "header_teams": "Drużyny", "header_meta": "Meta", "header_scenarios": "Scenarios", "header_api": "API", "heading_lhten": "Ostatnie trafienia w 10 min", "heading_lhtwenty": "Ostatnie trafienia w 20 min", "heading_lhthirty": "Ostatnie trafienia w 30 min", "heading_lhforty": "Ostatnie trafienia w 40 min", "heading_lhfifty": "Ostatnie trafienia w 50 min", "heading_courier": "Kurier", "heading_roshan": "Roshan", "heading_tower": "Wieża", "heading_barracks": "Baraki", "heading_shrine": "Kapliczka", "heading_item_purchased": "Przedmiot kupiono", "heading_ability_used": "Umiejętność użyto", "heading_item_used": "Przedmiot użyto", "heading_damage_inflictor": "Zadane obrażenia", "heading_damage_inflictor_received": "Obrażenia otrzymane", "heading_damage_instances": "Ilość zadania obrażeń", "heading_camps_stacked": "Zestackowane obozy", "heading_matches": "Ostatnie mecze", "heading_heroes": "Wybrani bohaterowie", "heading_mmr": "Historia MMR", "heading_peers": "Mecze z graczami", "heading_pros": "Mecze z profesjonalnymi graczami", "heading_rankings": "Rankingi Bohaterów", "heading_all_matches": "We wszystkich meczach", "heading_parsed_matches": "W przeanalizowanych meczach", "heading_records": "Rekordy", "heading_teamfights": "Walki drużynowe", "heading_graph_difference": "Przewaga Świetlistych", "heading_graph_gold": "Złoto", "heading_graph_xp": "Doświadczenie", "heading_graph_lh": "Ostatnie uderzenia", "heading_overview": "Przegląd", "heading_ability_draft": "Abilities Drafted", "heading_buildings": "Mapa budynków", "heading_benchmarks": "Benchmark", "heading_laning": "Faza liniowa", "heading_overall": "Ogólne", "heading_kills": "Zabójstwa", "heading_deaths": "Zgony", "heading_assists": "Asysty", "heading_damage": "Obrażenia", "heading_unit_kills": "Zabójstwa jednostek", "heading_last_hits": "Ostatnie uderzenia", "heading_gold_reasons": "Źródła złota", "heading_xp_reasons": "Źródła doświadczenia", "heading_performances": "Efektywność", "heading_support": "wsparcie", "heading_purchase_log": "Rejestr kupna", "heading_casts": "Zaklęcia", "heading_objective_damage": "Obrażenia zadane celom", "heading_runes": "Runy", "heading_vision": "Wizja", "heading_actions": "Czynności", "heading_analysis": "Analiza", "heading_cosmetics": "Kosmetyczne", "heading_log": "Dziennik", "heading_chat": "Czat", "heading_story": "Historia", "heading_fantasy": "Fantasy", "heading_wardmap": "Mapa wardów", "heading_wordcloud": "Chmura słów", "heading_wordcloud_said": "Wypowiedziane słowa (czat do wszystkich)", "heading_wordcloud_read": "Przeczytane słowa (czat do wszystkich)", "heading_kda": "KLA", "heading_gold_per_min": "Złoto na minutę", "heading_xp_per_min": "Dośw. na minutę", "heading_denies": "Negacje", "heading_lane_efficiency_pct": "SKUT w 10min", "heading_duration": "Czas trwania", "heading_level": "Poziom", "heading_hero_damage": "Obrażenia zadane bohaterem", "heading_tower_damage": "Obrażenia zadane wieżom", "heading_hero_healing": "Leczenie bohaterów", "heading_tower_kills": "Zniszczone wieże", "heading_stuns": "Ogłuszenia", "heading_neutral_kills": "Zabitych neutralnych", "heading_courier_kills": "Zabitych kurierów", "heading_purchase_tpscroll": "Kupionych zwojów", "heading_purchase_ward_observer": "Kupionych Obserwatorów", "heading_purchase_ward_sentry": "Kupionych Wartowników", "heading_purchase_gem": "Kupionych Klejnotów", "heading_purchase_rapier": "Kupionych Rapierów", "heading_pings": "Pingów na mapie", "heading_throw": "Oddanych meczy", "heading_comeback": "Powrotów", "heading_stomp": "Miażdżących wygranych", "heading_loss": "Przegranych", "heading_actions_per_min": "Czynności na minutę", "heading_leaver_status": "Opuszczonych meczy", "heading_game_mode": "Tryb gry", "heading_lobby_type": "Typ poczekalni", "heading_lane_role": "Wybór linii", "heading_region": "Region", "heading_patch": "Patch", "heading_win_rate": "Procent Zwycięstw", "heading_is_radiant": "Strona", "heading_avg_and_max": "Średnie/Maksymalne", "heading_total_matches": "Łącznie meczy", "heading_median": "Mediana", "heading_distinct_heroes": "Odrębni bohaterowie", "heading_team_elo_rankings": "Drużynowe rankingi Elo", "heading_ability_build": "Build umiejętności", "heading_attack": "Bazowe obrażenia", "heading_attack_range": "Zasięg ataku: {0}", "heading_attack_speed": "Szybkość ataku", "heading_projectile_speed": "Prędkość pocisku", "heading_base_health": "Zdrowie", "heading_base_health_regen": "Regeneracja zdrowia", "heading_base_mana": "Mana", "heading_base_mana_regen": "Regeneracja many", "heading_base_armor": "Bazowy pancerz", "heading_base_mr": "Odporność na magię", "heading_move_speed": "Prędkość ruchu", "heading_turn_rate": "Prędkość obrotu", "heading_legs": "Ilość nóg", "heading_cm_enabled": "CM włączone", "heading_current_players": "Current Players", "heading_former_players": "Former Players", "heading_damage_dealt": "Damage Dealt", "heading_damage_received": "Damage Received", "show_details": "Show details", "hide_details": "Hide details", "subheading_avg_and_max": "in last {0} displayed matches", "subheading_records": "W meczach rankingowych. Wpisy resetują się co miesiąc.", "subheading_team_elo_rankings": "k = 32, począt.=1000", "hero_pro_tab": "Profesjonalne rozgrywki", "hero_public_tab": "Publiczne rozgrywki", "hero_pro_heading": "Bohaterowie w profesjonalnych meczach", "hero_public_heading": "Bohaterowie w publicznych meczach (próbki)", "hero_this_month": "meczy w przeciągu ostatnich 30 dni", "hero_pick_ban_rate": "Pro w+b%", "hero_pick_rate": "Pro wybór%", "hero_ban_rate": "Pro ban%", "hero_win_rate": "Pro wyg%", "hero_5000_pick_rate": ">5 tyś. w%", "hero_5000_win_rate": ">5 tyś. w%", "hero_4000_pick_rate": "4 tyś. w%", "hero_4000_win_rate": "4 tyś. w%", "hero_3000_pick_rate": "3 tyś. w%", "hero_3000_win_rate": "3 tyś. w%", "hero_2000_pick_rate": "2 tyś. w%", "hero_2000_win_rate": "2 tyś. w%", "hero_1000_pick_rate": "<2 tyś. w%", "hero_1000_win_rate": "<2 tyś. w%", "home_login": "Zaloguj się", "home_login_desc": ", aby automatycznie analizować powtórki", "home_parse": "Zapytaj", "home_parse_desc": "o konkretny mecz", "home_why": "", "home_opensource_title": "Open Source", "home_opensource_desc": "Cały kod projektu jest otwartym oprogramowaniem dostępnym dla wszystkich osób do modyfikacji i usprawnień.", "home_indepth_title": "Drobiazgowa analiza", "home_indepth_desc": "Analiza powtórek dostarcza obszerną listę szczegółowych danych dotyczących meczu.", "home_free_title": "Darmowa", "home_free_desc": "Serwery są opłacane przez sponsorów, a wolontariusze zajmują się kodem, dlatego też usługa jest oferowana bezpłatnie.", "home_background_by": "Tło stworzone przez", "home_sponsored_by": "Sponsorowane przez", "home_become_sponsor": "Zostań sponsorem", "items_name": "Nazwa przedmiotu", "items_built": "Ile razy utworzono ten przedmiot", "items_matches": "Ilość meczy w których utworzono ten przedmiot", "items_uses": "Ile razy użyto tego przedmiotu", "items_uses_per_match": "Średnia ilość razy kiedy wykorzystano ten przedmiot w meczach w których został utworzony", "items_timing": "Średni czas w którym utworzono ten przedmiot", "items_build_pct": "Procent meczy w których utworzono ten przedmiot", "items_win_pct": "Procent wygranych meczy w których utworzono ten przedmiot", "lane_role_0": "Nieznana", "lane_role_1": "Bezpieczna", "lane_role_2": "Środek", "lane_role_3": "Trudna", "lane_role_4": "Dżungla", "lane_pos_1": "Dół", "lane_pos_2": "Środek", "lane_pos_3": "Góra", "lane_pos_4": "Dżungla Świetlistych", "lane_pos_5": "Dżungla Mrocznych", "leaver_status_0": "Żadnych", "leaver_status_1": "Opuszczonych bezpiecznie", "leaver_status_2": "Opuszczonych (rozłączenie)", "leaver_status_3": "Opuszczonych", "leaver_status_4": "Opuszczonych (bezczynność)", "leaver_status_5": "Nigdy nie połączony", "leaver_status_6": "Nigdy nie połączony (timeout)", "lobby_type_0": "Normalny", "lobby_type_1": "Trening", "lobby_type_2": "Turniej", "lobby_type_3": "Samouczek", "lobby_type_4": "Kooperacja z botami", "lobby_type_5": "Rankingowy drużynowy MM (Legacy)", "lobby_type_6": "Rankingowy solo MM (Legacy)", "lobby_type_7": "Rankingowy", "lobby_type_8": "1v1 środek", "lobby_type_9": "Puchar Bitewny", "match_radiant_win": "Wygrana Świetlistych", "match_dire_win": "Wygrana Mrocznych", "match_team_win": "Wygrana", "match_ended": "Zakończył się", "match_id": "ID meczu", "match_region": "Region", "match_avg_mmr": "Średnie MMR", "match_button_parse": "Analizuj", "match_button_reparse": "Ponów analizę", "match_button_replay": "Powtórka", "match_button_video": "Utwórz film", "match_first_tower": "Pierwsza wieża", "match_first_barracks": "Pierwsze baraki", "match_pick": "Wybór", "match_ban": "Ban", "matches_highest_mmr": "Top Public", "matches_lowest_mmr": "Niski MMR", "meta_title": "Meta", "meta_description": "Uruchom zaawansowane zapytania na danych z publicznych meczów z ostatnich 24h", "mmr_not_up_to_date": "Dlaczego MMR nie jest aktualne?", "npc_dota_beastmaster_boar_#": "Dzik", "npc_dota_lesser_eidolon": "Mniejszy Eidolon", "npc_dota_eidolon": "Eidolon", "npc_dota_greater_eidolon": "Większy Eidolon", "npc_dota_dire_eidolon": "Eidolon Mrocznych", "npc_dota_invoker_forged_spirit": "Ukuta Dusza", "npc_dota_furion_treant_large": "Większy drzewiec", "npc_dota_beastmaster_hawk_#": "Jastrząb", "npc_dota_lycan_wolf#": "Wilk Likana", "npc_dota_neutral_mud_golem_split_doom": "Cząstka Dooma", "npc_dota_broodmother_spiderling": "Pajęczak", "npc_dota_broodmother_spiderite": "Pajączek", "npc_dota_furion_treant": "Drzewiec", "npc_dota_unit_undying_zombie": "Zombie Undying'a", "npc_dota_unit_undying_zombie_torso": "Zombie Undying'a", "npc_dota_brewmaster_earth_#": "Piwowar Ziemi", "npc_dota_brewmaster_fire_#": "Piwowar Ognia", "npc_dota_lone_druid_bear#": "Niedźwiedzie Widmo", "npc_dota_brewmaster_storm_#": "Piwowar Burzy", "npc_dota_visage_familiar#": "Chowaniec", "npc_dota_warlock_golem_#": "Golem Warlocka", "npc_dota_warlock_golem_scepter_#": "Golem Warlocka", "npc_dota_witch_doctor_death_ward": "Ward Śmierci", "npc_dota_tusk_frozen_sigil#": "Zamarznięty Znak", "npc_dota_juggernaut_healing_ward": "Ward Leczenia", "npc_dota_techies_land_mine": "Miny Zbliżeniowe", "npc_dota_shadow_shaman_ward_#": "Ward Węża", "npc_dota_pugna_nether_ward_#": "Ward Mroku", "npc_dota_venomancer_plague_ward_#": "Ward Plagi", "npc_dota_rattletrap_cog": "Elektryczne Tryby", "npc_dota_templar_assassin_psionic_trap": "Pułapka Psioniczna", "npc_dota_techies_remote_mine": "Zdalna Mina", "npc_dota_techies_stasis_trap": "Pułapka Stazy", "npc_dota_phoenix_sun": "Supernowa", "npc_dota_unit_tombstone#": "Nagrobek", "npc_dota_treant_eyes": "Las Ma Wiele Oczu", "npc_dota_gyrocopter_homing_missile": "Rakieta Naprowadzana", "npc_dota_weaver_swarm": "Rój", "objective_tower1_top": "T1", "objective_tower1_mid": "M1", "objective_tower1_bot": "B1", "objective_tower2_top": "T2", "objective_tower2_mid": "M2", "objective_tower2_bot": "B2", "objective_tower3_top": "T3", "objective_tower3_mid": "M3", "objective_tower3_bot": "B3", "objective_rax_top": "RakiG", "objective_rax_mid": "RakiS", "objective_rax_bot": "RakiD", "objective_tower4": "T4", "objective_fort": "Staro", "objective_shrine": "Świąt", "objective_roshan": "Rosh", "tooltip_objective_tower1_top": "Damage dealt to top Tier 1 tower", "tooltip_objective_tower1_mid": "Damage dealt to middle Tier 1 tower", "tooltip_objective_tower1_bot": "Damage dealt to bottom Tier 1 tower", "tooltip_objective_tower2_top": "Damage dealt to top Tier 2 tower", "tooltip_objective_tower2_mid": "Damage dealt to middle Tier 2 tower", "tooltip_objective_tower2_bot": "Damage dealt to bottom Tier 2 tower", "tooltip_objective_tower3_top": "Damage dealt to top Tier 3 tower", "tooltip_objective_tower3_mid": "Damage dealt to middle Tier 3 tower", "tooltip_objective_tower3_bot": "Damage dealt to bottom Tier 3 tower", "tooltip_objective_rax_top": "Damage dealt to top barracks", "tooltip_objective_rax_mid": "Damage dealt to middle barracks", "tooltip_objective_rax_bot": "Damage dealt to bottom barracks", "tooltip_objective_tower4": "Damage dealt to middle Tier 4 towers", "tooltip_objective_fort": "Damage dealt to ancient", "tooltip_objective_shrine": "Damage dealt to shrines", "tooltip_objective_roshan": "Damage dealt to Roshan", "pagination_first": "Pierwszy", "pagination_last": "Ostatnia", "pagination_of": "z", "peers_none": "This player has no peers.", "rank_tier_0": "Nieskalibrowany", "rank_tier_1": "Herald", "rank_tier_2": "Guardian", "rank_tier_3": "Crusader", "rank_tier_4": "Archon", "rank_tier_5": "Legend", "rank_tier_6": "Ancient", "rank_tier_7": "Divine", "rank_tier_8": "Immortal", "request_title": "Zleć analizę", "request_match_id": "ID meczu", "request_invalid_match_id": "Invalid Match ID", "request_error": "Nie udało się uzyskać danych z meczu", "request_submit": "Wyślij", "roaming": "Roaming", "rune_0": "Podwójne obrażenia", "rune_1": "Pośpiech", "rune_2": "Iluzja", "rune_3": "Niewidzialność", "rune_4": "Regeneracja", "rune_5": "Nagroda", "rune_6": "Tajemna", "rune_7": "Pāṇī", "search_title": "Search by player name, match ID...", "skill_0": "Unknown Skill", "skill_1": "Normal Skill", "skill_2": "High Skill", "skill_3": "Very High Skill", "story_invalid_template": "(nieprawidłowy szablon)", "story_error": "Wystąpił błąd podczas tworzenia historii dla tego meczu", "story_intro": "{date}, dwie drużyny postanowiły zagrać mecz {game_mode_article} {game_mode} w {region}. Nie zdawali sobie sprawy, że gra będzie trwać {duration_in_words}", "story_invalid_hero": "Nierozpoznany bohater", "story_fullstop": ".", "story_list_2": "{1} i {2}", "story_list_3": "{1}, {2} i {3}", "story_list_n": "{i}, {rest}", "story_firstblood": "pierwsza krew została przelana kiedy {killer} zabił(a) {victim} w {time}", "story_chatmessage": "\"{message}\", {said_verb} {player}", "story_teamfight": "{winning_team} wygrali walkę drużynową poświęcając {win_dead} za {lose_dead} zyskując przewagę w złocie w wysokości {net_change}", "story_teamfight_none_dead": "{winning_team} wygrali walkę drużynową zabijając {lose_dead}, nie tracąc przy tym żadnego własnego bohatera, zyskując przewagę w złocie w wysokości {net_change}", "story_teamfight_none_dead_loss": "{winning_team} jakimś sposobem wygrała teamfight bez zabijania nikogo, a tracąc {win_dead}, co poskutkowało zmianą złota drużyny o {net_change}", "story_lane_intro": "W 10 minucie gry, linie rozegrano następująco:", "story_lane_radiant_win": "{radiant_players} wygrali linię {lane} przeciwko {dire_players}", "story_lane_radiant_lose": "{radiant_players} stracili linię {lane} przeciwko {dire_players}", "story_lane_draw": "{radiant_players} mieli wyrównaną walkę na linii {lane} przeciwko {dire_players}", "story_lane_free": "{players} mieli darmową linię {lane}", "story_lane_empty": "nie było nikogo na linii {lane}", "story_lane_jungle": "w dżungli przebywali {players}", "story_lane_roam": "{players} przemierzali mapę", "story_roshan": "{team} zabili Roshana", "story_aegis": "{player} {action} Egidę", "story_gameover": "Mecz zakończył się zwycięstwem {winning_team} w czasie {duration} z wynikiem {radiant_score} do {dire_score}", "story_during_teamfight": "podczas walki {events}", "story_after_teamfight": "po walce {events}", "story_expensive_item": "w {time} {player} zakupił(a) {item}, które było pierwszym przedmiotem w grze o cenie wyższej, niż {price_limit}", "story_building_destroy": "zniszczono {building}", "story_building_destroy_player": "{player} zniszczył(a) {building}", "story_building_deny_player": "{player} zanegował(a) {building}", "story_building_list_destroy": "zostały zniszczone {buildings}", "story_courier_kill": "Zginął kurier drużyny {team}", "story_tower": "Tier {tier} {lane} wieżę {team}", "story_tower_simple": "jedna z wież {team}", "story_towers_n": "{n} wieże {team}", "story_barracks": "Baraki {rax_type} {team} na linii {lane}", "story_barracks_both": "obydwa baraki {team} na linii {lane}", "story_time_marker": "Po {minutes} minutach", "story_item_purchase": "{player} kupił/a {item} w {time}", "story_predicted_victory": "{players} stawia(ją), że {team} wygrają", "story_predicted_victory_empty": "Nikt", "story_networth_diff": "Różnica {percent}% / {gold}", "story_gold": "złoto", "story_chat_asked": "zapytał", "story_chat_said": "powiedział", "tab_overview": "Przegląd", "tab_matches": "Mecze", "tab_heroes": "Bohaterowie", "tab_peers": "Znajomi", "tab_pros": "Prosi", "tab_activity": "Aktywność", "tab_records": "Rekordy", "tab_totals": "Łącznie", "tab_counts": "Licznik", "tab_histograms": "Histogram", "tab_trends": "Trendy", "tab_items": "Przedmioty", "tab_wardmap": "Mapa wardów", "tab_wordcloud": "Chmura słów", "tab_mmr": "MMR", "tab_rankings": "Rankingi", "tab_drafts": "Draft", "tab_benchmarks": "Benchmark", "tab_performances": "Efektywność", "tab_damage": "Obrażenia", "tab_purchases": "Purchases", "tab_farm": "Farma", "tab_combat": "Walka", "tab_graphs": "Wykresy", "tab_casts": "Zaklęcia", "tab_vision": "Wizja", "tab_objectives": "Cele", "tab_teamfights": "Walki drużynowe", "tab_actions": "Czynności", "tab_analysis": "Analiza", "tab_cosmetics": "Kosmetyczne", "tab_log": "Raport", "tab_chat": "Czat", "tab_story": "Historia", "tab_fantasy": "Fantasy", "tab_laning": "Faza liniowa", "tab_recent": "Ostatnie", "tab_matchups": "Matchupy", "tab_durations": "Czasy trwania", "tab_players": "Gracze", "placeholder_filter_heroes": "Przefiltruj bohaterów", "td_win": "Won Match", "td_loss": "Lost Match", "td_no_result": "Brak wyniku", "th_hero_id": "Bohater", "th_match_id": "ID", "th_account_id": "ID Konta", "th_result": "Wynik", "th_skill": "poziom umiejętności", "th_duration": "Czas trwania", "th_games": "LG", "th_games_played": "Gry", "th_win": "% zwycięstw", "th_advantage": "Przewaga", "th_with_games": "Razem z", "th_with_win": "% wygranych razem z", "th_against_games": "Przeciwko", "th_against_win": "% wygranych przeciwko", "th_gpm_with": "ZŁ/m z", "th_xpm_with": "DOŚW/m z", "th_avatar": "Gracz", "th_last_played": "Ostatnie", "th_record": "Rekord", "th_title": "Tytuł", "th_category": "Kategoria", "th_matches": "Mecze", "th_percentile": "Procentowo", "th_rank": "Miejsce", "th_items": "Przedmioty", "th_stacked": "Zestackowane", "th_multikill": "Multikill", "th_killstreak": "Seria zabójstw", "th_stuns": "Ogłuszenia", "th_dead": "Martwy", "th_buybacks": "Wykupienia", "th_biggest_hit": "Największe trafienie", "th_lane": "Linia", "th_map": "Mapa", "th_lane_efficiency": "SKUT w 10min", "th_lhten": "OT w 10min", "th_dnten": "NEG w 10min", "th_tpscroll": "TP", "th_ward_observer": "Obserwator", "th_ward_sentry": "Wartownik", "th_smoke_of_deceit": "Dym", "th_dust": "Pył", "th_gem": "Klejnot", "th_time": "Czas", "th_message": "Wiadomość", "th_heroes": "Bohaterowie", "th_creeps": "Creepy", "th_neutrals": "Neutralne", "th_ancients": "Starożytne", "th_towers": "Wieże", "th_couriers": "Kurierzy", "th_roshan": "Roshan", "th_necronomicon": "Necronomicon", "th_other": "Inne", "th_cosmetics": "Kosmetyczne", "th_damage_received": "Otrzymane", "th_damage_dealt": "Zadane", "th_players": "Gracze", "th_analysis": "Analiza", "th_death": "Zgony", "th_damage": "Obrażenia", "th_healing": "Leczenie", "th_gold": "ZŁ", "th_xp": "DOŚW", "th_abilities": "Umiejętności", "th_target_abilities": "Ability Targets", "th_mmr": "MMR", "th_level": "Poziom", "th_kills": "K", "th_kills_per_min": "KPM", "th_deaths": "D", "th_assists": "A", "th_last_hits": "OT", "th_last_hits_per_min": "OT/m", "th_denies": "NEG", "th_gold_per_min": "ZŁ/m", "th_xp_per_min": "DOŚW/m", "th_stuns_per_min": "SPM", "th_hero_damage": "OB", "th_hero_damage_per_min": "OB/m", "th_hero_healing": "LB", "th_hero_healing_per_min": "LB/m", "th_tower_damage": "OW", "th_tower_damage_per_min": "OW/m", "th_kda": "KLA", "th_actions_per_min": "C/m", "th_pings": "P/m", "th_DOTA_UNIT_ORDER_MOVE_TO_POSITION": "RN (P)", "th_DOTA_UNIT_ORDER_MOVE_TO_TARGET": "RN (C)", "th_DOTA_UNIT_ORDER_ATTACK_TARGET": "ATK (C)", "th_DOTA_UNIT_ORDER_ATTACK_MOVE": "ATK (P)", "th_DOTA_UNIT_ORDER_CAST_POSITION": "ZAK (P)", "th_DOTA_UNIT_ORDER_CAST_TARGET": "ZAK (C)", "th_DOTA_UNIT_ORDER_CAST_NO_TARGET": "ZAK (B)", "th_DOTA_UNIT_ORDER_HOLD_POSITION": "UP", "th_DOTA_UNIT_ORDER_GLYPH": "GLIF", "th_DOTA_UNIT_ORDER_RADAR": "SKAN", "th_ability_builds": "BU", "th_purchase_shorthand": "KUP", "th_use_shorthand": "UŻYTE", "th_duration_shorthand": "DUR", "th_country": "Kraj", "th_count": "Ilość", "th_sum": "Suma", "th_average": "Średnia", "th_name": "Nazwa", "th_team_name": "Nazwa drużyny", "th_score": "Wynik", "th_casts": "Zaklęcia", "th_hits": "Trafienia", "th_wins": "Wygrane", "th_losses": "Przegrane", "th_winrate": "Śr. wygranych", "th_solo_mmr": "Solo MMR", "th_party_mmr": "Drużynowy MMR", "th_estimated_mmr": "Szacowany MMR", "th_permanent_buffs": "Buffy", "th_winner": "Zwycięzcy", "th_played_with": "Mój rekord z", "th_obs_placed": "Postawieni Obserwatorzy", "th_sen_placed": "Postawieni Wartownicy", "th_obs_destroyed": "Zniszczonych Obserwatorów", "th_sen_destroyed": "Zniszczonych Wartowników", "th_scans_used": "Użyte Skany", "th_glyphs_used": "Użyte Glify", "th_legs": "Nogi", "th_fantasy_points": "Fantasy Points", "th_rating": "Rating", "th_teamfight_participation": "Uczestnictwo", "th_firstblood_claimed": "Pierwsza krew", "th_observers_placed": "Obserwatorzy", "th_camps_stacked": "Stacki", "th_league": "Liga", "th_attack_type": "Attack Type", "th_primary_attr": "Primary Attribute", "th_opposing_team": "Opposing Team", "ward_log_type": "Typ", "ward_log_owner": "Właściciel", "ward_log_entered_at": "Postawiony", "ward_log_left_at": "Pozostało", "ward_log_duration": "Długość życia", "ward_log_killed_by": "Zniszczone przez", "log_detail": "Szczegóły", "log_heroes": "Wybierz bohaterów", "tier_professional": "Profesjonalne", "tier_premium": "Premium", "time_past": "{0} ago", "time_just_now": "właśnie teraz", "time_s": "sekunda", "time_abbr_s": "{0}s", "time_ss": "{0} seconds", "time_abbr_ss": "{0}s", "time_m": "minuta", "time_abbr_m": "{0}m", "time_mm": "{0} minutes", "time_abbr_mm": "{0}m", "time_h": "godzina", "time_abbr_h": "{0}h", "time_hh": "{0} hours", "time_abbr_hh": "{0}h", "time_d": "dzień", "time_abbr_d": "{0}d", "time_dd": "{0} days", "time_abbr_dd": "{0}d", "time_M": "miesiąc", "time_abbr_M": "{0}mo", "time_MM": "{0} months", "time_abbr_MM": "{0}mo", "time_y": "rok", "time_abbr_y": "{0}y", "time_yy": "{0} years", "time_abbr_yy": "{0}y", "timeline_firstblood": "przelano pierwszą krew", "timeline_firstblood_key": "przelał pierwszą krew zabijając", "timeline_aegis_picked_up": "zabrał(a)", "timeline_aegis_snatched": "skradziono", "timeline_aegis_denied": "zanegowano", "timeline_teamfight_deaths": "Zgony", "timeline_teamfight_gold_delta": "delta złota", "title_default": "OpenDota - Statystyki dla Dota 2", "title_template": "%s - OpenDota - Statystyki dla Dota 2", "title_matches": "Mecze", "title_request": "Zleć analizę", "title_search": "Wyszukiwanie", "title_status": "Stan", "title_explorer": "Eksplorator danych", "title_meta": "Meta", "title_records": "Wpisy", "title_api": "The Opendota API: Advanced Dota 2 stats for your app", "tooltip_mmr": "Solo MMR gracza", "tooltip_abilitydraft": "Ability Drafted", "tooltip_level": "Poziom uzyskany przez bohatera", "tooltip_kills": "Liczba zabójstw bohatera", "tooltip_deaths": "Ilość zgonów bohatera", "tooltip_assists": "Ilość asyst bohatera", "tooltip_last_hits": "Ilość ostatnich trafień bohatera", "tooltip_denies": "Ilość zanegowanych creepów", "tooltip_gold": "Łączna ilość zdobytego złota", "tooltip_gold_per_min": "Uzyskane złoto na minutę", "tooltip_xp_per_min": "Uzyskane doświadczenie na minutę", "tooltip_stuns_per_min": "Seconds of hero stuns per minute", "tooltip_last_hits_per_min": "Ostatnie trafienia na minutę", "tooltip_kills_per_min": "Zabójstwa na minutę", "tooltip_hero_damage_per_min": "Obrażenia zadane bohaterom na minutę", "tooltip_hero_healing_per_min": "Leczenie bohaterów na minutę", "tooltip_tower_damage_per_min": "Obrażenia zadane wieżom na minutę", "tooltip_actions_per_min": "Czynności wykonywane przez gracza na minutę", "tooltip_hero_damage": "Ilość obrażeń zadanych bohaterom", "tooltip_tower_damage": "Ilość obrażeń zadanych wieżom", "tooltip_hero_healing": "Ilość zdrowia przywróconego bohaterom", "tooltip_duration": "Czas trwania meczu", "tooltip_first_blood_time": "Czas kiedy przelano pierwszą krew", "tooltip_kda": "(Zabójstwa + Asysty) / (Zgony +1)", "tooltip_stuns": "Liczba sekund unieszkodliwienia bohatera", "tooltip_dead": "Długość zgonów", "tooltip_buybacks": "Ilość wykupień", "tooltip_camps_stacked": "Zestackowane obozy", "tooltip_tower_kills": "Zniszczone wieże", "tooltip_neutral_kills": "Zabite neutralne creepy", "tooltip_courier_kills": "Zabitych kurierów", "tooltip_purchase_tpscroll": "Kupionych zwojów miejskiego portalu", "tooltip_purchase_ward_observer": "Kupionych Obserwatorów", "tooltip_purchase_ward_sentry": "Kupionych Wartowników", "tooltip_purchase_smoke_of_deceit": "Kupionych Dymów Oszustwa", "tooltip_purchase_dust": "Kupionych pyłów ujawnienia", "tooltip_purchase_gem": "Kupionych Klejnotów Prawdziwego Widzenia", "tooltip_purchase_rapier": "Kupionych Niebiańskich Rapierów", "tooltip_purchase_buyback": "Liczba wykupień", "tooltip_duration_observer": "Average lifespan of Observer Wards", "tooltip_duration_sentry": "Average lifespan of Sentry Wards", "tooltip_used_ward_observer": "Liczba postawionych Obserwatorów podczas meczu", "tooltip_used_ward_sentry": "Liczba postawionych Wartowników podczas meczu", "tooltip_used_dust": "Ile razy pył ujawnienia został użyty podczas meczu", "tooltip_used_smoke_of_deceit": "Ile razy Dym Oszustwa został użyty podczas meczu", "tooltip_parsed": "Powtórka została przeanalizowana pod kątem dodatkowych danych", "tooltip_unparsed": "Powtórka z tego meczu nie została jeszcze przeanalizowana. Nie wszystkie dane mogą być dostępne.", "tooltip_hero_id": "The hero played", "tooltip_result": "Wygrana lub przegrana gracza", "tooltip_match_id": "ID meczu", "tooltip_game_mode": "Tryb gry meczu", "tooltip_skill": "Szacowane granice MMR dla grup to 0, 3200 oraz 3700", "tooltip_ended": "Czas zakończenia meczu", "tooltip_pick_order": "Kolejność wyboru przez gracza", "tooltip_throw": "Największa przewaga złota w przegranym meczu", "tooltip_comeback": "Największa strata złota w wygranym meczu", "tooltip_stomp": "Największa przewaga złota w wygranym meczu", "tooltip_loss": "Największa strata złota w przegranym meczu", "tooltip_items": "Utworzone przedmiotów", "tooltip_permanent_buffs": "Permanent buffs such as Flesh Heap stacks or Tomes of Knowledge used", "tooltip_lane": "Linia w oparciu o pozycję bohatera we wczesnej grze", "tooltip_map": "Mapa termiczna w oparciu o pozycję gracza we wczesnej grze", "tooltip_lane_efficiency": "Procent złota z linii (creepy+pasywne+startowe) uzyskane w 10 minucie", "tooltip_lane_efficiency_pct": "Procent złota z linii (creepy+pasywne+startowe) uzyskane w 10 minucie", "tooltip_pings": "Ile razy gracz użył pingu na mapie", "tooltip_DOTA_UNIT_ORDER_MOVE_TO_POSITION": "Ile razy gracz przemieścił się na pozycję", "tooltip_DOTA_UNIT_ORDER_MOVE_TO_TARGET": "Ile razy gracz przemieścił się do celu", "tooltip_DOTA_UNIT_ORDER_ATTACK_MOVE": "Ile razy gracz zaatakował pozycję (ruch ataku)", "tooltip_DOTA_UNIT_ORDER_ATTACK_TARGET": "Ile razy gracz zaatakował cel", "tooltip_DOTA_UNIT_ORDER_CAST_POSITION": "Ile razy gracz rzucił zaklęcie na pozycję", "tooltip_DOTA_UNIT_ORDER_CAST_TARGET": "Ile razy gracz rzucił zaklęcie na cel", "tooltip_DOTA_UNIT_ORDER_CAST_NO_TARGET": "Ile razy gracz chybił celu przy użyciu zaklęcia", "tooltip_DOTA_UNIT_ORDER_HOLD_POSITION": "Ile razy gracz utrzymał pozycję", "tooltip_DOTA_UNIT_ORDER_GLYPH": "Ile razy gracz użył glifu", "tooltip_DOTA_UNIT_ORDER_RADAR": "Ile razy gracz użył skanu", "tooltip_last_played": "Ostatni raz mecz został rozegrany z tym graczem/bohaterem", "tooltip_matches": "Mecze rozegrane z/przeciwko temu bohaterowi", "tooltip_played_as": "Liczba meczy rozegranych tym bohaterem", "tooltip_played_with": "Liczba meczy rozegranych z tym graczem/bohaterem w drużynie", "tooltip_played_against": "Liczba meczy rozegranych z tym graczem/bohaterem po stronie przeciwnej", "tooltip_tombstone_victim": "Tu spoczywa", "tooltip_tombstone_killer": "zniszczone przez", "tooltip_win_pct_as": "Procent wygranych tym bohaterem", "tooltip_win_pct_with": "Liczba wygranych z tym graczem/bohaterem", "tooltip_win_pct_against": "Procent wygranych przeciwko temu graczowi/bohaterowi", "tooltip_lhten": "Ostatnie trafienia w 10 minucie", "tooltip_dnten": "Negacje w 10 minucie", "tooltip_biggest_hit": "Największe pojedyncze obrażenia zadane bohaterowi", "tooltip_damage_dealt": "Obrażenia zadane temu bohaterowi przez przedmioty/umiejętności", "tooltip_damage_received": "Obrażenia otrzymane od tego bohatera od przedmiotów/umiejętności", "tooltip_registered_user": "Zarejestrowany użytkownik", "tooltip_ability_builds": "Buildy umiejętności", "tooltip_ability_builds_expired": "Dane o ulepszeniach umiejętności wygasły dla tego meczu. Skorzystaj z formularza zapytania aby je odświeżyć.", "tooltip_multikill": "Najdłuższy multikill", "tooltip_killstreak": "Najdłuższa seria zabójstw", "tooltip_casts": "Ile razy umiejętność/zaklęcie zostały użyte", "tooltip_target_abilities": "How many times each hero was targeted by this hero's abilities", "tooltip_hits": "Liczba zadania obrażeń bohaterowi przy użyciu tej umiejętności/przedmiotu", "tooltip_damage": "Ilość obrażeń zadanych temu bohaterowi przez tą umiejętność/przedmiot", "tooltip_autoattack_other": "Auto-atak/Inne", "tooltip_estimated_mmr": "Szacowany MMR na podstawie udostępnionego MMR ostatnich meczy rozegranych przez tego gracza", "tooltip_backpack": "Plecak", "tooltip_others_tracked_deaths": "śledzone zgony", "tooltip_others_track_gold": "złoto zdobyte ze Śledzenia", "tooltip_others_greevils_gold": "złoto zdobyte za Złochciwość", "tooltip_advantage": "Obliczone na podstawie Wilson Score", "tooltip_winrate_samplesize": "Win rate and sample size", "tooltip_teamfight_participation": "Amount of participation in teamfights", "histograms_name": "Histogramy", "histograms_description": "Procenty oznaczają średnią wygranych dla oznaczonych przedziałów", "histograms_actions_per_min_description": "Actions performed by player per minute", "histograms_comeback_description": "Maximum gold disadvantage in a won game", "histograms_lane_efficiency_pct_description": "Percentage of lane gold (creeps+passive+starting) obtained at 10 minutes", "histograms_gold_per_min_description": "Gold farmed per minute", "histograms_hero_damage_description": "Amount of damage dealt to heroes", "histograms_hero_healing_description": "Amount of health restored to heroes", "histograms_level_description": "Level achieved in a game", "histograms_loss_description": "Maximum gold disadvantage in a lost game", "histograms_pings_description": "Number of times the player pinged the map", "histograms_stomp_description": "Maximum gold advantage in a won game", "histograms_stuns_description": "Seconds of disable on heroes", "histograms_throw_description": "Maximum gold advantage in a lost game", "histograms_purchase_tpscroll_description": "Town Portal Scroll purchases", "histograms_xp_per_min_description": "Experience gained per minute", "trends_name": "Trendy", "trends_description": "Zbiorcza średnia ostatnich 500 gier", "trends_tooltip_average": "Śr.", "trends_no_data": "Przykro nam, nie ma danych dla tego wykresu", "xp_reasons_0": "Inne", "xp_reasons_1": "Bohater", "xp_reasons_2": "Creep", "xp_reasons_3": "Roshan", "rankings_description": "", "rankings_none": "This player is not ranked on any heroes.", "region_0": "Automatycznie", "region_1": "Zachodnie USA", "region_2": "Wschodnie USA", "region_3": "Luksemburg", "region_5": "Singapur", "region_6": "Dubaj", "region_7": "Australia", "region_8": "Sztokholm", "region_9": "Austria", "region_10": "Brazylia", "region_11": "Afryka Południowa", "region_12": "Chiny TC, Szanghaj", "region_13": "Chiny TC", "region_14": "Chile", "region_15": "Peru", "region_16": "Indie", "region_17": "Chiny TC, Guangdong", "region_18": "Chiny TC, Zhejiang", "region_19": "Japonia", "region_20": "Chiny TC, Wuhan", "region_25": "Chiny 2", "vision_expired": "Wygasł po", "vision_destroyed": "Zniszczone po", "vision_all_time": "Łączny czas", "vision_placed_observer": "umieścił(a) Obserwatora w", "vision_placed_sentry": "umieścił(a) Wartownika w", "vision_ward_log": "Dziennik wardów", "chat_category_faction": "Drużyna", "chat_category_type": "Typ", "chat_category_target": "Cel", "chat_category_other": "Inne", "chat_filter_text": "Tekst", "chat_filter_phrases": "Wyrażenia", "chat_filter_audio": "Audio", "chat_filter_spam": "Spam", "chat_filter_all": "Wszystkie", "chat_filter_allies": "Sojusznicy", "chat_filter_spectator": "Widz", "chat_filtered": "Filtrowane", "advb_almost": "prawie", "advb_over": "ponad", "advb_about": "około", "article_before_consonant_sound": " ", "article_before_vowel_sound": " ", "statement_long": "postawił hipotezę", "statement_shouted": "krzyknął", "statement_excited": "wykrzyknął", "statement_normal": "powiedział", "statement_laughed": "śmiał się", "question_long": "zapytał, w potrzebie uzyskania odpowiedzi", "question_shouted": "dociekał", "question_excited": "pytał", "question_normal": "zapytał", "question_laughed": "śmiał się szyderczo", "statement_response_long": "doradził", "statement_response_shouted": "odpowiedział we frustracji", "statement_response_excited": "wykrzyknął", "statement_response_normal": "odpowiedział", "statement_response_laughed": "śmiał się", "statement_continued_long": "narzekał", "statement_continued_shouted": "kontynuował z wściekłością", "statement_continued_excited": "kontynuował", "statement_continued_normal": "dodał", "statement_continued_laughed": "kontynuował", "question_response_long": "doradził", "question_response_shouted": "z frustracji zapytał z powrotem", "question_response_excited": "spierał się", "question_response_normal": "skontrował", "question_response_laughed": "zaśmiał się", "question_continued_long": "zaproponował", "question_continued_shouted": "zapytał z furią", "question_continued_excited": "zapytał czule", "question_continued_normal": "zapytał", "question_continued_laughed": "zapytał radośnie", "hero_disclaimer_pro": "Dane z profesjonalnych meczów", "hero_disclaimer_public": "Dane z publicznych meczów", "hero_duration_x_axis": "Minuty", "top_tower": "Górna wieża", "bot_tower": "Dolna wieża", "mid_tower": "Środkowa wieża", "top_rax": "Górne koszary", "bot_rax": "Dolne koszary", "mid_rax": "Środkowe koszary", "tier1": "Tier 1", "tier2": "Tier 2", "tier3": "Tier 3", "tier4": "Tier 4", "show_consumables_items": "Pokaż jednorazowe przedmioty", "activated": "Aktywowany", "rune": "Runa", "placement": "Placement", "exclude_turbo_matches": "Exclude Turbo matches", "scenarios_subtitle": "Explore win rates of combinations of factors that happen in matches", "scenarios_info": "Data compiled from matches in the last {0} weeks", "scenarios_item_timings": "Item Timings", "scenarios_misc": "Misc", "scenarios_time": "Time", "scenarios_item": "Item", "scenarios_game_duration": "Game Duration", "scenarios_scenario": "Scenario", "scenarios_first_blood": "Team drew First Blood", "scenarios_courier_kill": "Team sniped the enemy courier before the 3-minute mark", "scenarios_pos_chat_1min": "Team all chatted positive words before the 1-minute mark", "scenarios_neg_chat_1min": "Team all chatted negative words before the 1-minute mark", "gosu_default": "Get personal recommendations", "gosu_benchmarks": "Get detailed benchmarks for your hero, lane and role", "gosu_performances": "Get your map control performance", "gosu_laning": "Get why you missed last hits", "gosu_combat": "Get why kills attempts were unsuccessful", "gosu_farm": "Get why you missed last hits", "gosu_vision": "Get how many heroes were killed under your wards", "gosu_actions": "Get your lost time from mouse usage vs hotkeys", "gosu_teamfights": "Get who to target during teamfights", "gosu_analysis": "Get your real MMR bracket", "back2Top": "Back to Top", "activity_subtitle": "Click on a day for detailed information" }
odota/web/src/lang/pl-PL.json/0
{ "file_path": "odota/web/src/lang/pl-PL.json", "repo_id": "odota", "token_count": 22988 }
267
export default (type, initialData) => (state = { loading: true, data: initialData || [], }, action) => { switch (action.type) { case `REQUEST/${type}`: return { ...state, loading: true, }; case `OK/${type}`: return { ...state, loading: false, data: action.payload, error: false, }; case `ERROR/${type}`: return { ...state, error: action.error || true, loading: false, }; case `QUERY/${type}`: return { ...state, query: action.query, }; default: return state; } };
odota/web/src/reducers/reducer.js/0
{ "file_path": "odota/web/src/reducers/reducer.js", "repo_id": "odota", "token_count": 315 }
268
{ "scenarios": { "itemCost": 1400, "timings": [ 450, 600, 720, 900, 1200, 1500, 1800 ], "gameDurationBucket": [ 900, 1800, 2700, 3600, 5400 ], "teamScenariosQueryParams": [ "pos_chat_1min", "neg_chat_1min", "courier_kill", "first_blood" ] }, "banner": null, "cheese": { "cheese": "33", "goal": "100" } }
odota/web/testcafe/cachedAjax/metadata_.json/0
{ "file_path": "odota/web/testcafe/cachedAjax/metadata_.json", "repo_id": "odota", "token_count": 220 }
269
{ "obs": { "68": { "130": 3, "132": 4 }, "72": { "114": 4 }, "74": { "98": 1, "114": 1, "118": 1, "152": 1, "156": 2 }, "76": { "80": 2, "82": 1, "97": 1, "98": 1, "100": 1, "102": 2, "114": 1, "126": 1, "128": 2, "130": 1, "144": 1, "148": 5, "150": 2, "152": 9, "154": 5, "156": 1, "158": 4, "160": 3, "164": 1 }, "77": { "149": 1 }, "78": { "80": 1, "100": 2, "102": 1, "112": 2, "114": 4, "116": 2, "124": 1, "134": 1, "136": 1, "150": 1, "152": 1, "154": 1, "158": 2, "160": 3, "162": 2, "164": 1 }, "79": { "159": 1 }, "80": { "80": 1, "98": 1, "100": 1, "112": 1, "114": 2, "116": 1, "130": 3, "132": 3, "146": 1, "150": 2, "151": 1, "152": 14, "154": 13, "156": 8, "158": 6, "162": 1, "168": 1, "170": 1, "172": 1 }, "81": { "151": 1, "152": 1, "153": 1, "154": 1, "156": 1 }, "82": { "112": 5, "122": 1, "128": 2, "130": 3, "132": 5, "134": 3, "138": 1, "148": 1, "152": 3, "154": 10, "156": 3, "164": 1, "168": 4, "170": 2 }, "84": { "76": 1, "78": 2, "96": 1, "102": 1, "110": 2, "112": 4, "114": 2, "126": 3, "128": 9, "130": 6, "132": 4, "133": 1, "148": 1, "150": 1, "152": 6, "156": 2, "158": 3, "162": 2, "164": 1, "168": 1, "170": 4 }, "85": { "102": 1, "132": 1 }, "86": { "76": 1, "100": 3, "102": 1, "108": 1, "110": 2, "130": 2, "132": 3, "142": 38, "144": 23, "152": 19, "154": 10, "156": 7, "160": 10, "162": 10, "164": 4 }, "87": { "153": 1 }, "88": { "74": 1, "78": 1, "88": 1, "92": 1, "104": 1, "106": 1, "108": 1, "110": 2, "124": 2, "136": 4, "142": 96, "144": 26, "152": 12, "154": 7, "156": 1, "158": 5, "160": 2, "162": 5, "164": 6 }, "89": { "124": 2 }, "90": { "78": 1, "96": 2, "98": 1, "106": 1, "108": 2, "110": 3, "112": 1, "122": 4, "124": 4, "130": 1, "136": 5, "152": 2, "154": 6, "156": 2, "158": 1, "160": 2, "162": 1, "164": 6, "170": 1, "176": 1 }, "91": { "110": 1 }, "92": { "80": 1, "84": 1, "92": 1, "94": 2, "96": 2, "98": 6, "108": 2, "110": 1, "116": 5, "118": 1, "122": 5, "124": 3, "130": 1, "134": 2, "136": 10, "152": 1, "154": 1, "158": 2, "160": 1, "162": 1, "164": 1, "166": 4 }, "93": { "110": 1 }, "94": { "92": 1, "94": 6, "96": 3, "110": 4, "112": 1, "116": 36, "118": 20, "134": 3, "136": 5, "138": 1, "140": 13, "142": 12, "154": 1, "162": 4, "164": 5, "166": 1 }, "96": { "78": 2, "90": 4, "110": 2, "112": 1, "122": 1, "134": 1, "138": 3, "140": 11, "152": 4, "154": 2, "158": 2, "160": 2, "164": 8, "166": 9 }, "98": { "72": 2, "76": 1, "78": 3, "80": 3, "82": 3, "86": 3, "88": 3, "90": 4, "96": 1, "102": 1, "104": 1, "114": 1, "128": 13, "130": 7, "142": 1, "144": 1, "152": 18, "154": 4, "156": 1, "158": 1, "160": 3, "162": 8, "164": 4, "166": 8, "168": 4, "172": 2 }, "99": { "174": 1 }, "100": { "75": 1, "76": 1, "78": 2, "82": 1, "100": 1, "102": 1, "106": 3, "114": 2, "116": 1, "118": 1, "120": 2, "128": 6, "130": 1, "134": 4, "136": 1, "138": 1, "142": 11, "143": 1, "144": 10, "148": 1, "152": 22, "154": 26, "156": 2, "158": 4, "160": 14, "162": 8, "164": 1, "166": 21, "168": 20, "170": 3, "172": 7, "174": 1 }, "101": { "143": 1 }, "102": { "94": 5, "96": 10, "98": 4, "114": 1, "116": 9, "118": 6, "128": 1, "131": 1, "134": 1, "152": 8, "154": 10, "156": 2, "158": 3, "162": 1, "164": 3, "166": 1, "168": 14, "172": 1 }, "103": { "97": 1, "98": 1 }, "104": { "88": 1, "92": 1, "94": 1, "96": 1, "100": 1, "106": 2, "112": 4, "114": 1, "118": 4, "120": 6, "130": 1, "132": 7, "134": 24, "152": 3, "154": 12, "156": 5, "158": 5, "160": 2, "166": 3, "168": 4 }, "105": { "121": 1, "127": 1 }, "106": { "90": 1, "92": 2, "94": 1, "98": 1, "100": 2, "102": 2, "104": 2, "108": 3, "110": 25, "112": 9, "118": 2, "120": 12, "122": 4, "124": 1, "128": 2, "130": 9, "132": 6, "134": 1, "152": 6, "154": 10, "156": 1, "158": 4, "160": 6, "164": 11, "165": 1, "166": 5, "168": 1, "186": 1 }, "107": { "110": 1, "165": 1 }, "108": { "76": 3, "78": 1, "80": 1, "86": 1, "98": 3, "100": 13, "101": 1, "102": 4, "106": 1, "108": 1, "110": 38, "112": 5, "114": 2, "120": 6, "122": 4, "124": 5, "126": 4, "128": 5, "130": 17, "132": 2, "154": 2, "156": 6, "158": 10, "160": 9, "162": 3, "166": 1, "168": 2, "174": 1, "184": 1, "186": 2 }, "109": { "130": 1 }, "110": { "98": 1, "99": 1, "100": 4, "112": 1, "114": 1, "128": 3, "130": 6, "134": 1, "146": 30, "148": 14, "154": 4, "162": 1, "164": 2, "166": 1, "168": 2, "172": 1, "174": 1, "178": 1, "186": 1 }, "111": { "124": 1, "130": 3, "146": 1, "147": 3, "148": 3 }, "112": { "100": 1, "102": 1, "114": 3, "116": 2, "124": 11, "126": 2, "128": 1, "130": 14, "132": 1, "144": 7, "146": 9, "148": 9, "156": 6, "158": 34, "160": 4, "164": 4, "166": 1, "168": 3, "172": 2, "174": 2, "178": 1 }, "113": { "133": 1 }, "114": { "84": 2, "86": 1, "92": 3, "93": 2, "104": 1, "106": 1, "108": 2, "110": 1, "114": 1, "116": 3, "122": 3, "124": 14, "126": 12, "128": 42, "130": 35, "132": 1, "140": 1, "144": 1, "152": 1, "154": 3, "156": 2, "158": 31, "160": 2, "164": 2, "166": 5, "172": 1, "174": 1, "176": 1 }, "115": { "92": 2, "93": 2, "163": 1 }, "116": { "78": 1, "82": 2, "84": 2, "92": 10, "94": 4, "100": 3, "102": 5, "104": 7, "106": 20, "108": 13, "116": 2, "122": 2, "124": 5, "126": 32, "128": 25, "130": 5, "142": 3, "144": 1, "148": 4, "150": 2, "152": 1, "154": 2, "158": 12, "160": 1, "164": 7, "166": 12, "172": 1, "178": 1 }, "117": { "166": 1 }, "118": { "74": 1, "76": 5, "78": 12, "80": 6, "82": 4, "84": 2, "86": 1, "90": 6, "92": 31, "94": 6, "102": 1, "104": 1, "106": 2, "108": 3, "110": 1, "118": 2, "122": 3, "124": 15, "126": 19, "136": 1, "138": 8, "148": 9, "150": 5, "158": 1, "159": 1, "160": 1, "162": 1, "164": 7, "166": 3 }, "119": { "79": 1, "137": 2 }, "120": { "78": 1, "84": 1, "86": 1, "88": 1, "90": 22, "92": 32, "94": 2, "96": 1, "106": 1, "110": 2, "118": 3, "120": 6, "122": 21, "123": 1, "136": 34, "137": 2, "138": 8, "142": 1, "144": 5, "146": 1, "154": 1, "164": 2, "166": 5, "168": 5, "174": 1, "178": 1 }, "122": { "78": 4, "92": 1, "96": 2, "110": 1, "112": 4, "114": 2, "116": 6, "118": 38, "120": 33, "130": 12, "132": 9, "134": 25, "136": 27, "138": 24, "148": 4, "150": 6, "164": 3, "166": 3, "168": 8, "170": 2, "174": 1 }, "123": { "138": 1 }, "124": { "78": 1, "92": 1, "94": 2, "96": 1, "98": 1, "112": 2, "114": 6, "116": 13, "118": 27, "120": 10, "128": 20, "130": 35, "131": 3, "132": 23, "134": 8, "136": 3, "138": 8, "140": 1, "142": 44, "146": 1, "148": 2, "150": 7, "158": 1, "160": 6, "162": 1, "164": 2, "172": 1 }, "126": { "80": 1, "94": 2, "106": 2, "108": 1, "114": 7, "116": 8, "118": 22, "120": 20, "122": 1, "126": 28, "128": 5, "129": 1, "130": 3, "132": 2, "134": 5, "136": 2, "138": 4, "142": 13, "144": 3, "146": 2, "156": 2, "158": 2, "160": 1 }, "127": { "120": 1, "128": 1 }, "128": { "76": 1, "84": 1, "94": 1, "112": 1, "116": 6, "118": 24, "119": 1, "120": 2, "124": 6, "126": 48, "127": 3, "128": 1, "132": 1, "134": 3, "142": 8, "144": 3, "146": 4, "148": 2, "150": 4, "156": 1, "160": 2, "162": 1 }, "129": { "107": 1, "118": 1, "155": 1 }, "130": { "78": 3, "82": 1, "84": 2, "86": 1, "94": 1, "96": 1, "106": 18, "108": 7, "110": 6, "112": 1, "116": 5, "118": 5, "124": 6, "126": 14, "142": 2, "144": 5, "146": 5, "150": 9, "152": 12, "154": 8, "156": 9, "158": 2, "160": 2, "166": 1, "168": 1, "170": 1 }, "131": { "111": 1 }, "132": { "74": 1, "78": 1, "82": 5, "84": 5, "86": 4, "88": 1, "90": 2, "96": 3, "98": 2, "102": 3, "104": 2, "106": 5, "108": 1, "112": 2, "116": 1, "118": 1, "122": 1, "124": 32, "132": 3, "144": 4, "146": 1, "150": 2, "168": 1, "178": 1 }, "133": { "77": 1, "78": 1 }, "134": { "72": 1, "74": 1, "76": 6, "78": 2, "82": 2, "84": 2, "85": 1, "86": 2, "88": 4, "90": 1, "92": 2, "96": 8, "98": 8, "100": 5, "102": 7, "104": 1, "105": 1, "106": 8, "108": 10, "110": 3, "116": 1, "122": 28, "123": 1, "128": 1, "130": 1, "132": 3, "144": 18, "146": 6, "162": 20, "164": 1 }, "135": { "92": 1, "146": 1 }, "136": { "78": 3, "82": 2, "84": 2, "86": 1, "88": 4, "90": 4, "92": 4, "94": 4, "96": 1, "98": 1, "100": 1, "106": 3, "108": 4, "112": 2, "114": 1, "120": 8, "122": 4, "124": 2, "126": 4, "128": 2, "132": 1, "134": 2, "136": 1, "138": 2, "140": 1, "142": 1, "143": 1, "144": 5, "146": 2, "148": 4, "150": 6, "162": 29, "164": 7, "165": 1, "170": 1, "172": 1 }, "137": { "93": 1 }, "138": { "78": 4, "82": 3, "84": 2, "86": 3, "88": 7, "90": 9, "92": 3, "94": 3, "96": 3, "98": 1, "110": 1, "112": 12, "114": 1, "120": 2, "122": 2, "124": 1, "130": 1, "132": 2, "136": 4, "138": 5, "140": 10, "141": 1, "142": 15, "144": 2, "154": 1, "158": 2, "162": 1, "168": 1, "172": 1, "174": 5, "176": 3, "178": 1 }, "139": { "91": 1, "106": 1, "173": 1 }, "140": { "78": 1, "84": 1, "85": 1, "86": 15, "88": 8, "90": 5, "92": 1, "94": 1, "96": 1, "104": 31, "106": 44, "108": 1, "120": 10, "132": 1, "134": 4, "136": 1, "138": 2, "140": 3, "144": 1, "150": 1, "158": 1, "174": 1, "176": 1 }, "141": { "86": 1 }, "142": { "78": 2, "80": 2, "82": 3, "84": 1, "86": 9, "88": 14, "90": 8, "92": 1, "94": 3, "96": 2, "98": 1, "100": 1, "102": 1, "104": 51, "106": 19, "118": 10, "120": 11, "132": 4, "133": 2, "134": 16, "136": 3, "152": 2, "154": 6 }, "143": { "81": 1, "92": 1, "118": 1 }, "144": { "78": 2, "80": 1, "88": 5, "90": 2, "92": 5, "94": 4, "96": 2, "98": 3, "100": 15, "102": 3, "118": 22, "120": 1, "128": 3, "134": 16, "136": 4, "160": 1 }, "145": { "79": 1, "93": 6 }, "146": { "72": 4, "78": 1, "80": 1, "86": 3, "88": 3, "89": 1, "90": 1, "94": 6, "96": 16, "98": 17, "100": 1, "102": 1, "118": 3, "120": 3, "124": 1, "126": 5, "128": 4, "134": 3, "136": 8, "146": 2, "152": 2, "158": 1, "160": 1 }, "147": { "88": 1, "96": 1, "118": 1 }, "148": { "70": 2, "72": 5, "86": 2, "88": 1, "90": 4, "94": 2, "96": 48, "98": 15, "100": 2, "104": 18, "106": 28, "118": 5, "120": 1, "124": 1, "128": 6, "130": 2, "138": 1, "140": 1, "144": 1, "146": 2, "148": 2, "150": 1, "152": 2, "156": 6 }, "149": { "106": 1 }, "150": { "80": 1, "82": 1, "86": 1, "90": 4, "92": 2, "96": 10, "98": 3, "102": 2, "104": 9, "106": 2, "124": 11, "126": 25, "128": 7, "140": 1, "142": 1, "144": 1, "146": 1, "152": 2, "154": 3, "156": 1 }, "152": { "78": 2, "80": 2, "86": 8, "94": 1, "96": 1, "102": 5, "104": 1, "114": 5, "116": 13, "124": 3, "126": 7, "128": 3, "138": 2, "146": 1, "148": 1, "152": 1, "156": 1, "160": 3, "162": 3, "168": 3, "170": 3 }, "153": { "103": 1, "116": 3 }, "154": { "78": 1, "80": 4, "86": 18, "88": 2, "92": 11, "96": 5, "100": 3, "114": 18, "116": 39, "118": 1, "120": 2, "126": 4, "127": 1, "130": 2, "134": 11, "138": 2, "146": 1, "148": 3, "150": 1, "152": 1, "160": 1, "166": 1 }, "156": { "78": 1, "79": 1, "80": 7, "82": 8, "86": 15, "88": 21, "90": 10, "92": 2, "94": 3, "96": 17, "100": 1, "116": 1, "122": 1, "126": 3, "128": 1, "134": 10, "138": 1, "140": 1, "142": 2, "144": 1, "148": 1, "150": 1, "152": 1, "156": 1, "172": 1 }, "157": { "80": 1, "109": 1 }, "158": { "80": 4, "81": 1, "82": 6, "86": 3, "87": 1, "88": 15, "90": 5, "92": 4, "96": 6, "100": 10, "101": 1, "102": 7, "108": 4, "112": 5, "114": 3, "116": 1, "118": 1, "136": 8, "138": 1, "144": 8, "146": 4, "150": 1, "152": 1, "156": 2 }, "160": { "82": 1, "86": 3, "88": 13, "90": 7, "96": 1, "102": 1, "110": 2, "112": 2, "136": 6, "138": 5, "144": 1, "146": 3, "148": 1, "152": 3, "154": 3, "156": 2, "158": 1 }, "161": { "88": 1, "95": 1, "120": 1 }, "162": { "86": 6, "88": 3, "90": 12, "102": 1, "114": 10, "116": 26, "118": 5, "126": 1, "138": 1, "152": 1, "154": 2, "156": 1, "158": 1 }, "163": { "91": 1, "117": 2 }, "164": { "78": 2, "86": 1, "88": 6, "90": 6, "92": 5, "94": 1, "96": 3, "98": 2, "102": 3, "114": 8, "116": 8, "117": 3, "118": 7, "126": 4, "150": 1 }, "166": { "78": 1, "80": 1, "86": 1, "88": 8, "92": 7, "96": 14, "98": 3, "100": 6, "102": 15, "120": 34, "122": 9, "126": 5, "132": 16, "134": 10, "148": 3, "150": 4, "152": 1, "154": 1 }, "167": { "150": 1 }, "168": { "86": 1, "88": 12, "90": 10, "92": 2, "94": 5, "96": 2, "98": 5, "100": 4, "102": 7, "110": 1, "120": 17, "122": 8, "126": 1, "132": 10, "134": 17, "136": 3, "148": 6, "150": 3 }, "169": { "135": 1 }, "170": { "86": 5, "88": 1, "90": 1, "94": 1, "100": 8, "102": 8, "104": 2, "106": 6, "108": 4, "128": 1, "134": 1, "136": 1, "148": 1 }, "171": { "87": 2 }, "172": { "82": 3, "88": 3, "94": 1, "100": 10, "102": 14, "104": 2, "106": 1, "108": 2, "164": 1 }, "174": { "80": 1, "82": 1, "84": 4, "86": 3, "88": 1, "90": 2, "94": 3, "96": 7, "98": 9, "100": 5, "102": 1, "104": 1, "105": 1, "106": 2, "108": 1, "110": 2, "122": 6, "124": 1, "132": 1, "134": 1 }, "176": { "82": 1, "86": 6, "88": 5, "90": 1, "92": 2, "94": 4, "96": 2, "98": 1, "100": 1, "102": 1, "104": 2, "106": 1, "118": 1, "122": 7, "132": 1, "134": 1, "148": 6, "150": 1, "154": 1, "172": 2 }, "177": { "95": 1, "152": 1 }, "178": { "92": 3, "94": 7, "96": 5, "98": 1, "100": 7, "102": 5, "104": 2, "106": 8, "108": 1, "110": 1, "112": 1, "116": 1, "118": 2, "122": 2, "126": 1, "134": 3, "148": 1, "158": 1, "160": 1, "162": 1, "168": 1 }, "179": { "98": 1, "163": 1 }, "180": { "100": 1, "102": 2, "104": 3, "106": 1, "108": 1, "132": 1, "148": 1, "154": 1, "164": 1, "168": 2 }, "182": { "102": 4, "108": 1, "134": 1, "136": 1, "156": 1 }, "184": { "102": 2, "104": 1, "106": 2, "146": 1 }, "186": { "124": 2, "126": 2 }, "188": { "124": 3, "126": 4 }, "189": { "119": 1 } }, "sen": { "68": { "132": 1 }, "70": { "159": 1 }, "72": { "86": 1, "108": 1 }, "74": { "108": 2, "114": 1, "116": 1 }, "76": { "96": 1, "102": 1, "114": 4, "116": 1, "124": 1, "132": 1, "148": 1, "150": 1, "152": 1, "154": 2, "156": 2 }, "78": { "92": 1, "98": 1, "102": 1, "114": 3, "120": 1, "122": 1, "126": 1, "152": 3, "154": 5, "156": 4, "158": 3, "166": 1 }, "80": { "98": 2, "100": 1, "102": 1, "114": 2, "126": 1, "128": 1, "130": 4, "134": 1, "142": 1, "146": 1, "148": 2, "150": 5, "152": 8, "154": 22, "156": 14, "158": 1, "160": 3, "162": 1, "164": 1, "166": 1, "168": 2 }, "81": { "136": 1, "152": 1 }, "82": { "80": 1, "92": 1, "112": 4, "126": 2, "128": 1, "130": 1, "132": 2, "134": 3, "144": 1, "150": 1, "152": 7, "154": 21, "156": 27, "158": 5, "160": 10, "162": 6, "164": 4, "166": 3, "168": 1, "172": 1 }, "84": { "96": 1, "100": 3, "106": 1, "110": 1, "130": 5, "132": 3, "138": 2, "148": 7, "152": 5, "154": 12, "156": 12, "158": 8, "160": 4, "162": 5, "164": 5, "166": 2, "168": 2, "170": 2 }, "85": { "162": 1 }, "86": { "76": 1, "84": 1, "98": 1, "100": 4, "102": 1, "110": 1, "116": 1, "128": 1, "130": 1, "132": 1, "134": 2, "138": 1, "142": 36, "144": 7, "154": 3, "156": 12, "158": 4, "160": 7, "162": 2, "166": 2 }, "87": { "159": 1, "160": 1 }, "88": { "76": 2, "85": 1, "96": 1, "98": 2, "110": 3, "112": 1, "114": 2, "116": 1, "118": 1, "130": 1, "142": 42, "144": 6, "148": 1, "152": 2, "154": 3, "156": 6, "158": 4, "159": 1, "160": 3, "162": 1 }, "89": { "77": 1 }, "90": { "78": 1, "80": 1, "84": 1, "96": 1, "108": 1, "110": 2, "112": 1, "114": 2, "116": 1, "122": 2, "124": 1, "126": 1, "136": 2, "138": 2, "140": 5, "142": 6, "158": 2, "162": 1 }, "91": { "162": 1 }, "92": { "76": 1, "78": 1, "88": 1, "90": 1, "92": 1, "94": 2, "96": 2, "98": 2, "100": 1, "102": 1, "110": 3, "112": 1, "114": 2, "116": 8, "118": 5, "122": 5, "124": 1, "130": 1, "134": 3, "136": 5, "138": 3, "140": 8, "142": 12, "150": 4, "154": 1, "160": 2, "164": 1, "182": 2 }, "93": { "163": 1 }, "94": { "76": 1, "78": 1, "80": 1, "84": 1, "88": 1, "92": 4, "94": 2, "96": 1, "98": 1, "106": 3, "108": 1, "110": 1, "112": 2, "114": 1, "116": 17, "118": 17, "120": 2, "126": 3, "128": 1, "134": 1, "136": 1, "138": 1, "140": 1, "150": 3, "158": 5, "160": 2, "162": 2, "164": 1 }, "95": { "162": 1, "164": 1 }, "96": { "76": 1, "78": 1, "86": 1, "88": 7, "90": 3, "92": 2, "96": 1, "98": 1, "100": 1, "112": 1, "116": 1, "118": 1, "120": 2, "124": 3, "126": 8, "128": 1, "138": 1, "140": 1, "142": 2, "154": 1, "156": 2, "158": 2, "160": 1, "162": 3, "164": 6, "166": 2, "168": 1, "172": 1, "178": 1 }, "97": { "80": 1 }, "98": { "78": 4, "80": 1, "86": 2, "90": 1, "96": 3, "98": 1, "100": 1, "104": 1, "108": 1, "114": 2, "116": 3, "118": 5, "128": 8, "130": 1, "134": 1, "136": 1, "138": 3, "144": 1, "146": 1, "152": 4, "154": 3, "156": 7, "158": 7, "160": 2, "162": 2, "164": 3, "166": 3, "168": 3, "170": 2 }, "99": { "98": 1 }, "100": { "74": 1, "88": 1, "96": 2, "98": 4, "102": 1, "106": 1, "114": 2, "116": 3, "118": 1, "120": 1, "128": 2, "130": 1, "134": 3, "138": 1, "140": 1, "142": 4, "148": 1, "152": 1, "154": 6, "156": 14, "157": 1, "158": 5, "162": 8, "163": 1, "164": 2, "166": 1, "168": 6, "170": 6, "172": 2 }, "101": { "143": 1 }, "102": { "78": 1, "96": 3, "98": 1, "100": 1, "102": 1, "106": 1, "108": 1, "112": 4, "114": 3, "116": 1, "118": 3, "126": 1, "127": 1, "128": 2, "134": 1, "136": 5, "154": 9, "156": 25, "158": 5, "160": 1, "162": 1, "166": 4, "168": 4, "170": 1, "172": 1 }, "103": { "109": 1, "131": 1 }, "104": { "78": 2, "80": 1, "84": 1, "96": 2, "98": 3, "100": 2, "108": 2, "110": 2, "112": 7, "118": 6, "120": 11, "122": 2, "128": 5, "129": 1, "130": 1, "132": 7, "134": 14, "138": 1, "142": 1, "144": 1, "154": 8, "156": 16, "158": 4, "160": 2, "162": 2, "166": 2, "168": 5 }, "105": { "130": 1 }, "106": { "80": 1, "96": 3, "98": 7, "100": 4, "102": 1, "104": 1, "106": 2, "108": 1, "110": 8, "112": 3, "114": 1, "120": 1, "122": 1, "124": 1, "128": 2, "130": 3, "134": 2, "136": 1, "144": 1, "152": 1, "154": 2, "156": 4, "158": 3, "160": 5, "162": 1, "166": 3 }, "108": { "78": 1, "82": 1, "98": 7, "100": 3, "108": 1, "110": 8, "112": 5, "122": 2, "124": 3, "126": 9, "128": 6, "130": 21, "132": 4, "134": 7, "136": 2, "142": 1, "150": 1, "154": 1, "156": 1, "158": 1, "160": 1, "162": 1, "164": 5, "166": 1, "168": 2, "174": 1 }, "110": { "76": 1, "92": 1, "98": 3, "100": 1, "104": 1, "108": 1, "112": 2, "124": 3, "126": 1, "128": 8, "130": 21, "134": 1, "136": 1, "138": 3, "146": 13, "148": 5, "154": 2, "162": 2, "164": 1 }, "111": { "146": 1, "147": 1 }, "112": { "96": 1, "100": 3, "102": 3, "104": 1, "108": 2, "112": 1, "124": 1, "126": 3, "128": 8, "130": 14, "132": 1, "138": 1, "140": 1, "144": 5, "146": 6, "154": 1, "156": 3, "158": 11, "160": 2, "164": 3, "166": 2, "172": 1 }, "114": { "92": 2, "94": 3, "96": 2, "98": 1, "102": 1, "104": 1, "108": 1, "110": 1, "112": 2, "114": 1, "118": 2, "124": 2, "126": 13, "128": 13, "130": 5, "131": 1, "132": 2, "134": 3, "136": 5, "138": 2, "146": 1, "148": 1, "152": 1, "154": 1, "156": 2, "158": 26, "160": 1, "162": 1, "164": 2, "166": 4 }, "115": { "93": 1, "104": 1, "163": 1 }, "116": { "78": 2, "82": 1, "84": 1, "92": 9, "94": 3, "96": 2, "100": 1, "102": 1, "104": 4, "106": 5, "108": 6, "110": 1, "116": 3, "118": 1, "122": 3, "124": 7, "126": 4, "128": 5, "130": 2, "132": 1, "134": 4, "136": 2, "138": 5, "140": 2, "144": 1, "146": 1, "148": 2, "152": 2, "154": 1, "156": 2, "158": 5, "160": 1, "162": 3, "164": 5, "166": 5, "170": 1, "174": 1 }, "117": { "107": 1 }, "118": { "76": 2, "78": 4, "80": 5, "82": 2, "84": 3, "90": 4, "92": 10, "94": 4, "96": 2, "100": 1, "102": 1, "104": 3, "106": 3, "108": 6, "110": 3, "118": 1, "120": 3, "122": 1, "124": 2, "126": 5, "128": 6, "130": 5, "132": 9, "134": 6, "136": 4, "138": 2, "140": 2, "142": 1, "148": 12, "150": 2, "154": 1, "158": 2, "160": 5, "162": 7, "164": 5, "166": 9, "168": 1, "170": 1, "176": 1 }, "119": { "123": 1, "159": 1, "161": 1, "164": 1 }, "120": { "76": 2, "78": 3, "80": 1, "82": 2, "84": 1, "86": 1, "90": 14, "92": 12, "94": 4, "96": 1, "98": 1, "108": 1, "110": 6, "112": 2, "114": 2, "116": 2, "120": 11, "122": 6, "124": 4, "126": 11, "128": 14, "130": 3, "132": 11, "134": 5, "136": 8, "138": 2, "140": 4, "146": 1, "152": 1, "154": 1, "156": 1, "162": 3, "166": 3, "170": 1, "174": 1, "178": 1 }, "121": { "99": 1 }, "122": { "90": 1, "92": 1, "94": 2, "96": 2, "101": 1, "106": 1, "110": 2, "112": 3, "114": 4, "116": 3, "118": 16, "120": 16, "122": 17, "124": 30, "126": 31, "128": 5, "130": 2, "132": 1, "134": 3, "136": 10, "138": 20, "140": 1, "148": 3, "150": 1, "152": 1, "154": 1, "156": 1, "158": 2, "160": 2, "164": 2, "166": 2, "168": 3, "170": 1 }, "123": { "124": 2, "125": 2 }, "124": { "78": 1, "92": 3, "94": 4, "106": 1, "108": 3, "110": 2, "112": 1, "114": 1, "116": 4, "118": 10, "120": 6, "122": 44, "124": 59, "126": 23, "128": 8, "130": 8, "132": 10, "134": 9, "136": 12, "138": 15, "140": 12, "142": 6, "146": 2, "150": 1, "152": 1, "160": 3, "162": 1, "164": 2 }, "125": { "126": 1, "131": 1, "136": 1, "137": 1 }, "126": { "80": 1, "94": 1, "100": 1, "104": 1, "106": 1, "108": 1, "116": 2, "118": 5, "120": 9, "122": 45, "123": 2, "124": 21, "126": 17, "128": 3, "130": 2, "132": 2, "134": 4, "135": 1, "136": 3, "138": 3, "140": 4, "142": 4, "144": 14, "145": 1, "146": 11, "148": 3, "154": 1, "156": 1, "158": 1, "160": 1, "170": 1 }, "127": { "128": 1, "131": 1, "132": 1 }, "128": { "82": 1, "88": 1, "96": 1, "106": 4, "108": 1, "118": 1, "120": 1, "122": 24, "124": 1, "126": 7, "128": 2, "132": 1, "134": 1, "136": 1, "142": 5, "144": 9, "146": 15, "148": 4, "150": 3, "152": 2, "154": 1, "158": 2, "160": 2, "167": 1 }, "129": { "146": 1, "147": 1 }, "130": { "78": 1, "82": 1, "96": 1, "106": 11, "108": 1, "110": 1, "120": 2, "122": 12, "124": 1, "126": 5, "132": 1, "144": 18, "146": 9, "148": 6, "150": 2, "152": 4, "154": 4, "156": 4, "158": 2, "160": 5, "162": 6, "164": 1 }, "131": { "121": 1, "151": 1 }, "132": { "76": 1, "82": 4, "84": 3, "86": 1, "88": 1, "94": 1, "96": 1, "98": 1, "104": 2, "106": 12, "108": 3, "110": 1, "112": 2, "120": 11, "122": 3, "126": 2, "128": 1, "132": 2, "144": 6, "146": 3, "150": 2, "151": 1, "156": 1, "158": 1, "160": 1, "162": 1, "164": 1 }, "133": { "128": 1 }, "134": { "78": 1, "80": 2, "82": 3, "84": 1, "96": 2, "97": 1, "98": 4, "104": 5, "105": 1, "106": 12, "108": 2, "120": 3, "126": 2, "128": 1, "144": 9, "146": 1, "152": 1, "156": 1, "158": 1, "160": 2, "162": 20, "164": 2, "166": 1, "168": 1, "176": 1 }, "135": { "144": 1, "159": 1 }, "136": { "78": 1, "80": 3, "84": 10, "86": 4, "88": 2, "90": 1, "92": 3, "94": 1, "98": 1, "102": 1, "104": 1, "106": 4, "108": 5, "110": 2, "112": 2, "118": 2, "120": 1, "122": 2, "124": 1, "132": 1, "134": 1, "140": 1, "142": 3, "143": 1, "144": 3, "146": 1, "150": 1, "156": 1, "158": 1, "162": 25, "164": 3, "166": 1, "168": 2, "172": 1, "174": 1 }, "138": { "78": 1, "80": 1, "82": 2, "84": 4, "86": 11, "88": 9, "90": 7, "92": 1, "94": 3, "104": 1, "106": 2, "108": 4, "110": 2, "112": 1, "116": 1, "118": 2, "128": 1, "138": 1, "140": 4, "142": 9, "144": 4, "146": 1, "156": 1, "158": 5, "160": 4, "162": 1, "172": 2, "174": 1, "176": 2, "180": 1 }, "139": { "101": 2 }, "140": { "78": 1, "80": 1, "82": 1, "84": 2, "86": 7, "88": 12, "90": 2, "92": 2, "94": 1, "104": 10, "106": 7, "108": 5, "116": 1, "118": 1, "120": 2, "122": 2, "124": 1, "130": 2, "132": 5, "134": 4, "136": 4, "138": 5, "140": 2, "142": 1, "152": 1, "154": 1, "162": 1, "170": 1 }, "141": { "80": 1, "91": 1, "132": 1 }, "142": { "80": 1, "82": 1, "86": 4, "88": 8, "90": 6, "92": 1, "94": 3, "96": 1, "98": 2, "100": 1, "104": 27, "106": 17, "108": 3, "114": 1, "116": 1, "118": 2, "120": 3, "122": 1, "126": 1, "128": 1, "130": 2, "132": 8, "133": 1, "134": 7, "136": 5, "138": 1, "154": 2 }, "143": { "87": 1, "105": 1, "106": 1, "107": 1, "133": 1, "134": 1 }, "144": { "74": 1, "78": 1, "80": 1, "86": 1, "88": 5, "90": 1, "92": 3, "94": 2, "96": 2, "98": 5, "100": 6, "102": 8, "104": 31, "105": 1, "106": 27, "107": 1, "112": 1, "116": 1, "118": 5, "126": 1, "134": 6, "135": 1, "136": 1, "142": 1, "148": 1, "152": 2, "156": 1, "158": 2 }, "145": { "93": 2 }, "146": { "70": 2, "74": 1, "86": 3, "88": 1, "92": 3, "94": 2, "96": 13, "98": 12, "100": 7, "102": 5, "104": 3, "106": 3, "108": 1, "112": 1, "116": 3, "118": 7, "120": 3, "136": 2, "138": 1, "146": 1, "154": 1, "156": 1 }, "147": { "110": 1 }, "148": { "72": 1, "86": 4, "88": 2, "90": 1, "92": 2, "93": 1, "94": 3, "96": 2, "98": 3, "100": 3, "104": 2, "108": 1, "110": 3, "112": 1, "116": 1, "118": 6, "120": 1, "130": 1, "136": 1, "140": 2, "144": 1, "146": 1, "150": 2, "154": 3, "156": 1, "157": 1, "176": 1 }, "150": { "82": 2, "84": 1, "85": 1, "86": 5, "90": 3, "92": 3, "96": 1, "98": 2, "100": 1, "102": 3, "104": 1, "108": 2, "110": 1, "112": 1, "114": 8, "116": 8, "118": 7, "120": 2, "122": 1, "124": 3, "126": 2, "128": 2, "130": 2, "132": 1, "138": 1, "140": 1, "142": 1, "150": 1, "152": 5, "154": 5, "156": 3, "160": 2, "172": 1 }, "151": { "113": 1, "122": 1 }, "152": { "82": 1, "86": 13, "92": 3, "94": 1, "96": 8, "98": 1, "100": 4, "102": 1, "106": 1, "110": 2, "112": 3, "114": 3, "116": 6, "118": 2, "120": 1, "122": 2, "124": 3, "126": 6, "128": 3, "132": 3, "140": 1, "154": 3, "158": 1 }, "153": { "95": 1, "107": 1, "122": 1 }, "154": { "80": 2, "82": 5, "84": 4, "86": 8, "88": 4, "92": 5, "94": 7, "96": 7, "98": 3, "100": 2, "102": 1, "104": 1, "110": 3, "114": 5, "116": 19, "118": 3, "122": 1, "126": 3, "128": 4, "130": 1, "132": 3, "134": 8, "136": 2, "138": 6, "146": 1, "148": 1, "150": 1, "152": 1, "160": 2, "162": 3, "164": 4, "166": 1, "176": 1 }, "156": { "80": 1, "82": 5, "84": 3, "86": 7, "88": 3, "92": 9, "93": 4, "94": 4, "96": 11, "98": 1, "100": 2, "102": 2, "104": 1, "114": 2, "116": 2, "120": 2, "124": 1, "128": 1, "129": 1, "132": 2, "134": 6, "136": 2, "138": 3, "140": 4, "142": 1, "146": 1, "150": 1, "152": 1, "154": 1, "156": 1, "160": 1, "162": 1, "164": 2, "168": 3, "170": 1 }, "157": { "100": 1, "134": 1 }, "158": { "80": 1, "82": 1, "86": 7, "88": 3, "90": 4, "92": 5, "94": 1, "96": 2, "100": 3, "106": 1, "108": 4, "110": 1, "112": 4, "114": 12, "116": 8, "124": 1, "127": 1, "128": 1, "130": 2, "134": 4, "136": 6, "138": 1, "144": 5, "146": 2, "148": 2, "150": 2, "154": 1 }, "159": { "109": 1, "118": 2, "151": 1 }, "160": { "84": 1, "86": 3, "87": 1, "88": 6, "90": 4, "92": 5, "98": 1, "102": 1, "112": 1, "114": 3, "116": 4, "120": 2, "122": 1, "124": 1, "130": 2, "136": 1, "144": 1, "146": 1, "148": 1, "150": 1, "152": 2, "154": 3, "156": 1 }, "161": { "88": 2 }, "162": { "86": 2, "88": 4, "90": 3, "92": 2, "94": 1, "96": 5, "98": 4, "102": 3, "104": 2, "114": 12, "116": 12, "118": 15, "124": 2, "130": 1, "136": 1, "146": 1, "152": 1, "154": 1, "156": 2, "158": 2 }, "163": { "117": 1 }, "164": { "72": 1, "84": 1, "86": 2, "88": 3, "90": 5, "92": 7, "94": 3, "96": 1, "98": 2, "104": 1, "114": 14, "116": 9, "117": 1, "118": 9, "120": 3, "122": 1, "128": 2, "130": 2, "134": 2, "136": 1, "146": 1, "150": 3, "152": 2, "153": 1, "154": 1 }, "165": { "93": 1, "125": 1 }, "166": { "88": 6, "90": 3, "92": 7, "94": 4, "96": 5, "98": 3, "100": 12, "104": 1, "116": 3, "118": 2, "120": 24, "122": 12, "126": 8, "128": 2, "130": 1, "132": 6, "134": 4, "146": 2, "150": 3, "152": 2, "154": 1 }, "168": { "78": 1, "86": 2, "88": 6, "90": 9, "92": 2, "94": 1, "96": 3, "98": 10, "100": 5, "102": 1, "114": 1, "118": 2, "120": 25, "122": 9, "124": 1, "126": 13, "128": 5, "132": 1, "134": 16, "142": 1, "148": 3, "150": 4, "152": 1 }, "169": { "87": 1, "135": 1 }, "170": { "86": 2, "88": 8, "90": 2, "92": 5, "94": 3, "96": 5, "98": 10, "100": 29, "102": 12, "104": 1, "110": 1, "122": 2, "124": 1, "134": 6, "136": 5, "138": 1 }, "172": { "86": 3, "88": 4, "90": 2, "92": 7, "94": 4, "96": 7, "98": 21, "99": 1, "100": 29, "101": 1, "102": 7, "104": 6, "106": 1, "108": 1, "112": 2, "118": 2, "122": 2, "124": 3, "134": 1, "148": 1, "150": 1, "172": 1, "178": 1 }, "173": { "100": 1, "101": 1, "105": 1 }, "174": { "82": 1, "86": 3, "90": 1, "92": 3, "96": 1, "98": 9, "100": 15, "102": 11, "103": 1, "104": 1, "106": 1, "108": 1, "112": 1, "122": 3, "134": 1, "138": 1, "158": 1, "164": 1, "166": 1, "172": 1, "174": 2, "176": 1 }, "176": { "84": 1, "86": 1, "88": 2, "90": 1, "92": 1, "94": 1, "96": 3, "98": 2, "100": 5, "101": 1, "102": 4, "106": 2, "108": 1, "120": 1, "121": 1, "126": 1, "132": 1, "134": 1, "148": 1, "172": 3, "174": 1 }, "178": { "86": 1, "90": 1, "94": 2, "96": 2, "98": 5, "100": 9, "102": 6, "104": 1, "106": 2, "108": 1, "112": 1, "114": 1, "116": 1, "122": 2, "134": 1, "146": 1, "150": 1, "154": 1, "162": 1, "166": 2, "170": 2, "172": 2, "174": 1 }, "180": { "92": 1, "94": 1, "100": 1, "102": 3, "104": 1, "106": 1, "118": 1, "122": 1, "128": 1, "138": 1, "142": 1, "160": 1, "162": 2, "164": 2, "166": 4, "168": 2, "170": 1 }, "182": { "98": 1, "122": 1, "124": 1, "128": 1, "150": 1, "152": 1, "154": 1, "168": 1 }, "184": { "102": 1, "124": 1 }, "188": { "126": 2 } } }
odota/web/testcafe/cachedAjax/players_101695162_wardmap_.json/0
{ "file_path": "odota/web/testcafe/cachedAjax/players_101695162_wardmap_.json", "repo_id": "odota", "token_count": 26024 }
270
[ { "match_id": "4107465989", "start_time": "1536430481", "hero_id": "53", "score": "38242" }, { "match_id": "4108053928", "start_time": "1536464340", "hero_id": "56", "score": "38068" }, { "match_id": "4098859341", "start_time": "1536008072", "hero_id": "56", "score": "37792" }, { "match_id": "4103333263", "start_time": "1536241054", "hero_id": "77", "score": "33108" }, { "match_id": "4094804193", "start_time": "1535817435", "hero_id": "53", "score": "33014" }, { "match_id": "4105004714", "start_time": "1536327753", "hero_id": "80", "score": "32304" }, { "match_id": "4098774282", "start_time": "1536002766", "hero_id": "53", "score": "31612" }, { "match_id": "4111206450", "start_time": "1536598802", "hero_id": "56", "score": "31155" }, { "match_id": "4097516580", "start_time": "1535944570", "hero_id": "27", "score": "30931" }, { "match_id": "4100064588", "start_time": "1536075733", "hero_id": "53", "score": "30795" }, { "match_id": "4099377482", "start_time": "1536048188", "hero_id": "80", "score": "30534" }, { "match_id": "4101690049", "start_time": "1536157532", "hero_id": "77", "score": "30306" }, { "match_id": "4109996992", "start_time": "1536544413", "hero_id": "53", "score": "30300" }, { "match_id": "4111123001", "start_time": "1536595463", "hero_id": "56", "score": "30199" }, { "match_id": "4100629813", "start_time": "1536113343", "hero_id": "80", "score": "30124" }, { "match_id": "4110346933", "start_time": "1536566500", "hero_id": "104", "score": "30022" }, { "match_id": "4103882230", "start_time": "1536266394", "hero_id": "27", "score": "29857" }, { "match_id": "4103389487", "start_time": "1536242786", "hero_id": "53", "score": "29606" }, { "match_id": "4104209732", "start_time": "1536292971", "hero_id": "53", "score": "29583" }, { "match_id": "4094498252", "start_time": "1535808723", "hero_id": "56", "score": "29142" }, { "match_id": "4102699591", "start_time": "1536214643", "hero_id": "82", "score": "28974" }, { "match_id": "4095944451", "start_time": "1535874173", "hero_id": "53", "score": "28952" }, { "match_id": "4107185672", "start_time": "1536420996", "hero_id": "53", "score": "28753" }, { "match_id": "4102100221", "start_time": "1536173192", "hero_id": "53", "score": "28534" }, { "match_id": "4103546133", "start_time": "1536249522", "hero_id": "56", "score": "28511" }, { "match_id": "4103032006", "start_time": "1536230475", "hero_id": "56", "score": "28318" }, { "match_id": "4107639079", "start_time": "1536438008", "hero_id": "53", "score": "28248" }, { "match_id": "4105754953", "start_time": "1536358362", "hero_id": "82", "score": "28191" }, { "match_id": "4107757579", "start_time": "1536444934", "hero_id": "82", "score": "28140" }, { "match_id": "4099249866", "start_time": "1536040171", "hero_id": "56", "score": "27990" }, { "match_id": "4111379716", "start_time": "1536607080", "hero_id": "53", "score": "27926" }, { "match_id": "4094546484", "start_time": "1535810133", "hero_id": "53", "score": "27864" }, { "match_id": "4109592737", "start_time": "1536516358", "hero_id": "53", "score": "27737" }, { "match_id": "4109873981", "start_time": "1536533613", "hero_id": "56", "score": "27713" }, { "match_id": "4097819904", "start_time": "1535963983", "hero_id": "35", "score": "27576" }, { "match_id": "4108146684", "start_time": "1536468690", "hero_id": "53", "score": "27556" }, { "match_id": "4108173752", "start_time": "1536469838", "hero_id": "56", "score": "27553" }, { "match_id": "4110234470", "start_time": "1536560311", "hero_id": "56", "score": "27522" }, { "match_id": "4107002679", "start_time": "1536413607", "hero_id": "6", "score": "27440" }, { "match_id": "4101109704", "start_time": "1536138043", "hero_id": "80", "score": "27381" }, { "match_id": "4095847418", "start_time": "1535870612", "hero_id": "27", "score": "27337" }, { "match_id": "4096195819", "start_time": "1535882831", "hero_id": "56", "score": "27293" }, { "match_id": "4104366447", "start_time": "1536302110", "hero_id": "1", "score": "27258" }, { "match_id": "4094471338", "start_time": "1535807965", "hero_id": "53", "score": "27184" }, { "match_id": "4098605550", "start_time": "1535994536", "hero_id": "53", "score": "27154" }, { "match_id": "4100948222", "start_time": "1536130997", "hero_id": "104", "score": "27109" }, { "match_id": "4103810584", "start_time": "1536261711", "hero_id": "80", "score": "27106" }, { "match_id": "4107775657", "start_time": "1536446221", "hero_id": "1", "score": "27070" }, { "match_id": "4101664916", "start_time": "1536156811", "hero_id": "56", "score": "27056" }, { "match_id": "4110675881", "start_time": "1536581037", "hero_id": "27", "score": "27020" }, { "match_id": "4100156521", "start_time": "1536079348", "hero_id": "56", "score": "26976" }, { "match_id": "4105703567", "start_time": "1536354682", "hero_id": "104", "score": "26927" }, { "match_id": "4104505020", "start_time": "1536309099", "hero_id": "104", "score": "26903" }, { "match_id": "4111219467", "start_time": "1536599361", "hero_id": "56", "score": "26867" }, { "match_id": "4093467153", "start_time": "1535766514", "hero_id": "1", "score": "26848" }, { "match_id": "4094799924", "start_time": "1535817307", "hero_id": "48", "score": "26829" }, { "match_id": "4109972576", "start_time": "1536542501", "hero_id": "1", "score": "26813" }, { "match_id": "4103443102", "start_time": "1536245674", "hero_id": "56", "score": "26775" }, { "match_id": "4109359078", "start_time": "1536507364", "hero_id": "95", "score": "26747" }, { "match_id": "4095991930", "start_time": "1535875829", "hero_id": "56", "score": "26721" }, { "match_id": "4102079947", "start_time": "1536172187", "hero_id": "56", "score": "26716" }, { "match_id": "4106176827", "start_time": "1536384809", "hero_id": "56", "score": "26705" }, { "match_id": "4098831530", "start_time": "1536006167", "hero_id": "56", "score": "26635" }, { "match_id": "4104361516", "start_time": "1536301845", "hero_id": "56", "score": "26629" }, { "match_id": "4098971999", "start_time": "1536017772", "hero_id": "56", "score": "26585" }, { "match_id": "4097719555", "start_time": "1535958295", "hero_id": "56", "score": "26547" }, { "match_id": "4107565692", "start_time": "1536434628", "hero_id": "1", "score": "26507" }, { "match_id": "4094706195", "start_time": "1535814512", "hero_id": "56", "score": "26507" }, { "match_id": "4110693132", "start_time": "1536581644", "hero_id": "56", "score": "26481" }, { "match_id": "4106179748", "start_time": "1536384933", "hero_id": "56", "score": "26455" }, { "match_id": "4110084907", "start_time": "1536550754", "hero_id": "53", "score": "26420" }, { "match_id": "4100404053", "start_time": "1536091894", "hero_id": "56", "score": "26414" }, { "match_id": "4108425278", "start_time": "1536478917", "hero_id": "104", "score": "26409" }, { "match_id": "4102550384", "start_time": "1536205881", "hero_id": "1", "score": "26357" }, { "match_id": "4100279409", "start_time": "1536084985", "hero_id": "56", "score": "26356" }, { "match_id": "4095799054", "start_time": "1535868729", "hero_id": "77", "score": "26354" }, { "match_id": "4100113948", "start_time": "1536077617", "hero_id": "56", "score": "26307" }, { "match_id": "4102020625", "start_time": "1536169372", "hero_id": "56", "score": "26306" }, { "match_id": "4110711310", "start_time": "1536582254", "hero_id": "56", "score": "26295" }, { "match_id": "4100444005", "start_time": "1536094635", "hero_id": "95", "score": "26293" }, { "match_id": "4105888721", "start_time": "1536369657", "hero_id": "1", "score": "26275" }, { "match_id": "4098838685", "start_time": "1536006645", "hero_id": "80", "score": "26242" }, { "match_id": "4099325666", "start_time": "1536045103", "hero_id": "77", "score": "26202" }, { "match_id": "4101868367", "start_time": "1536163177", "hero_id": "72", "score": "26199" }, { "match_id": "4096125240", "start_time": "1535880398", "hero_id": "56", "score": "26195" }, { "match_id": "4110139039", "start_time": "1536554410", "hero_id": "27", "score": "26179" }, { "match_id": "4105375458", "start_time": "1536339317", "hero_id": "80", "score": "26175" }, { "match_id": "4099202086", "start_time": "1536036911", "hero_id": "77", "score": "26167" }, { "match_id": "4109225170", "start_time": "1536503286", "hero_id": "53", "score": "26128" }, { "match_id": "4099970743", "start_time": "1536072448", "hero_id": "53", "score": "26120" }, { "match_id": "4095601549", "start_time": "1535859370", "hero_id": "53", "score": "26117" }, { "match_id": "4102685069", "start_time": "1536213846", "hero_id": "56", "score": "26101" }, { "match_id": "4099034882", "start_time": "1536023472", "hero_id": "82", "score": "26082" }, { "match_id": "4102739125", "start_time": "1536216750", "hero_id": "81", "score": "26077" }, { "match_id": "4107294762", "start_time": "1536424277", "hero_id": "27", "score": "26062" }, { "match_id": "4099309076", "start_time": "1536044070", "hero_id": "77", "score": "26020" }, { "match_id": "4098802849", "start_time": "1536004396", "hero_id": "104", "score": "26017" }, { "match_id": "4109774324", "start_time": "1536525881", "hero_id": "48", "score": "25964" }, { "match_id": "4101969897", "start_time": "1536167149", "hero_id": "8", "score": "25954" }, { "match_id": "4094522685", "start_time": "1535809424", "hero_id": "104", "score": "25940" } ]
odota/web/testcafe/cachedAjax/records_tower_damage_.json/0
{ "file_path": "odota/web/testcafe/cachedAjax/records_tower_damage_.json", "repo_id": "odota", "token_count": 5577 }
271
FROM golang:latest RUN rm /bin/sh && ln -s /bin/bash /bin/sh && \ echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections # Node ENV NVM_DIR /usr/local/nvm ENV NODE_VERSION 16.13.2 RUN mkdir -p $NVM_DIR && \ curl --silent -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash \ && source $NVM_DIR/nvm.sh \ && nvm alias default $NODE_VERSION \ && nvm use default ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH # Install prisma command for automatic migrations. RUN npm install --global prisma # Install Taskfile RUN sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin WORKDIR /server ADD . . # Install prisma client code generation tool and generate prisma bindings RUN task generate # Build the docs search index RUN task docsindex # Build the server binary RUN task build ENTRYPOINT [ "task", "production" ]
openmultiplayer/web/Dockerfile/0
{ "file_path": "openmultiplayer/web/Dockerfile", "repo_id": "openmultiplayer", "token_count": 367 }
272
package server import ( "testing" "github.com/pkg/errors" "github.com/stretchr/testify/assert" ) func TestAddressFromString(t *testing.T) { type args struct { address string } tests := []struct { name string args args wanrAddr string wantErrs []string }{ {"valid", args{"192.168.1.2"}, "samp://192.168.1.2:7777", nil}, {"valid.port", args{"192.168.1.2:7777"}, "samp://192.168.1.2:7777", nil}, {"valid.scheme", args{"samp://192.168.1.2"}, "samp://192.168.1.2:7777", nil}, {"invalid.empty", args{""}, "", []string{"address is empty"}}, {"invalid.port", args{"192.168.1.2:port"}, "", []string{"parse \"samp://192.168.1.2:port\": invalid port \":port\" after host"}}, {"invalid.scheme", args{"http://192.168.1.2"}, "", []string{"address contains invalid scheme 'http', must be either empty or 'samp://'"}}, {"invalid.user", args{"user:pass@192.168.1.2"}, "", []string{"address contains a user:password component"}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { _, gotErrs := AddressFromString(tt.args.address) for i := range gotErrs { assert.Equal(t, errors.Cause(gotErrs[i]).Error(), tt.wantErrs[i]) } }) } }
openmultiplayer/web/app/resources/server/address_test.go/0
{ "file_path": "openmultiplayer/web/app/resources/server/address_test.go", "repo_id": "openmultiplayer", "token_count": 493 }
273
package scraper import ( "context" "sync" "time" "github.com/openmultiplayer/web/app/resources/server" "github.com/openmultiplayer/web/app/services/queryer" ) var _ Scraper = &PooledScraper{} type PooledScraper struct { Q queryer.Queryer } func NewPooledScraper(q queryer.Queryer) Scraper { return &PooledScraper{q} } // Scrape scrapes a list of addresses by spawning a goroutine for each address // and transforming each result into a Result object. The amount of results // should be the same as the amount of addresses. func (s *PooledScraper) Scrape(ctx context.Context, addresses []string) chan server.All { out := make(chan server.All) wg := sync.WaitGroup{} for _, a := range addresses { wg.Add(1) go func(addr string) { defer wg.Done() c, f := context.WithTimeout(ctx, time.Second*10) defer f() result := server.TransformQueryResult(s.Q.Query(ctx, addr)) if result.Active { result = server.HydrateDomain(c, result) } else { result.IP = addr } result.Core.IP = result.IP out <- result }(a) } go func() { wg.Wait() close(out) }() return out }
openmultiplayer/web/app/services/scraper/pooled.go/0
{ "file_path": "openmultiplayer/web/app/services/scraper/pooled.go", "repo_id": "openmultiplayer", "token_count": 426 }
274
package metrics import ( "github.com/go-chi/chi" "github.com/prometheus/client_golang/prometheus/promhttp" "go.uber.org/fx" ) func Build() fx.Option { return fx.Options( fx.Invoke(func( r chi.Router, ) { rtr := chi.NewRouter() r.Mount("/metrics", rtr) rtr.Handle("/", promhttp.Handler()) }), ) }
openmultiplayer/web/app/transports/api/metrics/api.go/0
{ "file_path": "openmultiplayer/web/app/transports/api/metrics/api.go", "repo_id": "openmultiplayer", "token_count": 152 }
275
package users import ( "errors" "net/http" "os" "go.uber.org/zap" "github.com/openmultiplayer/web/internal/web" ) type devParams struct { ID string `qstring:"id"` Secret string `qstring:"secret"` } func (s *service) dev(w http.ResponseWriter, r *http.Request) { secret := os.Getenv("DEV_LOGIN_SECRET") if secret == "" { web.StatusNotAcceptable(w, errors.New("dev login not enabled")) return } var p devParams if !web.ParseQuery(w, r, &p) { web.StatusBadRequest(w, errors.New("invalid query")) return } if p.Secret != secret { web.StatusUnauthorized(w, errors.New("go away")) return } zap.L().Info("dev login", zap.Any("params", p)) user, err := s.repo.GetUser(r.Context(), p.ID, false) if err != nil { web.StatusInternalServerError(w, err) return } zap.L().Info("dev login", zap.Any("user", user)) s.auth.EncodeAuthCookie(w, *user) web.Write(w, user) }
openmultiplayer/web/app/transports/api/users/h_dev.go/0
{ "file_path": "openmultiplayer/web/app/transports/api/users/h_dev.go", "repo_id": "openmultiplayer", "token_count": 376 }
276
# SA-MP Wiki and open.mp Documentation Welcome to the SA-MP/open.mp wiki, maintained by the open.mp team and wider SA-MP community! This site aims to provide an easily accessible, easy to contribute to documentation source for SA-MP and open.mp. ## The SA-MP wiki is gone Unfortunately, the SA-MP wiki was taken offline in late september of 2020 and then restored as uneditable archive. Alas, we need the community's help to transfer the old wiki's content to its new home, here! If you're interested, check out [this page](/docs/meta/Contributing) for more information. If you're not experienced with using GitHub or converting HTML, don't worry! You can help by just letting us know about issues (via [Discord](https://discord.gg/samp), [forum](https://forum.open.mp) or social media) and the most important thing: _spreading the word!_ So be sure to bookmark this site and share it with anyone you know who's wondering where the SA-MP Wiki went. We welcome contributions for improvements to documentation as well as tutorials and guides for common tasks such as building simple gamemodes and using common libraries and plugins. If you're interested in contributing then head over to the [GitHub page](https://github.com/openmultiplayer/web).
openmultiplayer/web/docs/index.md/0
{ "file_path": "openmultiplayer/web/docs/index.md", "repo_id": "openmultiplayer", "token_count": 311 }
277
--- title: OnNPCExitVehicle description: This callback is called when a NPC leaves a vehicle. tags: ["npc"] --- ## Description This callback is called when a NPC leaves a vehicle. ## Examples ```c public OnNPCExitVehicle() { print("The NPC left the vehicle"); return 1; } ``` ## Related Callbacks The following callbacks might be useful, as they're related to this callback in one way or another. - [OnNPCEnterVehicle](OnNPCEnterVehicle): This callback is called when a NPC enters a vehicle.
openmultiplayer/web/docs/scripting/callbacks/OnNPCExitVehicle.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/callbacks/OnNPCExitVehicle.md", "repo_id": "openmultiplayer", "token_count": 154 }
278
--- title: OnPlayerDisconnect description: This callback is called when a player disconnects from the server. tags: ["player"] --- ## Description This callback is called when a player disconnects from the server. | Name | Description | | -------- | -------------------------------------------------- | | playerid | The ID of the player that disconnected. | | reason | The reason for the disconnection. See table below. | ## Returns 0 - Will prevent other filterscripts from receiving this callback. 1 - Indicates that this callback will be passed to the next filterscript. It is always called first in filterscripts. ## Reasons | ID | Reason | Details | | -- | ------------- | ----------------------------------------------------------------------------------------- | | 0 | Timeout/Crash | The player's connection was lost. Either their game crashed or their network had a fault. | | 1 | Quit | The player purposefully quit, either using the /quit (/q) command or via the pause menu. | | 2 | Kick/Ban | The player was kicked or banned by the server. | | 3 | Custom | Used by some libraries. Reserved for modes' private uses. | | 4 | Mode End | The current mode is ending so disconnecting all players from it (they are still on the server).| :::warning Reason 3 was originally added in SA:MP by [fixes.inc](https://github.com/pawn-lang/sa-mp-fixes) Reasons 3 and 4 were added by the Open Multiplayer server. ::: ## Examples ```c public OnPlayerDisconnect(playerid, reason) { new szString[64], playerName[MAX_PLAYER_NAME]; GetPlayerName(playerid, playerName, MAX_PLAYER_NAME); new szDisconnectReason[5][] = { "Timeout/Crash", "Quit", "Kick/Ban", "Custom", "Mode End" }; format(szString, sizeof szString, "%s left the server (%s).", playerName, szDisconnectReason[reason]); SendClientMessageToAll(0xC4C4C4FF, szString); return 1; } ``` ## Notes :::tip Some functions might not work correctly when used in this callback because the player is already disconnected when the callback is called. This means that you can't get unambiguous information from functions like [GetPlayerIp](GetPlayerIp) and [GetPlayerPos](GetPlayerPos). This issue is solved in open.mp server. ::: ## Related Callbacks The following callbacks might be useful, as they're related to this callback in one way or another. - [OnPlayerConnect](OnPlayerConnect): This callback is called when a player connects to the server. - [OnIncomingConnection](OnIncomingConnection): This callback is called when a player is attempting to connect to the server. - [OnPlayerFinishedDownloading](OnPlayerFinishedDownloading): This callback is called when a player finishes downloading custom models.
openmultiplayer/web/docs/scripting/callbacks/OnPlayerDisconnect.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/callbacks/OnPlayerDisconnect.md", "repo_id": "openmultiplayer", "token_count": 964 }
279
--- title: OnPlayerLeaveGangZone description: This callback is called when a player exited a gangzone tags: ["player", "gangzone"] --- <VersionWarn name='callback' version='omp v1.1.0.2612' /> ## Description This callback is called when a player exited a gangzone | Name | Description | | -------- | ---------------------------------------------- | | playerid | The ID of the player that exited the gangzone. | | zoneid | The ID of the gangzone the player exited. | ## Returns It is always called first in gamemode. ## Examples ```c public OnPlayerLeaveGangZone(playerid, zoneid) { new string[128]; format(string, sizeof(string), "You are leaving gangzone %i", zoneid); SendClientMessage(playerid, 0xFFFFFFFF, string); return 1; } ``` ## Related Callbacks The following callbacks might be useful, as they're related to this callback in one way or another. - [OnPlayerEnterGangZone](OnPlayerEnterGangZone): This callback is called when a player enters a gangzone. ## Related Functions The following functions might be useful, as they're related to this callback in one way or another. - [GangZoneCreate](../functions/GangZoneCreate): Create a gangzone (colored radar area). - [GangZoneDestroy](../functions/GangZoneDestroy): Destroy a gangzone.
openmultiplayer/web/docs/scripting/callbacks/OnPlayerLeaveGangZone.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/callbacks/OnPlayerLeaveGangZone.md", "repo_id": "openmultiplayer", "token_count": 413 }
280
--- title: OnPlayerStreamOut description: This callback is called when a player is streamed out from some other player's client. tags: ["player"] --- ## Description This callback is called when a player is streamed out from some other player's client. | Name | Description | | ----------- | ----------------------------------------------- | | playerid | The player who has been destreamed. | | forplayerid | The player who has destreamed the other player. | ## Returns It is always called first in filterscripts. ## Examples ```c public OnPlayerStreamOut(playerid, forplayerid) { new string[80]; format(string, sizeof(string), "Your computer has just unloaded player ID %d", playerid); SendClientMessage(forplayerid, 0xFF0000FF, string); return 1; } ``` ## Notes <TipNPCCallbacks /> ## Related Callbacks The following callbacks might be useful, as they're related to this callback in one way or another. - [OnPlayerStreamIn](OnPlayerStreamIn): This callback is called when a player streams in for another player. - [OnActorStreamIn](OnPlayerStreamOut): This callback is called when an actor is streamed in by a player. - [OnVehicleStreamIn](OnPlayerStreamOut): This callback is called when a vehicle streams in for a player.
openmultiplayer/web/docs/scripting/callbacks/OnPlayerStreamOut.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/callbacks/OnPlayerStreamOut.md", "repo_id": "openmultiplayer", "token_count": 401 }
281
--- title: AllowInteriorWeapons description: Toggle whether the usage of weapons in interiors is allowed or not. tags: [] --- ## Description Toggle whether the usage of weapons in interiors is allowed or not. | Name | Description | | ---------- | ---------------------------------------------------------------------------------------------------- | | bool:allow | 'true' to enable weapons in interiors (enabled by default), 'false' to disable weapons in interiors. | ## Returns This function does not return any specific values. ## Examples ```c public OnGameModeInit() { // This will allow weapons inside interiors. AllowInteriorWeapons(true); return 1; } ``` ## Notes :::warning This function does not work in the current SA:MP version! ::: :::tip You can also toggle interior weapons via [config.json](../../server/config.json) ```json "allow_interior_weapons": true, ``` ::: ## Related Functions - [AreInteriorWeaponsAllowed](AreInteriorWeaponsAllowed): Can weapons be used in interiors? - [SetPlayerInterior](SetPlayerInterior): Set a player's interior. - [GetPlayerInterior](GetPlayerInterior): Get the current interior of a player. ## Related Callbacks - [OnPlayerInteriorChange](../callbacks/OnPlayerInteriorChange): Called when a player changes interior.
openmultiplayer/web/docs/scripting/functions/AllowInteriorWeapons.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/AllowInteriorWeapons.md", "repo_id": "openmultiplayer", "token_count": 446 }
282
--- title: AttachPlayerObjectToObject description: You can use this function to attach player-objects to other player-objects. tags: ["player", "object", "playerobject"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description You can use this function to attach player-objects to other player-objects. The objects will follow the main object. | Name | Description | |-------------------|-------------------------------------------------------------------------| | playerid | The ID of the player. | | objectid | The player-object to attach to another player-object. | | parentid | 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. | | bool:syncRotation | If set to `false`, objectid's rotation will not change with parentid's. | ## Returns `true` - The function executed successfully. `false` - 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 (parentid) exists. ## Examples ```c new objectid = CreatePlayerObject(...); new parentid = CreatePlayerObject(...); AttachPlayerObjectToObject(playerid, objectid, parentid, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, true); ``` ## Notes :::tip Both objects need to be created before attempting to attach them. ::: ## Related Functions - [AttachObjectToObject](AttachObjectToObject): Attach an object to other object. - [AttachObjectToPlayer](AttachObjectToPlayer): Attach an object to a player. - [AttachObjectToVehicle](AttachObjectToVehicle): Attach an object to a vehicle. - [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): Attach a player object to a player. - [CreatePlayerObject](CreatePlayerObject): Create an object for only one player. - [DestroyPlayerObject](DestroyPlayerObject): Destroy a player object. - [IsValidPlayerObject](IsValidPlayerObject): Checks if a certain player object is vaild. - [MovePlayerObject](MovePlayerObject): Move a player object. - [StopPlayerObject](StopPlayerObject): Stop a player object from moving. - [SetPlayerObjectPos](SetPlayerObjectPos): Set the position of a player object. - [SetPlayerObjectRot](SetPlayerObjectRot): Set the rotation of a player object. - [GetPlayerObjectPos](GetPlayerObjectPos): Locate a player object. - [GetPlayerObjectRot](GetPlayerObjectRot): Check the rotation of a player object.
openmultiplayer/web/docs/scripting/functions/AttachPlayerObjectToObject.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/AttachPlayerObjectToObject.md", "repo_id": "openmultiplayer", "token_count": 1022 }
283
--- title: ChangeVehiclePaintjob description: Change a vehicle's paintjob. tags: ["vehicle"] --- ## Description Change a vehicle's paintjob (for plain colors see [ChangeVehicleColor](ChangeVehicleColor)). | Name | Description | | --------- | -------------------------------------------------------------------------------------- | | vehicleid | The ID of the vehicle to change the paintjob of. | | paintjob | The ID of the [Paintjob](../resources/paintjobs) to apply. Use 3 to remove a paintjob. | ## Returns This function always returns **true** (success), even if the vehicle passed is not created. ## Examples ```c new rand = random(3); // Will either be 0 1 or 2 (all valid) new vehicleid = GetPlayerVehicleID(playerid); ChangeVehicleColor(vehicleid, 1, 1); // making sure it is white for better result ChangeVehiclePaintjob(vehicleid, rand); // changes the paintjob of the player's current vehicle to a random one ``` ## Notes :::warning If vehicle's color is black, paintjob may not be visible. Better to make vehicle white before applying painjob by using ```c ChangeVehicleColor(vehicleid, 1, 1); ``` ::: ## Related Functions - [GetVehiclePaintjob](GetVehiclePaintjob): Gets the vehicle's paintjob id. - [ChangeVehicleColor](ChangeVehicleColor): Set the color of a vehicle. ## Related Callbacks - [OnVehiclePaintjob](../callbacks/OnVehiclePaintjob): Called when a vehicle's paintjob is changed. ## Related Resources - [Vehicle Paintjob IDs](../resources/paintjobs)
openmultiplayer/web/docs/scripting/functions/ChangeVehiclePaintjob.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/ChangeVehiclePaintjob.md", "repo_id": "openmultiplayer", "token_count": 540 }
284
--- title: CreatePlayerGangZone description: Create player gangzone tags: ["player", "gangzone", "playergangzone"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Create player gangzone. This can be used as a way around the global gangzone limit. | Name | Description | | ----------- | ----------------------------------------------------------------- | | playerid | The ID of the player to whom the player gangzone will be created. | | Float:minX | The X coordinate for the west side of the player gangzone. | | Float:minY | The Y coordinate for the south side of the player gangzone. | | Float:maxX | The X coordinate for the east side of the player gangzone. | | Float:maxY | The Y coordinate for the north side of the player gangzone. | ## Returns The ID of the created player gangzone, returns **-1** if not created ## Examples ```c // This variable is used to store the id of the gangzone // so that we can use it throught the script new gGangZoneID[MAX_PLAYERS]; public OnPlayerConnect(playerid) { // Create the gangzone gGangZoneID[playerid] = CreatePlayerGangZone(playerid, 2236.1475, 2424.7266, 2319.1636, 2502.4348); } ``` ``` MaxY v -------------* < MaxX | | | gangzone | | center | | | MinX > *------------- ^ MinY ``` ## Notes :::warning - There is a limit of 1024 gangzones. - Putting the parameters in the wrong order results in glitchy behavior. ::: :::tip This function merely CREATES the gangzone, you must use [PlayerGangZoneShow](PlayerGangZoneShow) to show it. ::: ## Related Functions - [PlayerGangZoneDestroy](PlayerGangZoneDestroy): Destroy player gangzone. - [PlayerGangZoneShow](PlayerGangZoneShow): Show player gangzone in a color. - [PlayerGangZoneHide](PlayerGangZoneHide): Hide player gangzone. - [PlayerGangZoneFlash](PlayerGangZoneFlash): Start player gangzone flash. - [PlayerGangZoneStopFlash](PlayerGangZoneStopFlash): Stop player gangzone flash. - [PlayerGangZoneGetColour](PlayerGangZoneGetColour): Get the colour of a player gangzone. - [PlayerGangZoneGetFlashColour](PlayerGangZoneGetFlashColour): Get the flashing colour of a player gangzone. - [PlayerGangZoneGetPos](PlayerGangZoneGetPos): Get the position of a gangzone, represented by minX, minY, maxX, maxY coordinates. - [IsValidPlayerGangZone](IsValidPlayerGangZone): Check if the player gangzone valid. - [IsPlayerInPlayerGangZone](IsPlayerInPlayerGangZone): Check if the player in player gangzone. - [IsPlayerGangZoneVisible](IsPlayerGangZoneVisible): Check if the player gangzone is visible. - [IsPlayerGangZoneFlashing](IsPlayerGangZoneFlashing): Check if the player gangzone is flashing. - [UsePlayerGangZoneCheck](UsePlayerGangZoneCheck): Enables the callback when a player enters/leaves this zone. ## GangZone Editors - [Prineside DevTools GangZone Editor](https://dev.prineside.com/en/gtasa_gangzone_editor/)
openmultiplayer/web/docs/scripting/functions/CreatePlayerGangZone.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/CreatePlayerGangZone.md", "repo_id": "openmultiplayer", "token_count": 1123 }
285
--- title: DetachTrailerFromVehicle description: Detach the connection between a vehicle and its trailer, if any. tags: ["vehicle"] --- ## Description Detach the connection between a vehicle and its trailer, if any. | Name | Description | | --------- | -------------------------- | | vehicleid | ID of the pulling vehicle. | ## Returns This function does not return any specific values. ## Examples ```c DetachTrailerFromVehicle(vehicleid); ``` ## Related Functions - [AttachTrailerToVehicle](AttachTrailerToVehicle): Attach a trailer to a vehicle. - [IsTrailerAttachedToVehicle](IsTrailerAttachedToVehicle): Check if a trailer is attached to a vehicle. - [GetVehicleTrailer](GetVehicleTrailer): Check what trailer a vehicle is pulling.
openmultiplayer/web/docs/scripting/functions/DetachTrailerFromVehicle.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/DetachTrailerFromVehicle.md", "repo_id": "openmultiplayer", "token_count": 230 }
286
--- title: EnableTirePopping description: With this function you can enable or disable tire popping. tags: [] --- ## Description With this function you can enable or disable tire popping. | Name | Description | | ----------- | -------------------------------------------------- | | bool:enable | 'true' to enable, 'false' to disable tire popping. | ## Returns This function does not return any specific values. ## Examples ```c public OnGameModeInit() { // This will disable tire popping on your gamemode. EnableTirePopping(false); return 1; } ``` ## Notes :::warning - This function was removed in SA-MP 0.3. - Tire popping is enabled by default. - If you want to disable tire popping, you'll have to manually script it using [OnVehicleDamageStatusUpdate](OnVehicleDamageStatusUpdate). ::: ## Related Functions - [SetPlayerTeam](SetPlayerTeam): Set a player's team.
openmultiplayer/web/docs/scripting/functions/EnableTirePopping.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/EnableTirePopping.md", "repo_id": "openmultiplayer", "token_count": 296 }
287
--- title: GangZoneGetPos description: Get the position of a gangzone, represented by minX, minY, maxX, maxY coordinates tags: ["player", "gangzone"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Get the position of a gangzone, represented by minX, minY, maxX, maxY coordinates. | Name | Description | | ----------- | ----------------------------------------------------------- | | zoneid | The ID of the zone to the coordinates of which want to get. | | &Float:minX | The X coordinate for the west side of the player gangzone. | | &Float:minY | The Y coordinate for the south side of the player gangzone. | | &Float:maxX | The X coordinate for the east side of the player gangzone. | | &Float:maxY | The Y coordinate for the north side of the player gangzone. | ## Returns This function always returns **true**. ## Examples ```c new gangZone; public OnGameModeInit() { gangZone = GangZoneCreate(1248.011, 2072.804, 1439.348, 2204.319); new Float:minX, Float:minY, Float:maxX, Float:maxY; GangZoneGetPos(gangZone, minX, minY, maxX, maxY); return 1; } ``` ## Related Functions - [GangZoneDestroy](GangZoneDestroy): Destroy a gangzone. - [GangZoneShowForPlayer](GangZoneShowForPlayer): Show a gangzone for a player. - [GangZoneShowForAll](GangZoneShowForAll): Show a gangzone for all players. - [GangZoneHideForPlayer](GangZoneHideForPlayer): Hide a gangzone for a player. - [GangZoneHideForAll](GangZoneHideForAll): Hide a gangzone for all players. - [GangZoneFlashForPlayer](GangZoneFlashForPlayer): Make a gangzone flash for a player. - [GangZoneFlashForAll](GangZoneFlashForAll): Make a gangzone flash for all players. - [GangZoneStopFlashForPlayer](GangZoneStopFlashForPlayer): Stop a gangzone flashing for a player. - [GangZoneStopFlashForAll](GangZoneStopFlashForAll): Stop a gangzone flashing for all players. - [IsValidGangZone](IsValidGangZone): Check if the gangzone valid. - [IsPlayerInGangZone](IsPlayerInGangZone): Check if the player in gangzone. - [IsGangZoneVisibleForPlayer](IsGangZoneVisibleForPlayer): Check if the gangzone is visible for player. - [GangZoneGetFlashColourForPlayer](GangZoneGetFlashColourForPlayer): Get the flashing colour of a gangzone for player. - [IsGangZoneFlashingForPlayer](IsGangZoneFlashingForPlayer): Check if the gangzone is flashing for player.
openmultiplayer/web/docs/scripting/functions/GangZoneGetPos.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/GangZoneGetPos.md", "repo_id": "openmultiplayer", "token_count": 823 }
288
--- title: GetActorFacingAngle description: Get the facing angle of an actor. tags: ["actor"] --- <VersionWarn version='SA-MP 0.3.7' /> ## Description Get the facing angle of an actor. | Name | Description | | ------------ | ------------------------------------------------------------------------------------------- | | actorid | The ID of the actor to get the facing angle of. Returned by [CreateActor](CreateActor). | | &Float:angle | A float variable, passed by reference, in to which the actor's facing angle will be stored. | ## Returns **true** - The function executed successfully. **false** - The function failed to execute. The actor specified does not exist. The actor's facing angle is stored in the specified variable. ## Examples ```c new Float:facingAngle; GetActorFacingAngle(actorid, facingAngle); ``` ## Related Functions - [SetActorFacingAngle](SetActorFacingAngle): Set the facing angle of an actor. - [GetActorPos](GetActorPos): Get the position of an actor.
openmultiplayer/web/docs/scripting/functions/GetActorFacingAngle.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/GetActorFacingAngle.md", "repo_id": "openmultiplayer", "token_count": 363 }
289
--- title: GetGameText description: Returns all the information on the given game text style. tags: ["player"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Returns all the information on the given game text style. | Name | Description | |------------------------|-----------------------------------------------------------------------| | playerid | The ID of the player to get the rotation of. | | style | The [style](../resources/gametextstyles) of text to get the data for. | | message[] | Return array for the text string. | | len = sizeof (message) | Size of the output. | | time | The time the gametext was originally shown for. | | remaining | How much of that time is still remaining. | ## Returns true - The function was executed successfully. false - The function failed to execute. This means the player specified does not exist or the style is invalid. ## Examples ```c public OnPlayerConnect(playerid) { GameTextForPlayer(playerid, "Welcome to the server!", 5000, 3); new message[32], time, remaining; GetGameText(playerid, 3, message, sizeof(message), time, remaining); // message = "Welcome to the server!" // time = 5000 return 1; } ``` ## Related Functions - [GameTextForPlayer](GameTextForPlayer): Display gametext to a player. - [HideGameTextForPlayer](HideGameTextForPlayer): Stop showing a gametext style to a player. - [GameTextForAll](GameTextForAll): Display gametext to all players. - [HideGameTextForAll](HideGameTextForAll): Stop showing a gametext style for all players. - [HasGameText](HasGameText): Does the player currently have text in the given gametext style displayed?
openmultiplayer/web/docs/scripting/functions/GetGameText.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/GetGameText.md", "repo_id": "openmultiplayer", "token_count": 793 }
290
--- title: GetPickupModel description: Gets the model ID of a pickup. tags: ["pickup"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Gets the model ID of a pickup. | Name | Description | |----------|----------------------------------------------| | pickupid | The ID of the pickup to get the model ID of. | ## Returns Returns the model ID of the pickup. ## Examples ```c new g_Pickup; public OnGameModeInit() { g_Pickup = CreatePickup(1239, 1, 1686.6160, 1455.4277, 10.7705, -1); new model = GetPickupModel(g_Pickup); // model = 1239 return 1; } ``` ## Related Functions - [CreatePickup](CreatePickup): Create a pickup. - [AddStaticPickup](AddStaticPickup): Add a static pickup. - [DestroyPickup](DestroyPickup): Destroy a pickup. - [IsValidPickup](IsValidPickup): Checks if a pickup is valid. - [IsPickupStreamedIn](IsPickupStreamedIn): Checks if a pickup is streamed in for a specific player. - [IsPickupHiddenForPlayer](IsPickupHiddenForPlayer): Checks if a pickup is hidden for a specific player. - [SetPickupPos](SetPickupPos): Sets the position of a pickup. - [GetPickupPos](GetPickupPos): Gets the coordinates of a pickup. - [SetPickupModel](SetPickupModel): Sets the model of a pickup. - [SetPickupType](SetPickupType): Sets the type of a pickup. - [GetPickupType](GetPickupType): Gets the type of a pickup. - [SetPickupVirtualWorld](SetPickupVirtualWorld): Sets the virtual world ID of a pickup. - [GetPickupVirtualWorld](GetPickupVirtualWorld): Gets the virtual world ID of a pickup. - [ShowPickupForPlayer](ShowPickupForPlayer): Shows a pickup for a specific player. - [HidePickupForPlayer](HidePickupForPlayer): Hides a pickup for a specific player. - [SetPickupForPlayer](SetPickupForPlayer): Adjusts the pickup model, type, and position for a specific player.
openmultiplayer/web/docs/scripting/functions/GetPickupModel.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/GetPickupModel.md", "repo_id": "openmultiplayer", "token_count": 603 }
291
--- title: GetPlayerAnimationFlags description: Get the player animation flags. tags: ["player", "animation"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Get the player animation flags. | Name | Description | | -------- | ---------------------------------------- | | playerid | The player id you want to get the animation flags from | ## Returns Returns the player animation flags as an integer. ## Examples In order to get each flag separately, bit masking is used. ```c #define ANIM_FREEZE_FLAG 0b0000000000000100 #define ANIM_LOCK_X_FLAG 0b0010000000000 #define ANIM_LOCK_Y_FLAG 0b0001000000000 #define ANIM_LOOP_FLAG 0b0000100000000 public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/myanimflags")) { new messageString[128]; new flags = GetPlayerAnimationFlags(playerid); new bool:freeze = (flags & ANIM_FREEZE_FLAG) != 0 ? true : false; new bool:lockx = (flags & ANIM_LOCK_X_FLAG) != 0 ? true : false; new bool:locky = (flags & ANIM_LOCK_Y_FLAG) != 0 ? true : false; new bool:loop = (flags & ANIM_LOOP_FLAG) != 0 ? true : false; format(messageString, sizeof(messageString), "Your anim flags are: [freeze:%i] [lockx:%i] [locky:%i] [loop:%i]", freeze, lockx, locky, loop); SendClientMessage(playerid, -1, messageString); return 1; } return 0; } ``` ## Notes :::warning If the player state is not on-foot, all returned animation flags are 0. ::: ## Related Functions - [ApplyAnimation](ApplyAnimation): Apply an animation to a player.
openmultiplayer/web/docs/scripting/functions/GetPlayerAnimationFlags.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/GetPlayerAnimationFlags.md", "repo_id": "openmultiplayer", "token_count": 621 }
292
--- title: GetPlayerCheckpoint description: Get the location of the current checkpoint. tags: ["player", "checkpoint"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Get the location of the current checkpoint. | Name | Description | | -------------- | ---------------------------------------------------------------------------------- | | playerid | The ID of the player to get the checkpoint position of. | | &Float:centreX | A float variable in which to store the centreX coordinate in, passed by reference. | | &Float:centreY | A float variable in which to store the centreY coordinate in, passed by reference. | | &Float:centreZ | A float variable in which to store the centreZ coordinate in, passed by reference. | | &Float:radius | A float variable in which to store the radius in, passed by reference. | ## Returns This function does not return any specific values. ## Examples ```c SetPlayerCheckpoint(playerid, 408.9874, 2537.8059, 16.5455, 1.5); new Float:centreX, Float:centreY, Float:centreZ, Float:radius; GetPlayerCheckpoint(playerid, centreX, centreY, centreZ, radius); ``` ## Related Functions - [SetPlayerCheckpoint](SetPlayerCheckpoint): Create a checkpoint for a player. - [DisablePlayerCheckpoint](DisablePlayerCheckpoint): Disable the player's current checkpoint. - [IsPlayerInCheckpoint](IsPlayerInCheckpoint): Check if a player is in a checkpoint. - [IsPlayerCheckpointActive](IsPlayerCheckpointActive): Check if the player currently has a checkpoint visible. - [SetPlayerRaceCheckpoint](SetPlayerRaceCheckpoint): Create a race checkpoint for a player. - [DisablePlayerRaceCheckpoint](DisablePlayerRaceCheckpoint): Disable the player's current race checkpoint. - [IsPlayerInRaceCheckpoint](IsPlayerInRaceCheckpoint): Check if a player is in a race checkpoint. ## Related Callbacks - [OnPlayerEnterCheckpoint](../callbacks/OnPlayerEnterCheckpoint): Called when a player enters a checkpoint. - [OnPlayerLeaveCheckpoint](../callbacks/OnPlayerLeaveCheckpoint): Called when a player leaves a checkpoint. - [OnPlayerEnterRaceCheckpoint](../callbacks/OnPlayerEnterRaceCheckpoint): Called when a player enters a race checkpoint. - [OnPlayerLeaveRaceCheckpoint](../callbacks/OnPlayerLeaveRaceCheckpoint): Called when a player leaves a race checkpoint.
openmultiplayer/web/docs/scripting/functions/GetPlayerCheckpoint.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/GetPlayerCheckpoint.md", "repo_id": "openmultiplayer", "token_count": 734 }
293
--- title: GetPlayerIp description: Get the specified player's IP address and store it in a string. tags: ["player", "ip address"] --- ## Description Get the specified player's IP address and store it in a string. | Name | Description | | ----------------- | -------------------------------------------------------------------- | | playerid | The ID of the player to get the IP address of. | | ip[] | The string to store the player's IP address in, passed by reference. | | len = sizeof (ip) | The maximum length of the IP address (recommended 16). | ## Returns The player's IP address is stored in the specified array. ## Examples ```c public OnPlayerConnect(playerid) { new ipAddress[16]; GetPlayerIp(playerid, ipAddress, sizeof(ipAddress)); if (!strcmp(ipAddress, "127.0.0.1")) { SendClientMessage(playerid, 0xFFFFFFFF, "Welcome to your server, master :)"); } return 1; } ``` ## Notes :::tip PAWN is case-sensitive. GetPlayerIP will not work. ::: :::warning **SA-MP server**: This function **does not work** when used in [OnPlayerDisconnect](../callbacks/OnPlayerDisconnect) because the player is already disconnected. It will return an invalid IP (255.255.255.255). Save players' IPs under [OnPlayerConnect](../callbacks/OnPlayerConnect) if they need to be used under [OnPlayerDisconnect](../callbacks/OnPlayerDisconnect). **open.mp server**: This function **work** when used in [OnPlayerDisconnect](../callbacks/OnPlayerDisconnect). ::: ## Related Functions - [NetStats_GetIpPort](NetStats_GetIpPort): Get a player's IP and port. - [GetPlayerRawIp](GetPlayerRawIp): Get a player's Raw IP. - [GetPlayerName](GetPlayerName): Get a player's name. - [GetPlayerPing](GetPlayerPing): Get the ping of a player. - [GetPlayerVersion](GetPlayerVerion): Get a player's client-version. ## Related Callbacks - [OnIncomingConnection](../callbacks/OnIncomingConnection): Called when a player is attempting to connect to the server. - [OnPlayerConnect](../callbacks/OnPlayerConnect): Called when a player connects to the server. - [OnPlayerDisconnect](../callbacks/OnPlayerDisconnect): Called when a player leaves the server.
openmultiplayer/web/docs/scripting/functions/GetPlayerIp.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/GetPlayerIp.md", "repo_id": "openmultiplayer", "token_count": 768 }
294
--- title: GetPlayerObjectModel description: Retrieve the model ID of a player-object. tags: ["player", "object", "playerobject"] --- <VersionWarn version='SA-MP 0.3.7' /> ## Description Retrieve the model ID of a player-object. | Name | Description | | -------- | ------------------------------------------------------------- | | playerid | The ID of the player whose player-object to get the model of | | objectid | The ID of the player-object of which to retrieve the model ID | ## Returns The model ID of the player object. If the player or object don't exist, it will return **-1** or **0** if the player or object does not exist. ## Examples ```c public OnPlayerConnect(playerid) { new objectid = CreatePlayerObject(playerid, 19609, 666.57239, 1750.79749, 4.95627, 0.00000, 0.00000, -156.00000); new modelid = GetPlayerObjectModel(playerid, objectid); printf("Object model: %d", modelid); // Output: "Object model: 19609" return 1; } ``` ## Related Functions - [GetObjectModel](GetObjectModel): Get the model ID of an object.
openmultiplayer/web/docs/scripting/functions/GetPlayerObjectModel.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/GetPlayerObjectModel.md", "repo_id": "openmultiplayer", "token_count": 378 }
295
--- title: GetPlayerRotationQuat description: Returns a player's rotation on all axes as a quaternion. tags: ["player"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Returns a player's rotation on all axes as a quaternion. | Name | Description | |----------|--------------------------------------------------------------------------------------| | playerid | The ID of the player to get the rotation of. | | &Float:w | A float variable in which to store the first quaternion angle, passed by reference. | | &Float:x | A float variable in which to store the second quaternion angle, passed by reference. | | &Float:y | A float variable in which to store the third quaternion angle, passed by reference. | | &Float:z | A float variable in which to store the fourth quaternion angle, passed by reference. | ## Returns **true** - The function was executed successfully. **false** - The function failed to execute. This means the player specified does not exist. The player's rotation is stored in the specified variables. ## Examples ```c new Float:w, Float:x, Float:y, Float:z; GetPlayerRotationQuat(playerid, w, x, y, z); ``` ## Notes :::tip There is no 'set' variation of this function; you can not SET a player's rotation ( apart from the facing angle (Z rotation) ). ::: ## Related Functions - [SetPlayerFacingAngle](SetPlayerFacingAngle): Set a player's facing angle (Z rotation). - [GetPlayerFacingAngle](GetPlayerFacingAngle): Check where a player is facing. - [GetVehicleRotationQuat](GetVehicleRotationQuat): Get the quaternion rotation of a vehicle.
openmultiplayer/web/docs/scripting/functions/GetPlayerRotationQuat.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/GetPlayerRotationQuat.md", "repo_id": "openmultiplayer", "token_count": 579 }
296
--- title: GetPlayerTime description: Get the player's current game time. tags: ["player"] --- ## Description Get the player's current game time. Set by [SetWorldTime](SetWorldTime), or by the game automatically if [TogglePlayerClock](TogglePlayerClock) is used. | Name | Description | | -------- | -------------------------------------------------------------- | | playerid | The ID of the player to get the game time of. | | &hour | A variable in which to store the hour, passed by reference. | | &minute | A variable in which to store the minutes, passed by reference. | ## Returns **true** - The function was executed successfully. **false** - The function failed to execute. The player specified does not exist. The current game time is stored in the specified variables. ## Examples ```c new hour, minutes; GetPlayerTime(playerid, hour, minutes); if (hour == 13 && minutes == 37) { SendClientMessage(playerid, COLOR_WHITE, "The time is 13:37!"); } ``` ## Related Functions - [SetPlayerTime](SetPlayerTime): Set a player's time. - [SetWorldTime](SetWorldTime): Set the global server time. - [TogglePlayerClock](TogglePlayerClock): Toggle the clock in the top-right corner.
openmultiplayer/web/docs/scripting/functions/GetPlayerTime.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/GetPlayerTime.md", "repo_id": "openmultiplayer", "token_count": 404 }
297
--- title: GetRunningTimers description: Get the running timers. tags: [] --- :::warning This function is deprecated, see [CountRunningTimers](CountRunningTimers). ::: ## Description Get the running timers. ([SetTimer](SetTimer) & [SetTimerEx](SetTimerEx)) ## Returns Returns the amount of running timers. ## Examples ```c printf("Running timers: %d", GetRunningTimers()); ``` ## Related Functions - [SetTimer](SetTimer): Set a timer. - [SetTimerEx](SetTimerEx): Set a timer with parameters. - [KillTimer](KillTimer): Kills (stops) a running timer.
openmultiplayer/web/docs/scripting/functions/GetRunningTimers.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/GetRunningTimers.md", "repo_id": "openmultiplayer", "token_count": 172 }
298
--- title: GetVehicleCab description: Get the ID of the cab attached to a vehicle. tags: ["vehicle"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Get the ID of the cab attached to a vehicle. | Name | Description | | --------- | -------------------------------------------- | | vehicleid | The ID of the vehicle to get the cab of. | ## Returns The vehicle ID of the cab or **0** if no cab is attached. ## Examples ```c new cabId = GetVehicleCab(vehicleid); ``` ## Related Functions - [GetVehicleTrailer](GetVehicleTrailer): Get the ID of the trailer attached to a vehicle.
openmultiplayer/web/docs/scripting/functions/GetVehicleCab.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/GetVehicleCab.md", "repo_id": "openmultiplayer", "token_count": 224 }
299
--- title: GetVehicleModelsUsed description: Get the number of used vehicle models on the server. tags: ["vehicle"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Get the number of used vehicle models on the server. ## Examples ```c public OnGameModeInit() { printf("Used vehicle models: %d", GetVehicleModelsUsed()); } ``` ## Related Functions - [GetVehicleModelCount](GetVehicleModelCount): Gets the model count of a vehicle model.
openmultiplayer/web/docs/scripting/functions/GetVehicleModelsUsed.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/GetVehicleModelsUsed.md", "repo_id": "openmultiplayer", "token_count": 144 }
300
--- title: GetVehicleTower description: Get the ID of the cab attached to a vehicle. tags: ["vehicle"] --- :::warning This function is deprecated, See [GetVehicleCab](GetVehicleCab). ::: ## Description Get the ID of the cab attached to a vehicle. | Name | Description | | --------- | -------------------------------------------- | | vehicleid | The ID of the vehicle to get the cab of. | ## Returns The vehicle ID of the cab or **0** if no cab is attached. ## Examples ```c new cabId = GetVehicleTower(vehicleid); ``` ## Related Functions - [GetVehicleTrailer](GetVehicleTrailer): Get the ID of the trailer attached to a vehicle.
openmultiplayer/web/docs/scripting/functions/GetVehicleTower.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/GetVehicleTower.md", "repo_id": "openmultiplayer", "token_count": 234 }
301
--- title: HasPlayerObjectCameraCollision description: Checks if a player-object has camera collision enabled. (SetPlayerObjectNoCameraCollision) tags: ["player", "object", "playerobject"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Checks if a player-object has camera collision enabled. ([SetPlayerObjectNoCameraCollision](SetPlayerObjectNoCameraCollision)) | Name | Description | |----------|--------------------------------| | playerid | The ID of the player. | | objectid | The ID of the object to check. | ## Returns `true` - Player-object camera collision is enable. `false` - Player-object camera collision is disable. ## Examples ```c if (HasPlayerObjectCameraCollision(playerid, playerobjectid)) { printf("Player: %d Object: %d Camera collision: enable", playerid, playerobjectid); } else { printf("Player: %d Object: %d Camera collision: disable", playerid, playerobjectid); } ``` ## Related Functions - [SetPlayerObjectNoCameraCollision](SetPlayerObjectNoCameraCollision): Disable collisions between players' cameras and the specified object. - [HasObjectCameraCollision](HasObjectCameraCollision): Checks if an object has camera collision enabled.
openmultiplayer/web/docs/scripting/functions/HasPlayerObjectCameraCollision.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/HasPlayerObjectCameraCollision.md", "repo_id": "openmultiplayer", "token_count": 362 }
302
--- title: IsGangZoneFlashingForPlayer description: Check if the gangzone is flashing for player tags: ["player", "gangzone"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Check if the gangzone is flashing for player. | Name | Description | | ----------- | ----------------------------------------- | | playerid | The ID of the player to be checked. | | zoneid | The ID of the gangzone. | ## Returns **true** - The gangzone is flashing for player. **false** - The gangzone is not flashing for player. ## Related Functions - [GangZoneDestroy](GangZoneDestroy): Destroy a gangzone. - [GangZoneShowForPlayer](GangZoneShowForPlayer): Show a gangzone for a player. - [GangZoneShowForAll](GangZoneShowForAll): Show a gangzone for all players. - [GangZoneHideForPlayer](GangZoneHideForPlayer): Hide a gangzone for a player. - [GangZoneHideForAll](GangZoneHideForAll): Hide a gangzone for all players. - [GangZoneFlashForPlayer](GangZoneFlashForPlayer): Make a gangzone flash for a player. - [GangZoneFlashForAll](GangZoneFlashForAll): Make a gangzone flash for all players. - [GangZoneStopFlashForPlayer](GangZoneStopFlashForPlayer): Stop a gangzone flashing for a player. - [GangZoneStopFlashForAll](GangZoneStopFlashForAll): Stop a gangzone flashing for all players. - [IsValidGangZone](IsValidGangZone): Check if the gangzone valid. - [IsPlayerInGangZone](IsPlayerInGangZone): Check if the player in gangzone. - [IsGangZoneVisibleForPlayer](IsGangZoneVisibleForPlayer): Check if the gangzone is visible for player.
openmultiplayer/web/docs/scripting/functions/IsGangZoneFlashingForPlayer.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/IsGangZoneFlashingForPlayer.md", "repo_id": "openmultiplayer", "token_count": 527 }
303
--- title: IsPlayerCuffed description: Checks if the player special action is cuffed. tags: ["player"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Checks if the player special action is cuffed. | Name | Description | | -------- | ----------------------------------------------------------- | | playerid | The ID of the player to check. | ## Returns Returns true if the player is cuffed, otherwise false. ## Examples ```c SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CUFFED); if (IsPlayerCuffed(playerid)) { // do something } ```
openmultiplayer/web/docs/scripting/functions/IsPlayerCuffed.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/IsPlayerCuffed.md", "repo_id": "openmultiplayer", "token_count": 247 }
304
--- title: IsPlayerRaceCheckpointActive description: Check if the player currently has a race checkpoint visible. tags: ["player", "checkpoint", "racecheckpoint"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Check if the player currently has a race checkpoint visible. | Name | Description | | -------- | ------------------------------ | | playerid | The ID of the player to check. | ## Return Values Returns **false** if there is no race checkpoint currently shown, otherwise returns **true** ## Examples ```c public OnPlayerSpawn(playerid) { if (IsPlayerRaceCheckpointActive(playerid)) { // Do something } } ``` ## Related Functions - [SetPlayerRaceCheckpoint](SetPlayerRaceCheckpoint): Create a race checkpoint for a player. - [IsPlayerInRaceCheckpoint](IsPlayerInRaceCheckpoint): Check if a player is in a race checkpoint. - [IsPlayerCheckpointActive](IsPlayerCheckpointActive): Check if the player currently has a checkpoint visible.
openmultiplayer/web/docs/scripting/functions/IsPlayerRaceCheckpointActive.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/IsPlayerRaceCheckpointActive.md", "repo_id": "openmultiplayer", "token_count": 298 }
305
--- title: IsValidNickName description: Checks if a nick name is valid. tags: [] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Checks if a nick name is valid. | Name | Description | | ------------ | ----------------------------------------------------------- | | const name[] | The nick name to check. | ## Returns Returns true if the nick name is valid, otherwise false. ## Examples ```c if (IsValidNickName("Barnaby_Keene")) { // Do something } else { SendClientMessage(playerid, 0xFF0000FF, "Your nick name is not valid."); } ``` ## Notes :::tip By default the valid characters in the nick name is (0-9, a-z, A-Z, [], (), \$ @ . \_ and = only). ::: ## Related Functions - [AllowNickNameCharacter](AllowNickNameCharacter): Allows a character to be used in the nick name. - [SetPlayerName](SetPlayerName): Sets the name of a player. - [GetPlayerName](GetPlayerName): Gets the name of a player.
openmultiplayer/web/docs/scripting/functions/IsValidNickName.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/IsValidNickName.md", "repo_id": "openmultiplayer", "token_count": 386 }
306
--- title: IsVehicleStreamedIn description: Checks if a vehicle is streamed in for a player. tags: ["vehicle"] --- ## Description Checks if a vehicle is streamed in for a player. Only nearby vehicles are streamed in (visible) for a player. | Name | Description | | ----------- | ------------------------------- | | vehicleid | The ID of the vehicle to check. | | playerid | The ID of the player to check. | ## Returns **true** - Vehicle is streamed in for the player. **false** - Vehicle is not streamed in for the player, or the function failed to execute (player and/or vehicle do not exist). ## Examples ```c new streamedVehicleCount; for(new i = 1; i < MAX_VEHICLES; i++) { if (IsVehicleStreamedIn(i, playerid)) { streamedVehicleCount ++; } } new string[144]; format(string, sizeof(string), "You currently have %i vehicles streamed in to your game.", streamedVehicleCount); SendClientMessage(playerid, -1, string); ``` ## Related Functions - [IsPlayerStreamedIn](IsPlayerStreamedIn): Checks if a player is streamed in for another player. ## Related Callbacks - [OnVehicleStreamIn](../callbacks/OnVehicleStreamIn): Called when a vehicle streams in for a player. - [OnVehicleStreamOut](../callbacks/OnVehicleStreamOut): Called when a vehicle streams out for a player. - [OnPlayerStreamIn](../callbacks/OnPlayerStreamIn): Called when a player streams in for another player. - [OnPlayerStreamOut](../callbacks/OnPlayerStreamOut): Called when a player streams out for another player.
openmultiplayer/web/docs/scripting/functions/IsVehicleStreamedIn.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/IsVehicleStreamedIn.md", "repo_id": "openmultiplayer", "token_count": 469 }
307
--- title: NetStats_MessagesSent description: Gets the number of messages the server has sent to the player. tags: ["network monitoring"] --- ## Description Gets the number of messages the server has sent to the player. | Name | Description | | -------- | ------------------------------------------ | | playerid | The ID of the player to get the data from. | ## Returns The number of messages the server has sent to the player. ## Examples ```c public OnPlayerCommandText(playerid,cmdtext[]) { if (!strcmp(cmdtext, "/msgsent")) { new szString[144]; format(szString, sizeof(szString), "You have recieved %i network messages.", NetStats_MessagesSent(playerid)); SendClientMessage(playerid, -1, szString); } return 1; } ``` ## Related Functions - [GetPlayerNetworkStats](GetPlayerNetworkStats): Gets a player's networkstats and saves it into a string. - [GetNetworkStats](GetNetworkStats): Gets the server's networkstats and saves it into a string. - [NetStats_GetConnectedTime](NetStats_GetConnectedTime): Get the time that a player has been connected for. - [NetStats_MessagesReceived](NetStats_MessagesReceived): Get the number of network messages the server has received from the player. - [NetStats_BytesReceived](NetStats_BytesReceived): Get the amount of information (in bytes) that the server has received from the player. - [NetStats_BytesSent](NetStats_BytesSent): Get the amount of information (in bytes) that the server has sent to the player. - [NetStats_MessagesRecvPerSecond](NetStats_MessagesRecvPerSecond): Get the number of network messages the server has received from the player in the last second. - [NetStats_PacketLossPercent](NetStats_PacketLossPercent): Get a player's packet loss percent. - [NetStats_ConnectionStatus](NetStats_ConnectionStatus): Get a player's connection status. - [NetStats_GetIpPort](NetStats_GetIpPort): Get a player's IP and port.
openmultiplayer/web/docs/scripting/functions/NetStats_MessagesSent.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/NetStats_MessagesSent.md", "repo_id": "openmultiplayer", "token_count": 587 }
308
--- title: PlayerSpectateVehicle description: Sets a player to spectate another vehicle. tags: ["player", "vehicle"] --- ## Description Sets a player to spectate another vehicle. Their camera will be attached to the vehicle as if they are driving it. | Name | Description | | ------------------ | -------------------------------------------------------------------------------------------------------- | | playerid | The ID of the player who should spectate a vehicle. | | targetvehicleid | The ID of the vehicle the player should spectate. | | SPECTATE_MODE:mode | The spectate [mode](../resources/spectatemodes). Can generally be left blank as it defaults to 'normal'. | ## Returns **true** - The function was executed successfully. Note that success is reported if the player is not in spectator mode (TogglePlayerSpectating), but nothing will happen. TogglePlayerSpectating MUST be used first. **false** - The function failed to execute. The player, vehicle, or both don't exist. ## Examples ```c TogglePlayerSpectating(playerid, 1); PlayerSpectateVehicle(playerid, vehicleid); ``` ## Notes :::warning - Order is CRITICAL! Ensure that you use TogglePlayerSpectating before PlayerSpectateVehicle. - The playerid and vehicleid have to be in the same interior and virtual world for this function to work properly. ::: ## Related Functions - [PlayerSpectatePlayer](PlayerSpectatePlayer): Spectate a player. - [TogglePlayerSpectating](TogglePlayerSpectating): Start or stop spectating. - [GetPlayerSpectateID](GetPlayerSpectateID): Gets the ID of the player or vehicle the player is spectating (watching). - [GetPlayerSpectateType](GetPlayerSpectateType): Gets the player's spectate type. ## Related Resources - [Spectate Modes](../resources/spectatemodes)
openmultiplayer/web/docs/scripting/functions/PlayerSpectateVehicle.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/PlayerSpectateVehicle.md", "repo_id": "openmultiplayer", "token_count": 673 }
309
--- title: PlayerTextDrawLetterSize description: Sets the width and height of the letters in a player-textdraw. tags: ["player", "textdraw", "playertextdraw"] --- ## Description Sets the width and height of the letters in a player-textdraw. | Name | Description | | ----------------- | -------------------------------------------------------------------- | | playerid | The ID of the player whose player-textdraw to set the letter size of | | PlayerText:textid | The ID of the player-textdraw to change the letter size of | | Float:width | Width of a char. | | Float:height | Height of a char. | ## Returns This function does not return any specific values. ## Examples ```c new PlayerText:welcomeText[MAX_PLAYERS]; public OnPlayerConnect(playerid) { welcomeText[playerid] = CreatePlayerTextDraw(playerid, 320.0, 240.0, "Welcome to my OPEN.MP server"); PlayerTextDrawLetterSize(playerid, welcomeText[playerid], 3.2, 5.1); PlayerTextDrawShow(playerid, welcomeText[playerid]); return 1; } ``` ## Notes :::tip When using this function purely for the benefit of affecting the textdraw box, multiply 'Y' by 0.135 to convert to TextDrawTextSize-like measurements ::: :::tip Fonts appear to look the best with an X to Y ratio of 1 to 4 (e.g. if x is 0.5 then y should be 2). ::: ## Related Functions - [CreatePlayerTextDraw](CreatePlayerTextDraw): Create a player-textdraw. - [PlayerTextDrawDestroy](PlayerTextDrawDestroy): Destroy a player-textdraw. - [PlayerTextDrawGetLetterSize](PlayerTextDrawGetLetterSize): Gets the width and height of the letters. - [PlayerTextDrawColor](PlayerTextDrawColor): Set the color of the text in a player-textdraw. - [PlayerTextDrawBoxColor](PlayerTextDrawBoxColor): Set the color of a player-textdraw's box. - [PlayerTextDrawBackgroundColor](PlayerTextDrawBackgroundColor): Set the background color of a player-textdraw. - [PlayerTextDrawAlignment](PlayerTextDrawAlignment): Set the alignment of a player-textdraw. - [PlayerTextDrawFont](PlayerTextDrawFont): Set the font of a player-textdraw. - [PlayerTextDrawTextSize](PlayerTextDrawTextSize): Set the size of a player-textdraw box (or clickable area for PlayerTextDrawSetSelectable). - [PlayerTextDrawSetOutline](PlayerTextDrawSetOutline): Toggle the outline on a player-textdraw. - [PlayerTextDrawSetShadow](PlayerTextDrawSetShadow): Set the shadow on a player-textdraw. - [PlayerTextDrawSetProportional](PlayerTextDrawSetProportional): Scale the text spacing in a player-textdraw to a proportional ratio. - [PlayerTextDrawUseBox](PlayerTextDrawUseBox): Toggle the box on a player-textdraw. - [PlayerTextDrawSetString](PlayerTextDrawSetString): Set the text of a player-textdraw. - [PlayerTextDrawShow](PlayerTextDrawShow): Show a player-textdraw. - [PlayerTextDrawHide](PlayerTextDrawHide): Hide a player-textdraw.
openmultiplayer/web/docs/scripting/functions/PlayerTextDrawLetterSize.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/PlayerTextDrawLetterSize.md", "repo_id": "openmultiplayer", "token_count": 1008 }
310
--- title: SendClientMessage description: This function sends a message to a specific player with a chosen color in the chat. tags: [] --- ## Description This function sends a message to a specific player with a chosen color in the chat. The whole line in the chatbox will be in the set color unless color embedding is used. | Name | Description | |------------------|-------------------------------------------------------| | playerid | The ID of the player to display the message to. | | color | The color of the message (0xRRGGBBAA Hex format). | | const format[] | The text that will be displayed (max 144 characters). | | OPEN_MP_TAGS:... | Indefinite number of arguments of any tag. | ## Returns **true** - The function was executed successfully. Success is reported when the string is over 144 characters, but the message won't be sent. **false** - The function failed to execute. The player is not connected. ## Examples ```c #define COLOR_RED 0xFF0000FF public OnPlayerConnect(playerid) { SendClientMessage(playerid, COLOR_RED, "This text is red"); SendClientMessage(playerid, 0x00FF00FF, "This text is green."); SendClientMessage(playerid, -1, "This text is white."); return 1; } public OnPlayerDeath(playerid, killerid, WEAPON:reason) { if (killerid != INVALID_PLAYER_ID) { new name[MAX_PLAYER_NAME]; GetPlayerName(killerid, name, sizeof(name)); SendClientMessage(playerid, COLOR_RED, "%s killed you.", name); } return 1; } ``` ## Notes :::tip - You can use color embedding for multiple colors in the message. - Using '-1' as the color will make the text white (for the simple reason that -1, when represented in hexadecimal notation, is 0xFFFFFFFF). ::: :::warning - If a message is longer than 144 characters, it will not be sent. Truncation can be used to prevent this. Displaying a message on multiple lines will also solve this issue. - Avoid using the percent sign (or format specifiers) in the actual message text without properly escaping it (like %%). It will result in crashes otherwise. ::: ## Related Functions - [SendClientMessageToAll](SendClientMessageToAll): Send a message to all players. - [SendPlayerMessageToPlayer](SendPlayerMessageToPlayer): Force a player to send text for one player. - [SendPlayerMessageToAll](SendPlayerMessageToAll): Force a player to send text for all players.
openmultiplayer/web/docs/scripting/functions/SendClientMessage.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/SendClientMessage.md", "repo_id": "openmultiplayer", "token_count": 786 }
311
--- title: SetActorPos description: Set the position of an actor. tags: ["actor"] --- <VersionWarn version='SA-MP 0.3.7' /> ## Description Set the position of an actor. | Name | Description | | ------- | -------------------------------------------------------------------- | | actorid | The ID of the actor to set the position of. Returned by CreateActor. | | Float:x | The X coordinate to position the actor at. | | Float:y | The Y coordinate to position the actor at. | | Float:z | The Z coordinate to position the actor at. | ## Returns **true** - The function was executed successfully. **false** - The function failed to execute. The actor specified does not exist. ## Examples ```c new gMyActor; public OnGameModeInit() { gMyActor = CreateActor(24, 2050.7544, -1920.0621, 13.5485, -180.0); return 1; } // Somewhere else SetActorPos(gMyActor, 2062.2332, -1908.1423, 13.5485); ``` ## Notes :::tip When creating an actor with [CreateActor](CreateActor), you specify it's position. You do not need to use this function unless you want to change its position later. ::: ## Related Functions - [GetActorPos](GetActorPos): Get the position of an actor. - [CreateActor](CreateActor): Create an actor (static NPC).
openmultiplayer/web/docs/scripting/functions/SetActorPos.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/SetActorPos.md", "repo_id": "openmultiplayer", "token_count": 508 }
312
--- title: SetObjectNoCameraCollision description: Disable collisions between players' cameras and the specified object. tags: ["object", "camera"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Disable collisions between players' cameras and the specified object. | Name | Description | | -------- | ----------------------------------------------------- | | objectid | The ID of the object to disable camera collisions on. | ## Returns `true` - The function was executed successfully. `false` - The function failed to execute. The object specified does not exist. ## Examples ```c public OnObjectMoved(objectid) { new Float:objX, Float:objY, Float:objZ; GetObjectPos(objectid, objX, objY, objZ); if (objX >= 3000.0 || objY >= 3000.0 || objX <= -3000.0 || objY <= -3000.0) { SetObjectNoCameraCollision(objectid); } return 1; } ``` ## Notes :::tip This only works outside the map boundaries (past -3000/3000 units on the x and/or y axis). ::: ## Related Functions - [HasObjectCameraCollision](HasObjectCameraCollision): Checks if an object has camera collision enabled. - [SetPlayerObjectNoCameraCollision](SetPlayerObjectNoCameraCollision): Disables collisions between camera and player object.
openmultiplayer/web/docs/scripting/functions/SetObjectNoCameraCollision.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/SetObjectNoCameraCollision.md", "repo_id": "openmultiplayer", "token_count": 419 }
313
--- title: SetPlayerArmedWeapon description: Sets which weapon (that a player already has) the player is holding. tags: ["player"] --- ## Description Sets which weapon (that a player already has) the player is holding. | Name | Description | | --------------- | ------------------------------------------------------------------------------------ | | playerid | The ID of the player to arm with a weapon. | | WEAPON:weaponid | The ID of the [weapon](../resources/weaponids) that the player should be armed with. | ## Returns **1** - The function was executed successfully. Success is returned even when the function fails to execute (the player doesn't have the weapon specified, or it is an invalid weapon). **0** - The function failed to execute. The player is not connected. ## Examples ```c public OnPlayerUpdate(playerid) { SetPlayerArmedWeapon(playerid, WEAPON_FIST); // disables weapons return 1; } // SMG driveby by [03]Garsino public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstate) { if (newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER) { new weapon, ammo; GetPlayerWeaponData(playerid, WEAPON_SLOT_MACHINE_GUN, weapon, ammo); // Get the players SMG weapon in slot 4 (WEAPON_SLOT_MACHINE_GUN) SetPlayerArmedWeapon(playerid, weapon); // Set the player to driveby with SMG } return 1; } ``` ## Notes :::tip This function arms a player with a weapon they already have; it does not give them a new weapon. See GivePlayerWeapon. ::: ## Related Functions - [GivePlayerWeapon](GivePlayerWeapon): Give a player a weapon. - [GetPlayerWeapon](GetPlayerWeapon): Check what weapon a player is currently holding. ## Related Functions - [Weapon IDs](../resources/weaponids) - [Weapon Slots](../resources/weaponslots)
openmultiplayer/web/docs/scripting/functions/SetPlayerArmedWeapon.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/SetPlayerArmedWeapon.md", "repo_id": "openmultiplayer", "token_count": 702 }
314
--- title: SetPlayerMarkerForPlayer description: Change the colour of a player's nametag and radar blip for another player. tags: ["player"] --- ## Description Change the colour of a player's nametag and radar blip for another player. | Name | Description | | -------- | ---------------------------------------------------------------- | | playerid | The player that will see the player's changed blip/nametag color | | targetid | The player whose color will be changed | | colour | New color. Supports alpha values. | ## Returns This function does not return any specific values. ## Examples ```c // Make player 42 see player 1 as a red marker SetPlayerMarkerForPlayer(42, 1, 0xFF0000FF); // Make the players marker an invisible white (chat will be white but marker will be gone). SetPlayerMarkerForPlayer(42, 1, 0xFFFFFF00); // Make the players marker invisible to the player while keeping chat colour the same. Will only work correctly if SetPlayerColor has been used: SetPlayerMarkerForPlayer(42, 1, (GetPlayerColor(1) & 0xFFFFFF00)); // Make the players marker fully opaque (solid) to the player while keeping chat colour the same. Will only work correctly if SetPlayerColor has been used: SetPlayerMarkerForPlayer(42, 1, (GetPlayerColor(1) | 0x000000FF)); ``` ## Related Functions - [ShowPlayerMarkers](ShowPlayerMarkers): Decide if the server should show markers on the radar. - [LimitPlayerMarkerRadius](LimitPlayerMarkerRadius): Limit the player marker radius. - [SetPlayerColor](SetPlayerColor): Set a player's color. - [ShowPlayerNameTagForPlayer](ShowPlayerNameTagForPlayer): Show or hide a nametag for a certain player. - [GetPlayerMarkerForPlayer](GetPlayerMarkerForPlayer): Gets the colour of a player's nametag and radar blip for another player.
openmultiplayer/web/docs/scripting/functions/SetPlayerMarkerForPlayer.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/SetPlayerMarkerForPlayer.md", "repo_id": "openmultiplayer", "token_count": 590 }
315
--- title: SetPlayerScore description: Set a player's score. tags: ["player"] --- ## Description Set a player's score. Players' scores are shown in the scoreboard (shown by holding the TAB key). | Name | Description | | -------- | ----------------------------------------- | | playerid | The ID of the player to set the score of. | | score | The value to set the player's score to. | ## Returns **true** - The function executed successfully. **false** - The function failed to execute. This means the player specified does not exist. ## Examples ```c public OnPlayerDeath(playerid, killerid, WEAPON:reason) { // Add 1 to this killer's score. We must check it is valid first. if (killerid != INVALID_PLAYER_ID) { SetPlayerScore(killerid, GetPlayerScore(killerid) + 1); } return 1; } ``` ## Related Functions - [GetPlayerScore](GetPlayerScore): Get the score of a player.
openmultiplayer/web/docs/scripting/functions/SetPlayerScore.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/SetPlayerScore.md", "repo_id": "openmultiplayer", "token_count": 316 }
316
--- title: SetServerRuleFlags description: Sets the flags of a server rule. tags: ["rule"] --- <VersionWarn version='omp v1.1.0.2612' /> :::warning This function has not yet been implemented. ::: ## Description Sets the flags of a server rule. ## Parameters | Name | Description | |---------------------------|-----------------------| | const rule[] | The server rule name. | | E_SERVER_RULE_FLAGS:flags | The flags to set. | ## Returns Returns **true** if the function executed successfully, otherwise **false**. ## Examples ```c public OnGameModeInit() { AddServerRule("discord", "discord.gg/samp"); SetServerRuleFlags("discord", 1); return 1; } ``` ## Related Functions - [AddServerRule](AddServerRule): Add a server rule. - [RemoveServerRule](RemoveServerRule): Remove the server rule. - [IsValidServerRule](IsValidServerRule): Checks if the given server rule is valid. - [GetServerRuleFlags](GetServerRuleFlags): Gets the flags of a server rule.
openmultiplayer/web/docs/scripting/functions/SetServerRuleFlags.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/SetServerRuleFlags.md", "repo_id": "openmultiplayer", "token_count": 348 }
317
--- title: SetVehiclePos description: Set a vehicle's position. tags: ["vehicle"] --- ## Description Set a vehicle's position | Name | Description | | --------- | -------------------------------------------- | | vehicleid | Vehicle ID that you want set new position. | | Float:x | The X coordinate to position the vehicle at. | | Float:y | The Y coordinate to position the vehicle at. | | Float:z | The Z coordinate to position the vehicle at. | ## Returns **true** - The function executed successfully. **false** - The function failed to execute. The vehicle specified does not exist. ## Examples ```c // Put the player's vehicle at the coordinates 0.0, 0.0, 3.0 (center of SA) new vehicleid = GetPlayerVehicleID(playerid); SetVehiclePos(vehicleid, 0.0, 0.0, 3.0); ``` ## Notes :::warning Known Bug(s): - An empty vehicle will not fall after being teleported into the air! ::: ## Related Functions - [SetPlayerPos](SetPlayerPos): Set a player's position. - [GetVehiclePos](GetVehiclePos): Get the position of a vehicle. - [SetVehicleZAngle](SetVehicleZAngle): Set the direction of a vehicle.
openmultiplayer/web/docs/scripting/functions/SetVehiclePos.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/SetVehiclePos.md", "repo_id": "openmultiplayer", "token_count": 373 }
318
--- title: ShowPlayerNameTagForPlayer description: This functions allows you to toggle the drawing of player nametags, healthbars and armor bars which display above their head. tags: ["player"] --- ## Description This functions allows you to toggle the drawing of player nametags, healthbars and armor bars which display above their head. For use of a similar function like this on a global level, [ShowNameTags](ShowNameTags) function. | Name | Description | | --------- | ---------------------------------------------------- | | playerid | Player who will see the results of this function. | | targetid | Player whose name tag will be shown or hidden. | | bool:show | 'true' for show name tag, 'false' for hide name tag. | ## Returns **true** - The function executed successfully. **false** - The function failed to execute. The player specified does not exist. ## Examples ```c public OnPlayerCommandText(playerid, cmdtext[]) { // The player who typed /nameoff will not be able to see any other players nametag. if (strcmp("/nameoff", cmdtext, true) == 0) { for (new i = 0; i < MAX_PLAYERS; i++) { ShowPlayerNameTagForPlayer(playerid, i, false); } GameTextForPlayer(playerid, "~W~Nametags ~R~off", 5000, 5); return 1; } return 0; } ``` ## Notes :::tip [ShowNameTags](ShowNameTags) must be set to 'true' to be able to show name tags with ShowPlayerNameTagForPlayer, that means that in order to be effective you need to ShowPlayerNameTagForPlayer(forplayerid, playerid, 0) ahead of time ([OnPlayerStreamIn](../callbacks/OnPlayerStreamIn) is a good spot). ::: ## Related Functions - [ShowNameTags](ShowNameTags): Set nametags on or off. - [DisableNameTagLOS](DisableNameTagLOS): Disable nametag Line-Of-Sight checking. - [SetPlayerMarkerForPlayer](SetPlayerMarkerForPlayer): Set a player's marker.
openmultiplayer/web/docs/scripting/functions/ShowPlayerNameTagForPlayer.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/ShowPlayerNameTagForPlayer.md", "repo_id": "openmultiplayer", "token_count": 642 }
319
--- title: TextDrawSetPreviewRot description: Sets the rotation and zoom of a 3D model preview textdraw. tags: ["textdraw"] --- ## Description Sets the rotation and zoom of a 3D model preview textdraw. | Name | Description | | --------------- | ------------------------------------------------------------------------------------------------------------------------ | | Text:textid | The ID of the textdraw to change. | | Float:rotationX | The X rotation value. | | Float:rotationY | The Y rotation value. | | Float:rotationZ | The Z rotation value. | | Float:zoom | The zoom value, default value 1.0, smaller values make the camera closer and larger values make the camera further away. | ## Returns This function does not return any specific values. ## Examples ```c new Text:gMyTextdraw; public OnGameModeInit() { gMyTextdraw = TextDrawCreate(320.0, 240.0, "_"); TextDrawFont(gMyTextdraw, TEXT_DRAW_FONT_MODEL_PREVIEW); TextDrawUseBox(gMyTextdraw, true); TextDrawBoxColor(gMyTextdraw, 0x000000FF); TextDrawTextSize(gMyTextdraw, 40.0, 40.0); TextDrawSetPreviewModel(gMyTextdraw, 411); TextDrawSetPreviewRot(gMyTextdraw, -10.0, 0.0, -20.0, 1.0); // You still have to use TextDrawShowForAll/TextDrawShowForPlayer to make the textdraw visible. return 1; } ``` ## Notes :::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. ::: ## Related Functions - [TextDrawGetPreviewRot](TextDrawGetPreviewRot): Gets the rotation and zoom of a 3D model preview textdraw. - [PlayerTextDrawSetPreviewRot](PlayerTextDrawSetPreviewRot): Set rotation of a 3D player textdraw preview. - [TextDrawSetPreviewModel](TextDrawSetPreviewModel): Set the 3D preview model of a textdraw. - [TextDrawSetPreviewVehCol](TextDrawSetPreviewVehCol): Set the colours of a vehicle in a 3D textdraw preview. - [TextDrawFont](TextDrawFont): Set the font of a textdraw. ## Related Callbacks - [OnPlayerClickTextDraw](../callbacks/OnPlayerClickTextDraw): Called when a player clicks on a textdraw.
openmultiplayer/web/docs/scripting/functions/TextDrawSetPreviewRot.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/TextDrawSetPreviewRot.md", "repo_id": "openmultiplayer", "token_count": 1150 }
320
--- title: TogglePlayerGhostMode description: Toggle player's ghost mode. tags: ["player"] --- <VersionWarn version='omp v1.1.0.2612' /> ## Description Toggle player's ghost mode. Ghost mode disables the collision between player models. | Name | Description | | ----------- | ---------------------------------------------- | | playerid | The ID of the player to toggle the ghost mode. | | bool:toggle | true for enable and false for disable. | ## Returns This function always returns true. ## Examples ```c public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/ghostmode", true)) { TogglePlayerGhostMode(playerid, true); SendClientMessage(playerid, -1, "SERVER: You enabled the ghost mode!"); return 1; } return 0; } ``` ## Related Functions - [GetPlayerGhostMode](GetPlayerGhostMode): Get player's ghost mode.
openmultiplayer/web/docs/scripting/functions/TogglePlayerGhostMode.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/TogglePlayerGhostMode.md", "repo_id": "openmultiplayer", "token_count": 330 }
321
--- title: argindex description: Get the name of the argument at the given index after --. tags: ["arguments", "args"] --- ## Description Get the name of the argument at the given index after **--**. | Name | Description | | --------------------- | ----------------------------------------------- | | index | The naught-based offset to the script argument. | | value[] | The output string destination. | | size = sizeof (value) | The size of the destination. | | bool:pack = false | Should the return value be packed? | ## Returns **true** - the argument was found, **false** - it wasn't. ## Notes Separate parameters also count for the index here. For example with `--load test --run` the argument `--run` is index `2`. ## Related Functions - [argcount](argcount): Get the number of arguments passed to the script (those after --). - [argstr](argstr): Get the string value of an argument by name. - [argvalue](argvalue): Get the number of arguments passed to the script (those after --).
openmultiplayer/web/docs/scripting/functions/argindex.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/argindex.md", "repo_id": "openmultiplayer", "token_count": 399 }
322
--- title: fclose description: Closes a file. tags: ["file management"] --- <LowercaseNote /> ## Description Closes a file. Files should always be closed when the script no longer needs them (after reading/writing). | Name | Description | | ----------- | ----------------------------------------------------- | | File:handle | The file handle to close. Returned by [fopen](fopen). | ## Returns **true** - The function executed successfully. **false** - The function failed to execute. The file could not be closed. It may already be closed. ## Examples ```c // Open "file.txt" in "append only" mode new File:handle = fopen("file.txt", io_append); // Check, if file is open if (handle) { // Success // Write "Hi there!" into the file fwrite(handle, "Hi there!"); // Close the file fclose(handle); } else { // Error print("Failed to open file \"file.txt\"."); } ``` ## Notes :::warning Using an invalid handle will crash your server! Get a valid handle by using [fopen](fopen) or [ftemp](ftemp). ::: ## Related Functions - [fopen](fopen): Open a file. - [ftemp](ftemp): Create a temporary file stream. - [fremove](fremove): Remove a file. - [fwrite](fwrite): Write to a file. - [fread](fread): Read a file. - [fputchar](fputchar): Put a character in a file. - [fgetchar](fgetchar): Get a character from a file. - [fblockwrite](fblockwrite): Write blocks of data into a file. - [fblockread](fblockread): Read blocks of data from a file. - [fseek](fseek): Jump to a specific character in a file. - [flength](flength): Get the file length. - [fexist](fexist): Check, if a file exists. - [fmatch](fmatch): Check, if patterns with a file name matches. - [ftell](ftell): Get the current position in the file. - [fflush](fflush): Flush a file to disk (ensure all writes are complete). - [fstat](fstat): Return the size and the timestamp of a file. - [frename](frename): Rename a file. - [fcopy](fcopy): Copy a file. - [filecrc](filecrc): Return the 32-bit CRC value of a file. - [diskfree](diskfree): Returns the free disk space. - [fattrib](fattrib): Set the file attributes. - [fcreatedir](fcreatedir): Create a directory.
openmultiplayer/web/docs/scripting/functions/fclose.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/fclose.md", "repo_id": "openmultiplayer", "token_count": 747 }
323
--- title: floatmul description: Multiplies two floats with each other. tags: ["math", "floating-point"] --- <LowercaseNote /> ## Description Multiplies two floats with each other. | Name | Description | | ----------- | ------------------------------------------------- | | Float:oper1 | First Float. | | Float:oper2 | Second Float, the first one gets multiplied with. | ## Returns The product of the two given floats ## Examples ```c public OnGameModeInit() { new Float:Number1 = 2.3, Float:Number2 = 3.5; // Declares two floats, Number1 (2.3) and Number2 (3.5) new Float:Product; Product = floatmul(Number1, Number2); // Saves the product(=2.3*3.5 = 8.05) of Number1 and Number2 in the float "Product" return 1; } ``` ## Notes :::tip This function is rather redundant, for it is no different than the conventional multiplication operator (\*). ::: ## Related Functions - [Floatadd](Floatadd): Adds two floats. - [Floatsub](Floatsub): Subtracts two floats. - [Floatdiv](Floatdiv): Divides a float by another.
openmultiplayer/web/docs/scripting/functions/floatmul.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/floatmul.md", "repo_id": "openmultiplayer", "token_count": 414 }
324
--- title: fstat description: Return the size and the timestamp of a file. tags: ["file management"] --- <VersionWarn version='omp v1.1.0.2612' /> <LowercaseNote /> ## Description Return the size and the timestamp of a file. | Name | Description | | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | const filename[] | The name of the file. | | &size | If the function is successful, this param-eter holds the size of the file on return. | | &timestamp | If the function is successful, this parameter holds the time of the last modification of the file on return. | | &attrib | If the function is successful, this parameter holds the file attributes. | | &inode | If the function is successful, this parameter holds inode number of the file. An inode number is a number that uniquely identifies a file, and it usually indicates the physical position of (the start of) the file on the disk or memory card. | ## Returns **true** - The function was executed successfully. **false** - The function failed to execute. (File doesn't exist) ## Examples ```c new size, timestamp, attrib, inode; if (fstat("file.txt", size, timestamp, attrib, inode)) { // Success printf("size = %d, timestamp = %d, attrib = %d, inode = %d", size, timestamp, attrib, inode); } else { // Error print("The file \"file.txt\" does not exists, or can't be opened."); } ``` ## Related Functions - [fopen](fopen): Open a file. - [fclose](fclose): Close a file. - [ftemp](ftemp): Create a temporary file stream. - [fremove](fremove): Remove a file. - [fwrite](fwrite): Write to a file. - [fputchar](fputchar): Put a character in a file. - [fgetchar](fgetchar): Get a character from a file. - [fblockwrite](fblockwrite): Write blocks of data into a file. - [fblockread](fblockread): Read blocks of data from a file. - [fseek](fseek): Jump to a specific character in a file. - [flength](flength): Get the file length. - [fexist](fexist): Check, if a file exists. - [fmatch](fmatch): Check, if patterns with a file name matches. - [ftell](ftell): Get the current position in the file. - [fflush](fflush): Flush a file to disk (ensure all writes are complete). - [frename](frename): Rename a file. - [fcopy](fcopy): Copy a file. - [filecrc](filecrc): Return the 32-bit CRC value of a file. - [diskfree](diskfree): Returns the free disk space. - [fattrib](fattrib): Set the file attributes. - [fcreatedir](fcreatedir): Create a directory.
openmultiplayer/web/docs/scripting/functions/fstat.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/fstat.md", "repo_id": "openmultiplayer", "token_count": 1725 }
325
--- title: min description: Return the lowest of two numbers. tags: ["core"] --- <LowercaseNote /> ## Description Function used to compare the values. | Name | Description | | ------ | ----------------------- | | value1 | Value 1 (a) to compare. | | value1 | Value 2 (b) to compare. | ## Returns The lower value of `value1` and `value2` If both are equivalent, `value1` is returned. ## Examples ```c public OnGameModeInit() { new a, b, result; a = 5; b = 10; result = min(a, b); printf("min(%d, %d) = %d", a, b, result); // Since a is smaller than b so result will be 5. return 1; } ``` ## Related Functions - [max](max): Compare and get the maximum value.
openmultiplayer/web/docs/scripting/functions/min.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/min.md", "repo_id": "openmultiplayer", "token_count": 269 }
326
--- title: strfind description: Search for a sub string in a string. tags: ["string"] --- <LowercaseNote /> ## Description Search for a sub string in a string. | Name | Description | | ---------------------------- | --------------------------------------------------------------------------------------------------------- | | const string[] | The string you want to search in (haystack). | | const sub[] | The string you want to search for (needle). | | bool:ignorecase *(optional)* | When set to true, the case doesn't matter - HeLLo is the same as Hello. When false, they're not the same. | | Position *(optional)* | The offset to start searching from. | ## Returns The number of characters before the sub string (the sub string's start position) or -1 if it's not found. ## Examples ```c if (strfind("Are you in here?", "you", true) != -1) // Returns 4, because the start of 'you' (y) is at index 4 in the string { SendClientMessageToAll(0xFFFFFFFF, "I found you!"); } ``` ## Related Functions - [strcmp](strcmp): Compare two strings to check if they are the same. - [strdel](strdel): Delete part of a string. - [strins](strins): Insert text into a string. - [strlen](strlen): Get the length of a string. - [strmid](strmid): Extract part of a string into another string. - [strpack](strpack): Pack a string into a destination string. - [strval](strval): Convert a string into an integer. - [strcat](strcat): Concatenate two strings into a destination reference.
openmultiplayer/web/docs/scripting/functions/strfind.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/functions/strfind.md", "repo_id": "openmultiplayer", "token_count": 762 }
327
--- title: "Keywords: Initialisers" --- ## `const` ```c new const MY_CONSTANT[] = {1, 2, 3}; ``` const is not widerly used however it declares a variable which can not be modified by code. There are a few uses for this - functions with const array parameters can sometimes be compiled more efficiently or you may want something like a define but which is an array. const is a modifier, it must go with new or another variable declarator. If you try modify a const variable the compiler will complain. ## `enum` Enumerations are a very useful system for representing large groups of data and modifying constants quickly. There are a few main uses - replacing large sets of define statements, symbolically representing array slots (these are actually the same thing but they look different) and creating new tags. By far the most common use is as array definitions: ```c enum E_MY_ARRAY { E_MY_ARRAY_MONEY, E_MY_ARRAY_GUN } new gPlayerData[MAX_PLAYERS][E_MY_ARRAY]; public OnPlayerConnect(playerid) { gPlayerData[playerid][E_MY_ARRAY_MONEY] = 0; gPlayerData[playerid][E_MY_ARRAY_GUN] = 5; } ``` That will create an array with two slots for every player. Into the one referenced by E_MY_ARRAY_MONEY it'll put 0 when a player connects and 5 into E_MY_ARRAY_GUN. Without an enum this would look like: ```c new gPlayerData[MAX_PLAYERS][2]; public OnPlayerConnect(playerid) { gPlayerData[playerid][0] = 0; gPlayerData[playerid][1] = 5; } ``` And that is how the first compiles. This is OK, however it's less readable - what is slot 0 for and what is slot 1 for? And it's less flexible, what if you want to add another slot between 0 and 1, you have to rename all your 1s to 2s, add the new one and hope you didn't miss anything, wheras with an enum you would just do: ```c enum E_MY_ARRAY { E_MY_ARRAY_MONEY, E_MY_ARRAY_AMMO, E_MY_ARRAY_GUN } new gPlayerData[MAX_PLAYERS][E_MY_ARRAY]; public OnPlayerConnect(playerid) { gPlayerData[playerid][E_MY_ARRAY_MONEY] = 0; gPlayerData[playerid][E_MY_ARRAY_AMMO] = 100; gPlayerData[playerid][E_MY_ARRAY_GUN] = 5; } ``` Recompile and everything will be updated for you. So how does an enum know what values to give things? The full format of an enum is: ```c enum NAME (modifier) { NAME_ENTRY_1 = value, NAME_ENTRY_2 = value, ... NAME_ENTRY_N = value } ``` However much of this is implied. By default, if you don't specify a modifier it becomes (+= 1), this means that every value in the enum is the last value in the enum + 1, so for: ```c enum E_EXAMPLE { E_EXAMPLE_0, E_EXAMPLE_1, E_EXAMPLE_2 } ``` The first value (E_EXAMPLE_0) is 0 (by default if no other value is specified), so the second value (E_EXAMPLE_1) is 1 (0 + 1) and the third value (E_EXAMPLE_2) is 2 (1 + 1). This makes the value of E_EXAMPLE 3 (2 + 1), the name of the enum is also the last value in the enum. If we change the modifier we get different values: ```c enum E_EXAMPLE (+= 5) { E_EXAMPLE_0, E_EXAMPLE_1, E_EXAMPLE_2 } ``` In that example every value is the last value + 5 so, starting from 0 again, we get: E_EXAMPLE_0 = 0, E_EXAMPLE_1 = 5, E_EXAMPLE_2 = 10, E_EXAMPLE = 15. If you were to declare an array of: ```c new gEnumArray[E_EXAMPLE]; ``` You would get an array 15 cells big however you would only be able to access cells 0, 5 and 10 using the enum values (you could however still use normal numbers). Lets look at another example: ```c enum E_EXAMPLE (*= 2) { E_EXAMPLE_0, E_EXAMPLE_1, E_EXAMPLE_2 } ``` In this all the values are 0. Why? Well the first value by default is 0, then 0 _ 2 = 0, then 0 _ 2 = 0 and 0 \* 2 = 0. So how do we correct this? This is what custom values are for: ```c enum E_EXAMPLE (*= 2) { E_EXAMPLE_0 = 1, E_EXAMPLE_1, E_EXAMPLE_2 } ``` That sets the first value to 1, so you end up with 1, 2, 4 and 8. Creating an array with that would give you an 8 cell array with named access to cells 1, 2 and 4. You can set whichever values you like and as many values as you like: ```c enum E_EXAMPLE (*= 2) { E_EXAMPLE_0, E_EXAMPLE_1 = 1, E_EXAMPLE_2 } ``` Gives: ```c 0, 1, 2, 4 ``` While: ```c enum E_EXAMPLE (*= 2) { E_EXAMPLE_0 = 1, E_EXAMPLE_1 = 1, E_EXAMPLE_2 = 1 } ``` Gives: ```c 1, 1, 1, 2 ``` It's not advised to use anything but += 1 for arrays. You can also use arrays in enums: ```c enum E_EXAMPLE { E_EXAMPLE_0[10], E_EXAMPLE_1, E_EXAMPLE_2 } ``` That would make E_EXAMPLE_0 = 0, E_EXAMPLE_1 = 10, E_EXAMPLE_2 = 11 and E_EXAMPLE = 12, contrary to the popular belief of 0, 1, 2 and 3. enums items can also have tags, so for out original example: ```c enum E_MY_ARRAY { E_MY_ARRAY_MONEY, E_MY_ARRAY_AMMO, Float:E_MY_ARRAY_HEALTH, E_MY_ARRAY_GUN } new gPlayerData[MAX_PLAYERS][E_MY_ARRAY]; public OnPlayerConnect(playerid) { gPlayerData[playerid][E_MY_ARRAY_MONEY] = 0; gPlayerData[playerid][E_MY_ARRAY_AMMO] = 100; gPlayerData[playerid][E_MY_ARRAY_GUN] = 5; gPlayerData[playerid][E_MY_ARRAY_HEALTH] = 50.0; } ``` That will not give a tag mismatch. Enums can also be used as tags themselves: ```c enum E_MY_TAG (<<= 1) { E_MY_TAG_NONE, E_MY_TAG_VAL_1 = 1, E_MY_TAG_VAL_2, E_MY_TAG_VAL_3, E_MY_TAG_VAL_4 } new E_MY_TAG:gMyTagVar = E_MY_TAG_VAL_2 | E_MY_TAG_VAL_3; ``` That will create a new variable and assign it the value 6 (4 | 2), and it will have a custom tag so doing: ```c gMyTagVar = 7; ``` Will generate a tag mismatch warning, although you can use tag overwrites to bypass it: ```c gMyTagVar = E_MY_TAG:7; ``` This can be very useful for flag data (i.e. one bit for some data), or even combined data: ```c enum E_MY_TAG (<<= 1) { E_MY_TAG_NONE, E_MY_TAG_MASK = 0xFF, E_MY_TAG_VAL_1 = 0x100, E_MY_TAG_VAL_2, E_MY_TAG_VAL_3, E_MY_TAG_VAL_4 } new E_MY_TAG:gMyTagVar = E_MY_TAG_VAL_2 | E_MY_TAG_VAL_3 | (E_MY_TAG:7 & E_MY_TAG_MASK); ``` Which will produce a value of 1543 (0x0607). Finally, as stated originally, enums can be used to replace defines by ommitting the name: ```c #define TEAM_NONE 0 #define TEAM_COP 1 #define TEAM_ROBBER 2 #define TEAM_CIV 3 #define TEAM_CLERK 4 #define TEAM_DRIVER 5 ``` I'm sure many of you have seen loads of things like that to define teams. It's all well and good but it's very static. That can easilly be replaced by an enum to handle numeric assignments automatically: ```c enum { TEAM_NONE, TEAM_COP, TEAM_ROBBER, TEAM_CIV, TEAM_CLERK, TEAM_DRIVER } ``` Those all have the same values as they had before, and can be used in exactly the same way: ```c new gPlayerTeam[MAX_PLAYERS] = {TEAM_NONE, ...}; public OnPlayerConnect(playerid) { gPlayerTeam[playerid] = TEAM_NONE; } public OnPlayerRequestSpawn(playerid) { if (gPlayerSkin[playerid] == gCopSkin) { gPlayerTeam[playerid] = TEAM_COP; } } ``` While we're on the subject there is a much better way of defining teams based on this method: ```c enum (<<= 1) { TEAM_NONE, TEAM_COP = 1, TEAM_ROBBER, TEAM_CIV, TEAM_CLERK, TEAM_DRIVER } ``` Now TEAM_COP is 1, TEAM_ROBBER is 2, TEAM_CIV is 4 etc, which in binary is 0b00000001, 0b00000010 and 0b00000100. This means that if a player's team is 3 then they are in both the cop team and the robber team. That may sound pointless but it does open up possibilities: ```c enum (<<= 1) { TEAM_NONE, TEAM_COP = 1, TEAM_ROBBER, TEAM_CIV, TEAM_CLERK, TEAM_DRIVER, TEAM_ADMIN } ``` Using that you can be in both a normal team and the admin team using only a single variable. Obviously a little code modification is required but that's easy: To add a player to a team: ```c gPlayerTeam[playerid] |= TEAM_COP; ``` To remove a player from a team: ```c gPlayerTeam[playerid] &= ~TEAM_COP; ``` To check if a player is in a team: ```c if (gPlayerTeam[playerid] & TEAM_COP) ``` Very simple and very useful. ## `forward` forward tells the compiler that a function is coming later. It is required for all public functions however can be used in other places. It's use is "forward" followed by the full name and parameters of the function you want to forward, followed by a semicolon: ```c forward MyPublicFunction(playerid, const string[]); public MyPublicFunction(playerid, const string[]) { } ``` As well as being required for all publics forward can be used to fix a rare warning when a function which returns a tag result (e.g. a float) is used before it's declared. ```c main() { new Float:myVar = MyFloatFunction(); } Float:MyFloatFunction() { return 5.0; } ``` This will give a reparse warning because the compiler doesn't know how to convert the return of the function to a float because it doesn't know if the function returns a normal number or a float. Clearly in this example it returns a float. This can either be solved by putting the function at a point in the code before it's used: ```c Float:MyFloatFunction() { return 5.0; } main() { new Float:myVar = MyFloatFunction(); } ``` Or by forwarding the function so the compiler knows what to do: ```c forward Float:MyFloatFunction(); main() { new Float:myVar = MyFloatFunction(); } Float:MyFloatFunction() { return 5.0; } ``` Note the forward includes the return tag too. ## `native` A native function is one defined in the virtual machine (i.e. the thing which runs the script), not in the script itself. You can only define native functions if they're coded into SA:MP or a plugin, however you can create fake natives. Because the native functions from .inc files are detected by pawno and listed in the box on the right hand side of pawno it can be useful to use native to get your own custom functions listed there. A normal native declaration could look like: ```c native printf(const format[], {Float,_}:...); ``` If you want your own functions to appear without being declared native you can do: ```c /* native MyFunction(playerid); */ ``` PAWNO doesn't recognise comments like that so will add the function to the list but the compiler does recognise comments like that so will ignore the declaration. The other interesting thing you can do with native is rename/overload functions: ```c native my_print(const string[]) = print; ``` Now the function print doesn't actually exist. It is still in SA:MP, and the compiler knows it's real name thanks to the "= print" part, but if you try call it in PAWN you will get an error as you have renamed print internally to my_print. As print now doesn't exist you can define it just like any other function: ```c print(const string[]) { my_print("Someone called print()"); my_print(string); } ``` Now whenever print() is used in a script your function will be called instead of the original and you can do what you like. In this case another message is printed first then the original message. ## `new` This is the core of variables, one of the most important keywords about. new declares a new variable: ```c new myVar = 5; ``` That will create a variable, name it myVar and assign it the value of 5. By default all variables are 0 if nothing is specified: ```c new myVar; printf("%d", myVar); ``` Will give "0". A variable's scope is where it can be used. Scope is restricted by braces (the curly brackets - {} ), any variable declared inside a set of braces can only be used within those braces. ```c if (a == 1) { // Braces start the line above this one new myVar = 5; // This printf is in the same braces so can use myVar. printf("%d", myVar); // This if statement is also within the braces, so it and everything in it can use myVar if (myVar == 1) { printf("%d", myVar); } // The braces end the line below this } // This is outside the braces so will give an error printf("%d", myVar); ``` The example above also shows why correct indentation is so important. If a global variable (i.e. one declared outside a function) is declared new, it can be used everywhere after the declaration: File1.pwn: ```c MyFunc1() { // Error, gMyVar doesn't exist yet printf("%d", gMyVar); } // gMyVar is declared here new gMyVar = 10; MuFunc2() { // Fine as gMyVar now exists printf("%d", gMyVar); } // Include another file here #include "file2.pwn" ``` file2.pwn: ```c MyFunc3() { // This is also fine as this file is included in the first file after the declaration and new is not file restricted printf("%d", gMyVar); } ``` ## `operator` This allows you to overload operators for custom tags. For example: ```c stock BigEndian:operator=(b) { return BigEndian:(((b >>> 24) & 0x000000FF) | ((b >>> 8) & 0x0000FF00) | ((b << 8) & 0x00FF0000) | ((b << 24) & 0xFF000000)); } main() { new BigEndian:a = 7; printf("%d", _:a); } ``` Normal pawn numbers are stored in what's called little endian. This operator allows you to define an assignment to convert a normal number to a big endian number. The difference between big endian and little endian is the byte order. 7 in little endian is stored as: ```c 07 00 00 00 ``` 7 in big endian is stored as: ```c 00 00 00 07 ``` Therefore if you print the contents of a big endian stored number it will try read it as a little endian number and get it backwards, thus printing the numer 0x07000000, aka 117440512, which is what you will get if you run this code. You can overload the following operators: ```c +, -, *, /, %, ++, --, ==, !=, <, >, <=, >=, ! and = ``` Also note that you can make them do whatever you like: ```c stock BigEndian:operator+(BigEndian:a, BigEndian:b) { return BigEndian:42; } main() { new BigEndian:a = 7, BigEndian:b = 199; printf("%d", _:(a + b)); ``` Will simply give 42, nothing to do with addition. ## `public` public is used to make a function visible to the Virtual Machine, i.e. it allows the SA:MP server to call the function directly, instead of only allowing the function to be called from inside the PAWN script. You can also make variables public to read and write their values from the server, however this is never used in SA:MP (although you may be able to utilise it from a plugin, I've never tried) (you can also combine this with const to make a variable which can ONLY be modified from the server). A public function has it's textual name stored in the amx file, unlike normal functions which only have their address stored for jumps, which is another drawback to decompilation. This is so that you can call the function by name from outside the script, it also allows you to call functions by name from inside the script by leaving and re-entering it. A native function call is almost the opposite of a public function call, it calls a function outside the script from inside the script as opposed to calling a function inside the script from outside the script. If you combine the two you get functions like SetTimer, SetTimerEx, CallRemoteFunction and CallLocalFunction which call functions by name, not address. Calling a function by name: ```c forward MyPublicFunc(); main() { CallLocalFunction("MyPublicFunc", ""); } public MyPublicFunc() { printf("Hello"); } ``` public functions prefixed by either "public" or "@" and, as mentioned in the forward section, all require forwarding: ```c forward MyPublicFunc(); forward @MyOtherPublicFunc(var); main() { CallLocalFunction("MyPublicFunc", ""); SetTimerEx("@MyOtherPublicFunc", 5000, 0, "i", 7); } public MyPublicFunc() { printf("Hello"); } @MyOtherPublicFunc(var) { printf("%d", var); } ``` Obviously that example introduced SetTimerEx to call "MyOtherPublicFunc" after 5 seconds and pass it the integer value 7 to print. main, used in most of these examples, is similar to a public function in that it can be called from outside the script, however it is not a public function - it just has a special known address so the server knows where to jump to to run it. All SA:MP callbacks are public and called from outside the script automatically: ```c public OnPlayerConnect(playerid) { printf("%d connected", playerid); } ``` When someone joins the server it will automatically look up this public function in all scripts (gamemode first then filterscripts) and if it finds it, calls it. If you want to call a public function from inside the script however you do not have to call it by name, public functions also behave as normal functions too: ```c forward MyPublicFunc(); main() { MyPublicFunc(); } public MyPublicFunc() { printf("Hello"); } ``` This is obviously much faster than using CallLocalFunction or another native. ## `static` A static variable is like a global new variable but with a more limited scope. When static is used globally the resulting created variables are limited to only the section in which they were created (see #section). So taking the earlier "new" example: **file1.pwn** ```c MyFunc1() { // Error, gMyVar doesn't exist yet printf("%d", gMyVar); } // gMyVar is declared here new gMyVar = 10; MuFunc2() { // Fine as gMyVar now exists printf("%d", gMyVar); } // Include another file here #include "file2.pwn" ``` file2.pwn ```c MyFunc3() { // This is also fine as this file is included in the first file after the declaration and new is not file restricted printf("%d", gMyVar); } ``` And modifying it for static would give: file1.pwn ```c MyFunc1() { // Error, g_sMyVar doesn't exist yet printf("%d", g_sMyVar); } // g_sMyVar is declared here static g_sMyVar = 10; MuFunc2() { // Fine as _sgMyVar now exists printf("%d", g_sMyVar); } // Include another file here #include "file2.pwn" ``` file2.pwn ```c MyFunc3() { // Error, g_sMyVar is limited to only the file (or section) in which it was declared, this is a different file printf("%d", g_sMyVar); } ``` This means you can have two globals of the same name in different files. If you use static locally (i.e. in a function) then the variable, like local variables created with new, can only be used within the scope (based on braces - see the section on "new") in which it was declared. However unlike "new" variables "static" variables do not loose their value between calls. ```c main() { for (new loopVar = 0; loopVar < 4; loopVar++) { MyFunc(); } } MyFunc() { new i = 0; printf("%d", i); i++; printf("%d", i); } ``` Every time the function is called i is reset to 0, so the resulting output will be: ```c 0 1 0 1 0 1 0 1 ``` If we replace the "new" with "static" we get: ```c main() { for (new loopVar = 0; loopVar < 4; loopVar++) { MyFunc(); } } MyFunc() { static i = 0; printf("%d", i); i++; printf("%d", i); } ``` And, as static locals keep their value between calls, the resulting output it: ```c 0 1 1 2 2 3 3 4 ``` The value given in the declaration (if one is given, like new, static variables default to 0) is the value assigned to the variable the first time the function is called. So if "static i = 5;" were used instead the result would be: ```c 5 6 6 7 7 8 8 9 ``` Because of the way static variables are stored, they are in fact global variables, the compiler checks they are used in the correct place. As a result decompiled scripts cannot distinguish between normal globals, global statics and local statics and they are all given as normal globals. You can also have static functions which can only be called from the file in which they are declared. This is useful for private style functions. ## `stock` stock is used to declare variables and functions which may not be used but which you don't want to generate unused warnings for. With variables stock is like const in that it is a modifier, not a full declaration, so you could have: ```c new stock gMayBeUsedVar; static stock g_sMayBeUsedVar; ``` If the variable or function is used the compiler will include it, if it is not used it will exclude it. This is different to using #pragma unused (symbol) as that will simply surpress (i.e. hide) the warning and include the information anyway, stock will entirely ignore the unused data. stock is most commonly used for custom libraries. If you write a library you provide a whole load of functions for other people to use but you've no idea if they'll use them or not. If your code gives loads of warnings for every function a person doesn't use people will complain (unless it's on purpose as they HAVE to use that function (e.g. for initialising variables). Having said that however, going from personal experience with YSI people will complain anyway. ```c main() { Func1(); } Func1() { printf("Hello"); } Func2() { printf("Hi"); } ``` Here Func2 is never called so the compiler will give a warning. This may be useful as you may have forgotten to call it, as is generally the case in a straight script, however if Func1 and Func2 are in a library the user may simply not need Func2 so you do: ```c main() { Func1(); } stock Func1() { printf("Hello"); } stock Func2() { printf("Hi"); } ``` And the function won't be compiled and the warning removed.
openmultiplayer/web/docs/scripting/language/Initialisers.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/language/Initialisers.md", "repo_id": "openmultiplayer", "token_count": 7348 }
328
# Proposed function library --- Since PAWN is targeted as an application extension language, most of the functions that are accessible to PAWN programs will be specific to the host application. Nevertheless, a small set of functions may prove useful to many environments. ### • Core functions The “core” module consists of a set of functions that support the language itself. Several of the functions are needed to pull arguments out of a variable argument list (see page 80). | clamp | | Force a value inside a range | | -------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------: | | Syntax | clamp(value, min=cellmin, max=cellmax) | | | | value | The value to force in a range | | | min | The low bound of the range. | | | max | The high bound of the range. | | Returns | value if it is in the range min – max; min if value is lower than min; and max if value is higher than max. | | | See also | max, min | | | funcidx | | Return a public funtion index | | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------: | | Syntax | funcidx(const name[]) | | | Returns | The index of the named public function. If no public function with the given name exists, funcidx returns −1. | | | Notes: | A host application runs a public function from the script by passing the public function’s index to amx_Exec. With this function, the script can query the index of a public function, and thereby return the “next function to call” to the application. | | | getarg | | Get an argument | | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------: | | Syntax | getarg(arg, index=0) | | | | arg | The argument sequence number, use 0 for first argument. | | | index | The index, in case arg refers to an array. | | Returns | The value of the argument | | | Notes: | This function retrieves an argument from a variable argument list. When the argument is an array, the index parameter specifies the index into the array. The return value is the retrieved argument. | | | See also | numargs, setarg | | | heapspace | | Return free heap space | | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------: | | Syntax | heapspace() | | | Returns | The free space on the heap. The stack and the heap occupy a shared memory area, so this value indicates the number of bytes that is left for either the stack or the heap. | | | Notes: | In absence of recursion, the pawn parser can also give an estimate of the required stack/heap space. | | | max | | Return the highest of two numbers | | -------- | ------------------------------------- | ---------------------------------------------------: | | Syntax | max(value1, value2) | | | | value1 | | | | value2 | The two values for which to find the highest number. | | Returns | The higher value of value1 and value2 | | | See also | clamp, min | | | min | | Return the lowest of two numbers | | -------- | ------------------------------------- | --------------------------------------------------: | | Syntax | min(value1, value2) | | | | value1 | | | | value2 | The two values for which to find the lowest number. | | Returns | The lowest value of value1 and value2 | | | See also | clamp, max | | | numargs | | Return the number of arguments | | -------- | -------------------------------------------------------------------------------------------------------------- | -----------------------------: | | Syntax | numargs() | | | Returns | The number of arguments passed to a function; numargs is useful inside functions with a variable argument list | | | See also | getarg, setarg | | | random | | Return a pseudo-random number | | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------: | | Syntax | random(max) | | | | max | The limit for the random number | | Returns | A pseudo-random number in the range 0 - max-1 | | | Notes: | The standard random number generator of pawn is likely a linear congruential pseudo-random number generator with a range and a period of 2³¹. Linear congruential pseudo-random number generators suffer from serial correlation (especially in the low bits) and it is unsuitable for applications that require high-quality random numbers. | | | setarg | | | | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | -----------------------------------------------------: | | Syntax | setarg(arg, index=0, value) | | | | arg | The argument sequence number, use 0 for first argument | | | index | The index, in case arg refers to an array | | | value | The value to set the argument to | | Returns | true on success and false if the argument or the index are invalid | | | Notes: | This function sets the value of an argument from a variable argument list. When the argument is an array, the index parameter specifies the index into the array. | | | See also | getarg, numargs | | | swapchars | | Swap bytes in a cell | | --------- | ----------------------------------------------------------------------------------------------- | ------------------------------------: | | Syntax | swapchars(c) | | | | c | The value for which to swap the bytes | | Returns | A value where the bytes in parameter "c" are swapped (the lowest byte becomes the highest byte) | | | tolower | | Convert a character to lower case | | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------: | | Syntax | tolower(c) | | | | c | The character to convert to lower case. | | Returns | The upper case variant of the input character, if one exists, or the unchanged character code of “c” if the letter “c” has no lower case equivalent. | | | Notes: | Support for accented characters is platform-dependent | | | See also | toupper | | | toupper | | Convert a character to upper case | | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------: | | Syntax | toupper(c) | | | | c | The character to convert to upper case. | | Returns | The lower case variant of the input character, if one exists, or the unchanged character code of “c” if the letter “c” has no upper case equivalent. | | | Notes: | Support for accented characters is platform-dependent | | | See also | tolower | | --- Properties are general purpose names or values. The property list routines maintain a list of these name/value pairs that is shared among all abstract machines. The property list is therefore a way for concurrent abstract machines to exchange information. All “property maintenance” functions have an optional “id” parameter. You can use this parameter to indicate which abstract machine the property belongs to. (A host application that supports concurrent abstract machines will usually provide each abstract machine with a unique id.) When querying (or deleting) a property, the id value that you pass in is matched to the id values of the list. A property is identified with its “abstract machine id” plus either a name or a value. The name-based interface allows you to attach a value (e.g. the handle of an object) to a name of your choosing. The value-based interface allows you to attach a string to a number. The difference between the two is basically the search key versus the output parameter. All property maintenance functions have a “name” and a “value” parameter. Only one of this pair must be filled in. When you give the value, the getprop- erty function stores the result in the string argument and the setproperty function reads the string to store from the string argument. The number of properties that you can add is limited only by available memory. **getproperty(id=0, const name[]=“”, value=cellmin, string[]=“”)** Returns the value of a property when the name is passed in; fills in the string argument when the value is passed in. The name string may either be a packed or an unpacked string. If the property does not exist, this function returns zero. **setproperty(id=0, const name[]=“”, value=cellmin, const string[]=“”)** Add a new property or change an existing property. **deleteproperty(id=0, const name[]=“”, value=cellmin)** Returns the value of the property and subsequently removes it. If the property does not exist, the function returns zero. **existproperty(id=0, const name[]=“”, value=cellmin)** Returns true if the property exists and false otherwise. ### • Console functions For testing purposes, the console functions that read user input and that out- put strings in a scrollable window or on a standard terminal display are often convenient. Not all terminal types and implementations may implement all functions —especially the functions that clear the screen, set foreground and background colours and control the cursor position, require an extended terminal control. **getchar(echo=true)** Read one character from the keyboard and return it. The function can optionally echo the character on the console window. **getstring(string[], size=sizeof string, bool** pack=false): Read a string from the keyboard. Function getstring stops reading when either the enter key is typed, or the maximum length is reached. The maximum length is in cells (not characters) and it includes a terminating nul character. The function can read both packed and unpacked strings; when reading a packed string, the function may read more characters than the size parameter specifies, because each cell holds multiple characters. The return value is the number of characters read, excluding the terminating nul character. **getvalue(base=10, end=‘ r’, ...)** Read a value (a signed number) from the keyboard. The getvalue function allows you to read in a numeric radix from 2 to 36 (the base parameter) with decimal radix by default. By default the input ends when the user types the enter key, but one or more different keys may be selected (the end parameter and subsequent). In the list of terminating keys, a positive number (like ’\r’) displays the key and terminates input, and a negative number terminates input without displaying the terminating key. **print(const string[], foreground=-1, background=-1)** Prints a simple string on the console. The foreground and background colours may be optionally set (but note that a terminal or a host application may not support colours). See setattr below for a list of colours. **printf(const format[], ...)** Prints a string with embedded codes: %b print a number at this position in binary radix %c a character at this position %d print a number at this position in decimal radix %f print a floating point number at this position (assuming floating point support is present) %q print a fixed point number at this position (assuming fixed point support is present) %r print either a floating point number or a fixed point number at this position, depending on what is available; if both floating point and fixed point support is present, %r is equivalent to %f (i.e. printing a floating point number) %s print a character string at this position %x print a number at this position in hexadecimal radix The printf function works similarly to the printf function of the C language. **clrscr()** Clears the console and sets the cursor in the upper left corner. **clreol()** Clears the line at which the cursor is, from the position of the cursor to the right margin of the console. This function does not move the cursor. **gotoxy(x=1, y=1)** Sets the cursor position on the console. The upper left corner is at (1,1). **setattr(foreground=-1, background=-1)** Sets foreground and background colours for the text written onto the console. When either of the two parameters is negative (or absent), the respective colour setting will not be changed. The colour value must be a value between zero and seven, as per the ANSI Escape sequences, ISO 6429. Predefined constants for the colours are black (0), red (1), green (2), yellow (3), blue (4), magenta (5), cyan (6) and white (7). ### • Date/time functions Functions to get and set the current date and time, as well as a millisecond resolution “event” timer are described in an application note entitled “Time Functions Library” that is available separately. ### • File input/output Functions for handling text and binary files, with direct support for UTF-8 text files, is described in an application note entitled “File I/O Support Library” that is available separately. ### • Fixed point arithmetic The fixed-point decimal arithmetic module for pawn is described in an appli- cation note entitled “Fixed Point Support Library” that is available separately. ### • Floating point arithmetic The floating-point arithmetic module for pawn is described in an application note entitled “Floating Point Support Library” that is available separately. ### • String manipulation A general set of string manipulation functions, operating on both packed and unpacked strings, is described in an application note entitled “String Manipu- lation Library” that is available separately. ### • DLL call interface The version of the abstract machine that is build as a Dynamic Link Library for Microsoft Windows has a general purpose function to call a function from any DLL in memory. Two companion functions load a DLL from disk into memory and unload it. The functions have been set up so that it is possible to run the same compiled script in both 16-bit and 32-bit versions of Microsoft Windows. All string parameters may be in both packed or unpacked form. **calldll(const dllname[], const function[], const typestr[], ...)** Parameter dllname is the module name of the DLL, typically this is the same as the filename. If the DLL cannot be found, calldll tries again after appending “16” or “32” to the filename, depending on whether you run the 16-bit or the 32-bit version of the abstract machine. For example, if you set dllname to “USER”, calldll connects to USER in the 16-bit version of the abstract machine and to USER32 in the 32-bit version. Parameter function is the name of the function in the DLL. In the 16-bit version of, this name is case insensitive, but in the 32-bit version of Microsoft Windows, names of exported functions are case sensitive. In the 32-bit version of the abstract machine, if function cannot be found, calldll appends an upper case “A” to the name and tries again —many functions in 32-bit Windows exist in two varieties: ANSI and “Wide”, and these functions are suffixed with an “A” or a “W” respec- tively. So if function is “MessageBox”, calldll will call MessageBox in the 16-bit version of Windows and MessageBoxA in the 32-bit ver- sion. The string parameter typestr indicates the number of arguments that the function (in the DLL) takes and what the types are. For every argument, you add one letter to the typestr string: h a Windows “handle” (HWND, HDC, HPALETTE, HMEM, etc.) i an integer with a “native size” (16-bit or 32-bit, depending on the “bitness” of the abstract machine). l a 32-bit integer p a packed string s an unpacked string w a 16-bit unsigned integer When the letter is in lower case, the corresponding parameter is passed “by value”; when it is in upper case, it is passed “by reference”. The difference between packed and unpacked strings is only relevant when the parameter is passed by reference. **loaddll(const dllname[])** Loads the specified DLL into memory (or increments its usage count it were already loaded). The name in parameter dllname may contain a full path. If no path is specified, Microsoft Windows searches in its system directories for the DLL. Similarly to the calldll function, this function appends “16” or “32” to the DLL name if the DLL cannot be found, and then tries again. **freedll(const dllname[])** Decrements the DLL’s usage count and, if the count becomes zero, removes the DLL from memory. The name in parameter dllname may contain a full path, but the path information is ignored. Similarly to the calldll function, this function appends “16” or “32” to the DLL name if the DLL cannot be found, and then tries again. **iswin32()** Returns true if the abstract machine is the 32-bit version (running in a 32-bit version of Microsoft Windows); returns false if the abstract machine is the 16-bit version (running either on Windows 3.1x or on any later version of Microsoft Windows). --- `amx_Exec: see the “Implementor’s Guide”` --- [Go Back to Contents](00-Contents.md)
openmultiplayer/web/docs/scripting/language/reference/10-Proposed-function-library.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/language/reference/10-Proposed-function-library.md", "repo_id": "openmultiplayer", "token_count": 13791 }
329
--- title: HTTP Error Response Codes description: HTTP error response codes. --- :::note These codes compliment ordinary [HTTP](../functions/HTTP) response codes returned in 'response_code' ::: | Code | Error | Description | |------|-------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 1 | HTTP_ERROR_BAD_HOST | Indicates that the URL used in an HTTP request is invalid or cannot be resolved by the DNS server. | | 2 | HTTP_ERROR_NO_SOCKET | Indicates that there was a failure in establishing a network socket connection when making an HTTP request. | | 3 | HTTP_ERROR_CANT_CONNECT | Indicates that the client is unable to establish a connection to the server when making an HTTP request. This error can occur due to various reasons, including network connectivity issues or unavailability of the server. | | 4 | HTTP_ERROR_CANT_WRITE | Indicates that there was a failure in writing data during an HTTP request. This error can occur for various reasons related to the client, server, or network. | | 5 | HTTP_ERROR_CONTENT_TOO_BIG | Indicates that the size of the content being sent in the HTTP request exceeds the maximum limit allowed by the server or the server's configuration. | | 6 | HTTP_ERROR_MALFORMED_RESPONSE | Indicates that the HTTP response received from the server is in an unexpected or invalid format. This error suggests that the response does not comply with the HTTP protocol standards. | ## Some Common HTTP Error Response Codes ### 1xx Informational | Code | | |------|---------------------| | 100 | Continue | | 101 | Switching Protocols | | 102 | Processing | ### 2xx Success | Code | | |------|-----------------| | 200 | OK | | 201 | Created | | 204 | No Content | | 206 | Partial Content | ### 3xx Redirection | Code | | |------|--------------------| | 301 | Moved Permanently | | 302 | Found | | 304 | Not Modified | | 307 | Temporary Redirect | ### 4xx Client Errors | Code | | |------|--------------------| | 400 | Bad Request | | 401 | Unauthorized | | 403 | Forbidden | | 404 | Not Found | | 405 | Method Not Allowed | | 429 | Too Many Requests | ### 5xx Server Errors | Code | | |------|-----------------------| | 500 | Internal Server Error | | 502 | Bad Gateway | | 503 | Service Unavailable | | 504 | Gateway Timeout |
openmultiplayer/web/docs/scripting/resources/http-error-response-codes.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/resources/http-error-response-codes.md", "repo_id": "openmultiplayer", "token_count": 1526 }
330
--- title: Panel States description: Information about byte size and its corresponding panel state bits. --- :::note Panel states are used by natives such as [GetVehicleDamageStatus](../functions/GetVehicleDamageStatus) and [UpdateVehicleDamageStatus](../functions/UpdateVehicleDamageStatus). ::: ## Which nibble stores what? - The **first nibble** stores the state of the **front-left** panel for a car or the **(left-)engine** for a plane. - The **second nibble** stores the state of the **front-right** panel for a car or the **(right-)engine** for a plane. - The **third nibble** stores the state of the **back-left** panel for a car or the **rudder (on the vertical stabilizer)** for a plane. - The **fourth nibble** stores the state of the **back-right** panel for a car or the **elevators (on the tail)** for a plane. - The **fifth nibble** stores the state of the **windshield** for a car or the **ailerons (on the wings)** for a plane. - The **sixth nibble** stores the state of the **front bumper** for a car. - The **seventh nibble** stores the state of the **back bumper** for a car. Not every vehicle supports all of the mentioned panels. The degree of damage affects the handling of a plane quite a lot and the plane will produce black smoke from whatever part is damaged. For most panels there are 4 states: **undamaged (value 0)**, **crushed (value 1)**, **hanging loose (value 2)** and **removed (value 3)**. The crushed and hanging loose states are quite buggy (when you go from a hanging loose state to a crushed state, the panel is hanging loose AND crushed instead of just crushed, but it is only crushed again when the vehicle is restreamed, ...). To fix this weird behaviour, just reset the damage for that panel first and then apply the needed state. In this way it is also possible to have a panel that is hanging loose when driving but is not physically crushed (to better see what this means, go directly from 0 to 2, instead of going from 0 to 1 to 2). It seems that you can only read the value of the windshield. Setting it does update the value on the server, but it does not result in any physical change on the vehicle. Notice that the nibbles are counted from behind, so the first nibble is the rightmost nibble. --- ## Example The following code tells that for a car the front and back bumpers are removed: `00000011 00110000 00000000 00000000` However, SA-MP returns a decimal number so you have to convert it to a binary number first to get a result like above. What SA-MP would return given the example above is this: `53477376` --- ## Example usage To remove the front bumper of a car while keeping the other panels unchanged: ```c new VEHICLE_PANEL_STATUS:panels, VEHICLE_DOOR_STATUS:doors, VEHICLE_LIGHT_STATUS:lights, VEHICLE_TIRE_STATUS:tires; GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires); UpdateVehicleDamageStatus(vehicleid, (panels | VEHICLE_PANEL_STATUS:0b00000000001100000000000000000000), doors, lights, tires); // The '0b' part means that the following number is in binary. Just the same way that '0x' indicates a hexadecimal number. ``` ## See also - [Vehicle Panel Status](../resources/vehicle-panel-status)
openmultiplayer/web/docs/scripting/resources/panelstates.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/resources/panelstates.md", "repo_id": "openmultiplayer", "token_count": 882 }
331
--- title: Scripting Basics description: A short tutorial guiding you through the basics of the Pawn language and SA-MP/open.mp APIs. sidebar_label: Scripting Basics --- Below is an example of possibly the most basic script you can write: ```c #include <a_samp> main() { print("Hello World!"); return 1; } ``` The various aspects will be covered in turn but we'll start by looking at the first line. --- ## Include ```c #include <a_samp> ``` This basically loads the code from pawno/includes/a_samp.inc into your script, so everything it has you can use. One of the things it has is: ```c #include <core> #include <float> #include <string> #include <file> #include <time> #include <datagram> #include <a_players> #include <a_vehicles> #include <a_objects> #include <a_sampdb> ``` This includes all the other files in that directory so by adding that one line you have access to all the functions in SA:MP (more on functions later). --- ## Calls The next part has two sides of a function call. main() is a function which you write the code for and is called from elsewhere, print(string\[\]) is a function with the code elsewhere which you call. Currently all this will do is load, print a string (i.e. print "Hello World!" (without the ""s) (a tradition in all scripting languages)) to the server console and end. The: ```c return 1; ``` Passes a value (1) back to the place which called main to tell it what happened (the exact value passed here doesn't matter but in other places it does). You now have your first (very basic) script. If you select file->new in pawno it will give you a much bigger start point will all the callbacks in (see below), including main (which isn't technically a callback but acts like one). --- ## Statements The print and return lines have ';' (a semi colon) on them, this just denotes the end of a statement (a statement is a group of one or more functions and operators which together do something, similar to a sentence in common language). Most people put separate statements on separate lines but this is not required, it just makes things clearer, the following is equally valid: ```c main() { print("Hello World!"); return 1; } ``` The {}s (braces (curly brackets), not parenthesis (brackets)) enclose a group of statements which should be executed together (like a paragraph in common language). If you did: ```c main() print("Hello World!"); return 1; ``` You would get an error because now the "return 1;" statement is not grouped so is not part of main. Braces group a set of statements into a single statement (called a compound statement) and functions have a single statement with them. Without the braces print and return are entirely separate statements, so there's two or them so, as a function can only have a single statement, the second is not in a function, which code can't be. But generally, you can expand compound statements with the use of the comma (,) operator but this is not suggested as it is not the best coding practice. An example follows: ```c main() print("Hello World!"), return 1; ``` # Functions A function is basically a chunk of code which does something and can be told to do this thing from somewhere else. It can also pass data about what it did back to the place which told it to run (the place which "called" it). --- ## Calling ```c print("Hello World!"); ``` As described in [Starting out](/wiki/Scripting_Basics#Starting_out "Scripting Basics"), this calls the function called "print" (defined in a_samp.inc, which is why you need to include it) and tells it to display something in the server console (the word hello). A function consists of the function name (e.g. print), which tells the system which chunk of code you want to call, and a parameter list, enclosed in ()s after the function name, which pass additional data to the function to help it run. If you didn't have parameters you would need millions of functions: ```c printa(); printaa(); printab(); printac(); etc... ``` Functions can have as many parameters as you like, from 0 up (there may be an upper limit but it's at least 128): ```c printf("Hello World!", 1, 2, 3, 4, 5, 6); ``` Don't worry about what that function does for now, just that it has 7 parameters, each separated by a comma. --- ## Defining As well as being able to call existing functions you can also write and call your own: ```c #include <a_samp> main() { return MyFunction(); } MyFunction() { print("Hello World!"); return 1; } ``` This just does exactly the same as the original code but is arranged differently. When main() is called when the mode is started (it's called automatically) it calls the new custom function called MyFunction(). This function prints the message in the server console then returns the number 1 to main(). main() takes the returned value (1) and then returns it to the server itself (i.e. the place which called main in the first place). As "return MyFunction();" is a single statement you could do: ```c #include <a_samp> main() return MyFunction(); MyFunction() { print("Hello World!"); return 1; } ``` But most people don't for clarity. You can also not use the MyFunction return value at all and do: ```c #include <a_samp> main() { MyFunction(); return 1; } MyFunction() { print("Hello World!"); return 1; } ``` --- ## Parameters Parameters are a type of [variable](/wiki/Scripting_Basics#Variables "Scripting Basics") which you don't need to declare as they come from the place which called the function: ```c #include <a_samp> main() { return MyFunction("Hello World!"); } MyFunction(string[]) { print(string); return 1; } ``` This code still does the same thing but we're now telling MyFunction() what to display. The call passes the string "Hello World!" to the function where it is stored in a variable called string (the \[\] means it's an [array](/wiki/Scripting_Basics#Arrays "Scripting Basics") as explained later). The print function is the called, passing the contents of the string variable, we know it's a variable because it doesn't have the "" any more. # Variables A variable is basically a bit of memory, it's where data is stored and can be changed and read as required. Variables are one or more cells, a cell is 32 bits (4 bytes) big and by default signed so they can store from -2147483648 to 2147483647 (although -2147483648 is poorly defined in PAWN and gives odd results if displayed). A variable made from more than one cell is called an array, strings are a special type of array where each cell holds a character of the string (or 4 characters in packed strings, but they're not covered here). --- ## Declaration To create a new variable you have to declare it: ```c new myVariable; ``` This tells the system to create a new variable called myVariable, the initial value of this variable will be 0. --- ## Setting ```c new myVariable = 7; ``` This declares a new variable and sets it's initial value to 7, so printing the variable now will give 7. To display a variable which isn't a string we need to go back to the printf() function mentioned earlier and do: ```c new myVariable = 7; printf("%d", myVariable); ``` Again, for now all you need to know is that this will print the value of myVariable (i.e. 7 at this point) to the server. ```c new myVariable = 7; printf("%d", myVariable); myVariable = 8; printf("%d", myVariable); ``` That code will print 7, change the value of the variable to 8 and display the new value in the server window too. There are many other things you can do to variables, some are listed below, most are listed elsewhere: ```c myVariable = myVariable + 4; ``` Sets the value of myVariable to the old value of myVariable plus 4, i.e. increase it's value by 4. This can also be written as: ```c myVariable += 4; ``` Which just means "increase myVariable by 4". ```c myVariable -= 4; ``` That will decrease the value by 4. ```c myVariable *= 4; ``` That will multiply the value by 4. ```c myVariable /= 4; ``` That will divide the value by 4. --- ## Arrays ### Declaration --- An array is a variable in which you can store multiple pieces of data at once and access them dynamically. An array is declared to a set size at compile time so you need to know how many pieces of data you need to store in advance, a good example of this is the very common MAX_PLAYERS array, this will have one slot for every possibly connected player, so you know data for one player will not interfere with data for another player (more on defines later). ```c new myArray[5]; ``` That code will declare an array 5 slots big, so you can store 5 pieces of normal data at once in that single what you can't do is something like the following: ```c new myVariable = 5, myArray[myVariable]; ``` That code looks like it would create an array the size of whatever number is stored in myVariable (here 5 but it could be anything), but you can't do this. In PAWN the memory for variables is assigned when you compile your code, this means arrays are always one size, you can't set the size to anything you like whenever you like. --- ### Accessing To set a value in an array you need to say which part of the array you want to store the data in, this CAN be done with another variable: ```c new myArray[5]; myArray[2] = 7; ``` This will declare an array with 5 slots and give the THIRD slot a value of 7, given that variables always start as 0 this will make the values in the array: ``` 0, 0, 7, 0, 0 ``` Why is it not: ``` 0, 7, 0, 0, 0 ``` you're wondering? It's because counting actually starts from the number 0, not 1. Consider the following: ``` 2, 4, 6, 8 ``` If you go through the list then after the number 2 you have already had one number (the 2), this means that if you are counting the numbers by the time you reach the number 4 you are already at one, you're not at one when you reach the 2, you're at zero. Thus the 2 is at position zero and the 4 is at position one, and thus it follows that the 6 is at position two, which is where the 7 in the first example above is. If we label the slots for the first example we get: ``` 0 1 2 3 4 0 0 7 0 0 ``` There are five slots but as you can see, and this is very important, THERE IS NO SLOT FIVE, doing the following could crash your server: ```c new myArray[5]; myArray[5] = 7; ``` As mentioned above the array index (the index is the slot to which you're writing) can be anything, a number, a variable, or even a function which returns a value. ```c new myArray[5], myIndex = 2; myArray[myIndex] = 7; ``` Once you have an array and an index you can use that block exactly as if it were any other variable: ```c myArray[2] = myArray[2] + 1; myArray[2] += 1; myArray[2]++; ``` --- ### Example As mentioned above a common type of array is the MAX_PLAYERS array. MAX_PLAYERS is not a variable, it's a define which is explained later, but for now accept that it is a constant number equal to the max number of players a server can hold (this by default is 500, even if you change the number in your server.cfg file). The following code uses normal variables to hold data for 4 players and do something with those players in a function (for simplicity's sake assume MAX_PLAYERS is 4 for now): ```c new gPlayer0, gPlayer1, gPlayer2, gPlayer3; SetPlayerValue(playerid, value) { switch(playerid) { case 0: gPlayer0 = value; // is the same as doing if (playerid == 0) case 1: gPlayer1 = value; // is the same as doing if (playerid == 1) case 2: gPlayer2 = value; // is the same as doing if (playerid == 2) case 3: gPlayer3 = value; // is the same as doing if (playerid == 3) } } ``` See the section on control structures for more information on what's going on there, also note this could be done as a switch but that's less clear for the example and effectively the same code anyway. Now compare that to using an array with one slot per player, bearing in mind an array index can be any value: ```c new gPlayers[MAX_PLAYERS]; SetPlayerValue(playerid, value) { gPlayers[playerid] = value; } ``` That will create a global array (see section on scope) with one slot for every player, then the function will assign whatever is in the variable "value" to the slot for the player specified. The first example was large with only four players, using 4 lines per player, that's 2000 lines for 500 players (if can be less but it's still a lot), the second version is a single line no matter how many players you have. --- ## Strings ### Basic use --- A string is a special type of array, one which is used to hold multiple characters to create a word or sentence or other human readable text. A character is one byte big (although there are extended sets where a character is multiple bytes but these are not well defined in SA:MP) and by default a character takes up one cell (one normal variable or one array slot). Characters are encoded in a system called [ASCII](http://www.asciitable.com/ "http://www.asciitable.com/"), the character "A" is represented by the number 65, telling the system to display a number will give 65, telling the system to display a character will give a capital a. Obviously is a single character takes up a single cell multiple characters (i.e. text) will take up multiple cells, collections of cells, as just explained, are called arrays. Strings in PAWN (and other languages) are what's called "NULL terminated", this means that when 0 is reached, the string ends. This is not the same as the character "0", represented by the number 48, this is the NULL character, represented by the number 0. This means that you can have a string array 20 cells large but only have a string 3 characters long if the fourth character is the NULL character, signalling the end of the string. You can not however have a string 20 characters long as the NULL character MUST be in the string, so in a 20 cell array you can have a 19 character string and a NULL termination character. ```c new myString[16] = "Hello World!"; ``` That code declares a new string with enough space for a 15 character string and sets it initially to the 5 character string "Hello World!", the double quotes around the text indicate that it's a string. Internally the array will look like: ``` 104 101 108 108 111 0 x x x x x x x x x x ``` The "x"s mean anything, in this example they will all be 0 but as they're after the null character is doesn't matter what they are, they won't affect the string. Strings can be manipulated like normal arrays, for example: ```c new myString[16] = "Hello World!"; myString[1] = 97; ``` Will change the character in slot 1 to the character represented by the number 97 (a lower case "a"), resulting in the string reading "hallo". This can be written much more readably and easy to edit as: ```c new myString[16] = "Hello World!"; myString[1] = 'a'; ``` The single quotes around the "a" mean it's a character, not a string, characters don't need to be NULL terminated as they're only ever one cell long, they can also be used interchangeably with numbers if you know what they represent. ```c new myString[16] = "Hello World!"; myString[1] = '\0'; ``` '\\0' is two characters, however the \\ is a special character which modifies the next character, \\0 means NULL, that code is the same as doing: ```c new myString[16] = "Hello World!"; myString[1] = 0; ``` But is NOT the same as doing: ```c new myString[16] = "Hello World!"; myString[1] = '0'; ``` The first and second versions will result in the string being simply: ``` h ``` The third version will result in the string being: ``` h0llo ``` --- ### Escape character As briefly mentioned a backslash is a special character, doing: ``` '\' ``` or: ``` "\" ``` Will give a compiler error because the \ modifies the next character so those constants will not be ended correctly, this can be used to create characters which can't normally be created, for example: ```c new myString[4] = "\""; ``` That code will create a string consisting of only a double quote, normally a double quote signals the end of a written string but the backslash makes the double quote immediately after it a part of the string, and the double quote after that ends the string instead. Other special characters are: | Code | Name | Purpose | | ------ | --------------- | ------------------------------------------------------------------------------------------------------- | | \0 | NULL character | Ends a string. | | EOS | NULL character | (same as above) | | \n | Line feed | use \n for a new line in Linux (also works in Windows) | | \r | Carriage return | Use \r\n for a new line in Windows | | \\\\ | Backslash | Used to put an actual backslash in a string | | \' | Single quote | Used to use an actual single quote as a character in single quotes (use: '\'') | | \" | Double quotes | Used to put an actual double quote in a string | | \xNNN; | Hex number | Used to set the character to the character represented by the hex number specified in place on NNN | | \NNN; | Number | Used to set the character to the character represented by the number specified in place of NNN (see \0) | Used to set the character to the character represented by the number specified in place of NNN (see \\0) There are others but those are the main ones. --- ## Tags A tag is an additional piece of information on a variable which defines where it can be used, providing information about its functionality. Tags can be strong (starting with a capitalized letter) or weak. For example: ```c new Float:a = 6.0; ``` The "Float" part is the tag, this defines this variable as a float (non-whole/real number) and determines where it can be used. ```c native SetGravity(Float:gravity); ``` This means the SetGravity function takes a single parameter which has to be a float, for example: ```c SetGravity(6.0); new Float:fGrav = 5.0; SetGravity(fGrav); ``` That will set the gravity to 6 (6.0 as a float) then 5 (5.0 as a float). Using the wrong tag in the wrong place will often give a tag mismatch: ```c SetGravity(MyTag:7); ``` That will try set the gravity to 7 with the tag "MyTag", that is clearly not a "Float" so is wrong. Also note that tags are case sensitive. Custom tags can be defined by users: ```c new myTag: variable = 0, AppleTag: another = 1; ``` This is perfectly valid, however, when adding these two variables _directly_, you must use '\_:' to 'de-tag' them, otherwise the compiler will produce a 'tag mismatch' warning. --- ## Scope Scope is where a variable can be used. There are four main scopes: local, local static, global and global static. All variables can only be used after they are declared so this is right: ```c new var = 4; printf("%d", var); ``` This is wrong: ```c printf("%d", var); new var = 4; ``` --- ### local A local variable is one declared "new" inside a function or part of a function: ```c MyFunc() { new var1 = 4; printf("%d", var1); { // var1 still exists as this is a lower level new var2 = 8; printf("%d %d", var1, var2); } // var2 no longer exists as this is a higher level } // var1 no longer exists ``` Local variables are reset every time, for example: ```c for (new i = 0; i < 3; i++) { new j = 1; printf("%d", j); j++; } ``` Will print: ``` 1 1 1 ``` Because j is created, printed, incremented then destroyed, then the code loops. --- ### static local A static local can be used in the same place as a local but doesn't forget it's old value, for example: ```c MyFunc() { static var1 = 4; printf("%d", var1); { // var1 still exists as this is a lower level static var2 = 8; printf("%d %d", var1, var2); } // var2 no longer exists as this is a higher level } // var1 no longer exists ``` That code will behave exactly the same as the new example, however this: ```c for (new i = 0; i < 3; i++) { static j = 1; printf("%d", j); j++; } ``` Will print: ``` 1 2 3 ``` Because `j` is static so remembers its old value. --- ### global Global variables are declared outside a function and can be used in any functions: ```c new gMyVar = 4; MyFunc() { printf("%d", gMyVar); } ``` They are never reset or lost. --- ### global static Global static variables are like normal globals but can only be used in the file in which they are declared: File1: ```c static gsMyVar = 4; MyFunc() { printf("%d", gsMyVar); } #include "File2" ``` File2: ```c MyFunc2() { // This is wrong as gsMyVar doesn't exist here printf("%d", gsMyVar); } ``` static can also be applied to functions in the same way.
openmultiplayer/web/docs/scripting/resources/start.md/0
{ "file_path": "openmultiplayer/web/docs/scripting/resources/start.md", "repo_id": "openmultiplayer", "token_count": 6832 }
332
--- title: OnVehiclePaintjob description: يتم إستدعاء هذا الكالباك عند تغيير طلاء السيارة في مرآب التعديل tags: ["vehicle"] --- <div dir="rtl" style={{ textAlign: "right" }}> ## الوصف يتم إستدعاء هذا الكالباك عند تغيير طلاء السيارة في مرآب التعديل | Name | Description | | --------- | ------------------------------------------------------------ | | playerid | إيدي اللاعب الذي غيّر طلاء السيارة | | vehicleid | إيدي السيارة التي تم تغيير طلائها | | paintjobid | اللون الذي تم تغيير اللون الأساسي للمركبة إليه | ## Returns يتم إستدعائه أولا في ال(الغيم مود¹) إذا يرجع 0 و يقوم أيضا بتعطيل بقية الفيلترسكريبتات من رأيته ¹ غيم مود = gamemode ## أمثلة </div> ```c public OnVehiclePaintjob(playerid, vehicleid, paintjobid) { new string[128]; format(string, sizeof(string), "You have changed your vehicle's paintjob to %d!", paintjobid); SendClientMessage(playerid, 0x33AA33AA, string); return 1; } ``` <div dir="rtl" style={{ textAlign: "right" }}> ## Notes :::tip هذا الكالب باك لا يتم إستدعائه من قبل (ChangeVehiclePaintjob). يجب عليك إستعمال OnVehicleChangePaintJob من vSync لمعرفة إن قام اللاعب بدفع ثمن تغيير الطلاء ::: :::warning الأخطاء المعروفة : معاينة أحد المكونات في مرآب التعديل قد يستدعي هذا الكال باك ::: ## الاستدعاءات او كالباكات ذات الصلة قد تكون الاستدعاءات التالية مفيدة، حيث أنها ذات صلة بهذا الاستدعاء بطريقة أو بأخرى - [OnVehicleRespray](OnVehicleRespray): هذا الكالباك يتم إستدعائه عندما يتم تغيير طلاء السيارة - [OnVehicleMod](OnVehicleMod): هذا الكالباك يتم إستدعائه عندما يتم تغيير مكونات السيارة ## وظائف ذات صلة قد تكون الوظائف التالية مفيدة، حيث أنها ذات صلة بهذا الاستدعاء بطريقة أو بأخرى - [ChangeVehicleColor](../functions/ChangeVehicleColor): يغير لون السيارة - [ChangeVehiclePaintjob](../functions/ChangeVehiclePaintjob): يغير ستيكرات السيارة </div>
openmultiplayer/web/docs/translations/ar/scripting/callbacks/OnVehiclePaintjob.md/0
{ "file_path": "openmultiplayer/web/docs/translations/ar/scripting/callbacks/OnVehiclePaintjob.md", "repo_id": "openmultiplayer", "token_count": 1373 }
333
--- title: OnClientMessage description: Ovaj callback se poziva kada god NPC vidi ClientMessage. tags: [] --- ## Deskripcija Ovaj callback se poziva kada god NPC vidi ClientMessage (poruku poslanu od game-klijenta). Ovo će biti svaki put kada `SendClientMessageToAll` funkcija bude pozvana i svaki put kada funkcija `SendClientMessage` bude slala prema NPC-u. Ovaj callback se neće pozvati kada neko kaže nešto. Za verziju ovoga sa tekstom igrača pogledaj funkciju NPC:OnPlayerText. | Ime | Deskripcija | | ------ | -------------------------- | | color | Boja ClientMessage poruke. | | text[] | Prava poruka. | ## Returns Ovaj callback ne obrađuje povratne vrijednosti (returnove). ## Primjeri ```c public OnClientMessage(color, text[]) { if (strfind(text,"Bank Balance: $0") != -1) { SendClientMessage(playerid, -1, "Ja sam siromasan :("); } } ``` ## Srodne Funkcije
openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnClientMessage.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnClientMessage.md", "repo_id": "openmultiplayer", "token_count": 378 }
334
--- title: OnPlayerCommandText description: Ovaj callback je pozvan kada igrač unese komandu u chat prozoru njegovog klijenta. tags: ["player"] --- ## Deskripcija Ovaj callback je pozvan kada igrač unese komandu u chat prozoru njegovog klijenta. Komande su sve ono što počinje sa krivom crtom u desno, npr. /help. | Ime | Deskripcija | | --------- | -------------------------------------------------------------- | | playerid | ID igrača koji je unio komandu. | | cmdtext[] | Komanda koju je igrač unio (Uključujući i krivu crtu u desno). | ## Returns Uvijek je pozvana prva u filterskripti tako da return-ovanje 1 tu blokira ostale skripte da je vide. ## Primjeri ```c public OnPlayerCommandText(playerid, cmdtext[]) { if (!strcmp(cmdtext, "/help", true)) { SendClientMessage(playerid, -1, "SERVER: Ovo je /help komanda!"); return 1; // Return-ovanje 1 obavještava server da je komanda procesuirana. // OnPlayerCommandText neće biti pozvan u ostalim skriptama. } return 0; // Return-ovanje 0 obavještava server da komanda nije procesuirana kroz ovu skriptu. // OnPlayerCommandText će biti pozvan u narednim skriptama sve dok ne dobije vrijednost 1. // Ako ni jedna skripta ne return-a 1, poruka 'SERVER: Unknown Command' (prevedeno: SERVER: Nepoznata Komanda) će biti pokazana igraču. } ``` ## Zabilješke :::tip Ovaj callback pozvat će i NPC. ::: ## Srodne Funkcije - [SendRconCommand](../functions/SendRconCommand.md): Šalje RCON komandu preko skripte.
openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnPlayerCommandText.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnPlayerCommandText.md", "repo_id": "openmultiplayer", "token_count": 720 }
335
--- title: OnPlayerLeaveCheckpoint description: Ovaj callback je pozvan kada igrač napusti checkpoint koji mu je postavljen sa SetPlayerCheckpoint. tags: ["player", "checkpoint"] --- ## Deskripcija Ovaj callback je pozvan kada igrač napusti checkpoint koji mu je postavljen sa SetPlayerCheckpoint. Samo jedan checkpoint može biti postavljen odjednom. | Ime | Deskripcija | | -------- | ------------------------------------------- | | playerid | ID igrača koji je napustio svoj checkpoint. | ## Returns Uvijek je pozvana prva u filterskripti. ## Primjeri ```c public OnPlayerLeaveCheckpoint(playerid) { printf("Igrac %i je napustio checkpoint!", playerid); return 1; } ``` ## Zabilješke :::tip Ovaj callback pozvat će i NPC. ::: ## Srodne Funkcije - [SetPlayerCheckpoint](../functions/SetPlayerCheckpoint.md): Kreira checkpoint za igrača. - [DisablePlayerCheckpoint](../functions/DisablePlayerCheckpoint.md): Onemogući igračev trenutni checkpoint. - [IsPlayerInCheckpoint](../functions/IsPlayerInRaceCheckpoint.md): Provjeri da li je igrač u checkpointu. - [SetPlayerRaceCheckpoint](../functions/SetPlayerRaceCheckpoint.md): Kreira race checkpoint za igrača. - [DisablePlayerRaceCheckpoint](../functions/DisablePlayerRaceCheckpoint.md): Onemogući igračev trenutni race checkpoint. - [IsPlayerInRaceCheckpoint](../functions/IsPlayerInRaceCheckpoint.md): Provjeri da li je igrač u race checkpointu.
openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnPlayerLeaveCheckpoint.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnPlayerLeaveCheckpoint.md", "repo_id": "openmultiplayer", "token_count": 520 }
336
--- title: OnPlayerWeaponShot description: Ovaj callback je pozvan kada igrač ispali hitac iz oružja. tags: ["player"] --- ## Deskripcija Ovaj callback je pozvan kada igrač ispali hitac iz oružja. Samo oružja sa mecima su podržana. Drive-by je podržan samo od strane putnika (ne vozačev drive-by, i ne hice koje pucate iz sea sparrowa / huntera). | Ime | Deskripcija | |-------------------------|------------------------------------------------------------------------------------------------------------| | playerid | ID igrača koji je ispalio hitac. | | WEAPON:weaponid | ID [oružja](../resources/weaponids) iz kojeg je igrač ispalio hitac. | | BULLET_HIT_TYPE:hittype | [Tip](../resources/bullethittypes) onoga što je hitac pogodio (ništa, igrača, vozilo, ili (player)object). | | hitid | ID igrača, vozila ili objekta u koji je ispaljen hitac. | | Float:fX | X kordinata u koju je ispalje hitac. | | Float:fY | Y kordinata u koju je ispalje hitac. | | Float:fZ | Z kordinata u koju je ispalje hitac. | ## Returns 0 - Spriječi da metak nanese povredu. 1 - Dozvoli da metak nanese povredu. Uvijek je pozvan prvo u flterskripti te će return-ovanje 0 ovdje blokirati ostale skripte da ga vide. ## Primjeri ```c public OnPlayerWeaponShot(playerid, WEAPON:weaponid, BULLET_HIT_TYPE:hittype, hitid, Float:fX, Float:fY, Float:fZ) { new szString[144]; format(szString, sizeof(szString), "Weapon %i fired. hittype: %i hitid: %i pos: %f, %f, %f", weaponid, hittype, hitid, fX, fY, fZ); SendClientMessage(playerid, -1, szString); return 1; } ``` ## Zabilješke :::tip Ovaj callback je pozvan samo kada je is only called when kompenzacija zakašnjenja omogućena. Ako je hittype: - `BULLET_HIT_TYPE_NONE`: fX, fY i fZ parametri su normalne kordinate, dati će 0.0 za kordinatu ako ništa nije pogođeno (npr. daleki objekat kojeg metak ne može dohvatiti); - Ostali: fX, fY i fZ su pomaci u odnosu na hitid. ::: :::tip [GetPlayerLastShotVectors](../functions/GetPlayerLastShotVectors) se može koristiti u ovom callbacku za više detalja o vektoru metka. ::: :::warning Poznati Bag(ovi): - Nije pozvan kada ispalite hitac u vozilo kao vozač ili ako gledate iza sa omogućenim aim-anjem (pucanje u zrak). - Pozvan je kada `BULLET_HIT_TYPE_VEHICLE` sa korektnim hitid-em (hit iz igračevog vozila) ako pucate igrača koji je u vozilu. Neće biti pozvan kao `BULLET_HIT_TYPE_PLAYER` nikako. - Djelomično popravljeno u SA-MP 0.3.7: Ako zlonamjerni korisnik pošalje lažne podatke o fake oružju, drugi klijenti igrača mogu se zalediti ili crashovati. Da biste se izborili protiv toga, provjerite može li prijavljeni weaponid stvarno ispaliti metke. ::: ## Srodne Funkcije - [GetPlayerLastShotVectors](../functions/GetPlayerLastShotVectors): Dohvaća vektor zadnjeg hica kojeg je igrač ispalio.
openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnPlayerWeaponShot.md/0
{ "file_path": "openmultiplayer/web/docs/translations/bs/scripting/callbacks/OnPlayerWeaponShot.md", "repo_id": "openmultiplayer", "token_count": 1783 }
337