GetPlayerVelocity
Beschrijving
Haal de snelheid van een speler op langs de X‑, Y‑ en Z‑as (componenten).
| Naam | Beschrijving |
|---|---|
| playerid | Speler waarvan je de snelheid wilt. |
| &Float:x | Referentie voor X‑snelheid |
| &Float:y | Referentie voor Y‑snelheid |
| &Float:z | Referentie voor Z‑snelheid |
Retourneert
De componenten worden in de variabelen opgeslagen.
Voorbeeld
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/velocity", true))
{
new Float:x, Float:y, Float:z, s[128];
GetPlayerVelocity(playerid, x, y, z);
format(s, sizeof(s), "Velocity X: %f, Y: %f, Z: %f", x, y, z);
SendClientMessage(playerid, -1, s);
return 1;
}
return 0;
}