Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion frontend/docs/scripting/callbacks/OnClientMessage.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ This callback does not handle returns.
```c
public OnClientMessage(color, text[])
{
if (strfind(text,"Bank Balance: $0") != -1)
if (strfind(text, "Bank Balance: $0") != -1)
{
SendClientMessage(playerid, -1, "I am poor :(");
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/docs/scripting/callbacks/OnPlayerDeath.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public OnPlayerDeath(playerid, killerid, WEAPON:reason)
SendDeathMessage(killerid, playerid, reason); // Shows the kill in the killfeed

// Check that the killerid is valid before doing anything with it
if (killerid != INVALID_PLAYER_ID)
if (killerid != INVALID_PLAYER_ID)
{
PlayerKills[killerid] ++;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ It is always called first in filterscripts.
## Examples

```c
public OnPlayerRequestClass(playerid,classid)
public OnPlayerRequestClass(playerid, classid)
{
if (classid == 3 && !IsPlayerAdmin(playerid))
{
Expand Down
4 changes: 2 additions & 2 deletions frontend/docs/scripting/callbacks/OnPlayerTakeDamage.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ It is always called first in filterscripts so returning 1 there blocks other fil
```c
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, WEAPON:weaponid, bodypart)
{
if (issuerid != INVALID_PLAYER_ID) // If not self-inflicted
if (issuerid != INVALID_PLAYER_ID) // If not self-inflicted
{
new
infoString[128],
Expand All @@ -59,7 +59,7 @@ public OnPlayerTakeDamage(playerid, issuerid, Float:amount, WEAPON:weaponid, bod
```c
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, WEAPON:weaponid, bodypart)
{
if (issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
if (issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
{
// One shot to the head to kill with sniper rifle
SetPlayerHealth(playerid, 0.0);
Expand Down
2 changes: 1 addition & 1 deletion frontend/docs/scripting/callbacks/OnPlayerUpdate.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public OnPlayerUpdate(playerid)
new Float:fHealth;
GetPlayerHealth(playerid, fHealth);

if (fHealth != GetPVarFloat(playerid, "faPlayerHealth"))
if (fHealth != GetPVarFloat(playerid, "faPlayerHealth"))
{
// Player health has changed since the last update -> server, so obviously thats the thing updated.
// Lets do further checks see if he's lost or gained health, anti-health cheat? ;)
Expand Down
2 changes: 1 addition & 1 deletion frontend/docs/scripting/callbacks/OnRconLoginAttempt.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public OnRconLoginAttempt(ip[], password[], success)

new ipAddress[16];

for (new i = 0; i�< MAX_PLAYERS; i++) // Loop through all players
for (new i = 0; i < MAX_PLAYERS; i++) // Loop through all players
{
if (!IsPlayerConnected(i))
{
Expand Down
2 changes: 1 addition & 1 deletion frontend/docs/scripting/callbacks/OnVehicleSpawn.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ It is always called first in filterscripts.
```c
public OnVehicleSpawn(vehicleid)
{
printf("Vehicle %i spawned!",vehicleid);
printf("Vehicle %i spawned!", vehicleid);
return 1;
}
```
Expand Down
2 changes: 1 addition & 1 deletion frontend/docs/scripting/functions/BanEx.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Any action taken directly before BanEx() (such as sending a message with [SendCl
## Examples

```c
public OnPlayerCommandText( playerid, cmdtext[] )
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/banme", true))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public OnPlayerCommandText(playerid, cmdtext[])
{
new string[64];

format(string, sizeof(string), "Vehicle collision for you is now '%s'", (gPlayerVehicleCollision[playerid] == false) ? ("Disabled") : ("Enabled"));
format(string, sizeof(string), "Vehicle collision for you is now '%s'", (gPlayerVehicleCollision[playerid] == false) ? ("Disabled") : ("Enabled"));
SendClientMessage(playerid, 0xFFFFFFFF, string);

gPlayerVehicleCollision[playerid] = !gPlayerVehicleCollision[playerid];
Expand Down
2 changes: 1 addition & 1 deletion frontend/docs/scripting/functions/GetActorPoolSize.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Gets the highest actorid created on the server. Note that in SA:MP this function
```c
SetAllActorsHealth(Float:health)
{
for(new i = 0, j = GetActorPoolSize(); i <= j; i++)
for (new i = 0, j = GetActorPoolSize(); i <= j; i++)
{
if (IsValidActor(i))
{
Expand Down
2 changes: 1 addition & 1 deletion frontend/docs/scripting/functions/GetGravity.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The current set gravity (as a float).
```c
#include <a_samp>

#if !defined GetGravity
#if !defined GetGravity
native Float:GetGravity();
#endif

Expand Down
4 changes: 2 additions & 2 deletions frontend/docs/scripting/functions/GetMyPos.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ This function does not return any specific values.

```c
new Float:x, Float:y, Float:z;
GetMyPos(x,y,z);
printf("I am currently at %f, %f, %f!",x,y,z);
GetMyPos(x, y, z);
printf("I am currently at %f, %f, %f!", x, y, z);
```

## Related Functions
Expand Down
2 changes: 1 addition & 1 deletion frontend/docs/scripting/functions/GetNetworkStats.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/netstats"))
{
new stats[400+1];
new stats[400 + 1];
GetNetworkStats(stats, sizeof(stats)); // Get the servers networkstats
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Server Network Stats", stats, "Close", "");
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/docs/scripting/functions/GetPVarString.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The length of the string.
## Examples

```c
public OnPlayerConnect(playerid,reason)
public OnPlayerConnect(playerid, reason)
{
new playerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
Expand Down
2 changes: 1 addition & 1 deletion frontend/docs/scripting/functions/GetPVarType.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Returns `PLAYER_VARTYPE_NONE` (0) if a player variable with the given name does
```c
stock PrintPVar(playerid, varname[])
{
switch(GetPVarType(playerid, varname))
switch (GetPVarType(playerid, varname))
{
case PLAYER_VARTYPE_NONE:
{
Expand Down
6 changes: 3 additions & 3 deletions frontend/docs/scripting/functions/GetPVarsUpperIndex.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@ new pVarCount;

new pVarName[128];

for(new i = 0; i != PVarUpperIndex; i++) // Loop through all pVar IDs under the upper index
for (new i = 0; i != PVarUpperIndex; i++) // Loop through all pVar IDs under the upper index
{
// At first, we need to get PVar name
GetPVarNameAtIndex(playerid, i, pVarName, sizeof(pVarName));

// If the var is set (type not 0), increment pVarCount.
if (GetPVarType(playerid, pVarName) != 0)
if (GetPVarType(playerid, pVarName) != 0)
{
pVarCount++;
}
}

new szString[128];
format(szString, sizeof(szString), "You have %i player-variables set. Upper index (highest ID): %i.", pVarCount, PVarUpperIndex-1);
format(szString, sizeof(szString), "You have %i player-variables set. Upper index (highest ID): %i.", pVarCount, PVarUpperIndex - 1);
SendClientMessage(playerid, -1, szString);
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public OnPlayerUpdate(playerid)
new playerTargetActor = GetPlayerCameraTargetActor(playerid);

// If they ARE looking at ANY actor
if (playerTargetActor != INVALID_ACTOR_ID)
if (playerTargetActor != INVALID_ACTOR_ID)
{
// Store the player's weapon so we can check if they are armed
new playerWeapon = GetPlayerWeapon(playerid);
Expand All @@ -51,7 +51,7 @@ public OnPlayerUpdate(playerid)
if (!ActorHandsup[playerTargetActor] && playerWeapon >= 22 && playerWeapon <= 42 && keys & KEY_AIM)
{
// Apply 'hands up' animation
ApplyActorAnimation(playerTargetActor, "SHOP", "SHP_HandsUp_Scr",4.1,0,0,0,1,0);
ApplyActorAnimation(playerTargetActor, "SHOP", "SHP_HandsUp_Scr", 4.1, 0, 0, 0, 1, 0);

// Set 'ActorHandsup' to true, so the animation won't keep being reapplied
ActorHandsup[playerTargetActor] = true;
Expand Down
2 changes: 1 addition & 1 deletion frontend/docs/scripting/functions/GetPlayerInterior.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The interior ID the player is currently in.
## Examples

```c
public OnPlayerCommandText(playerid,text[])
public OnPlayerCommandText(playerid, text[])
{
if (strcmp(cmdtext, "/int", true) == 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Gets the [landing gear state](../resources/landinggearstate) of the current play
## Examples

```c
new LANDING_GEAR_STATE:state = GetPlayerLandingGearState(playerid);
new LANDING_GEAR_STATE:landingGearState = GetPlayerLandingGearState(playerid);
```

## Related Functions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/mynetstats"))
{
new stats[400+1];
new stats[400 + 1];
GetPlayerNetworkStats(playerid, stats, sizeof(stats));
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "My Network Stats", stats, "Okay", "");
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/docs/scripting/functions/GetPlayerScore.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The player's score.
## Examples

```c
public OnPlayerCommandText(playerid,text[])
public OnPlayerCommandText(playerid, text[])
{
if (!strcmp(cmdtext, "/score", true))
{
Expand Down
4 changes: 2 additions & 2 deletions frontend/docs/scripting/functions/GetPlayerState.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ The player's current state as an integer (see: [Player States](../resources/play
```c
public OnPlayerDeath(playerid, killerid, WEAPON:reason)
{
new PLAYER_STATE:state = GetPlayerState(killerid); // Get the killer's state
new PLAYER_STATE:playerState = GetPlayerState(killerid); // Get the killer's state

if (state == PLAYER_STATE_DRIVER) // If the killer was in a vehicle
if (playerState == PLAYER_STATE_DRIVER) // If the killer was in a vehicle
{
//It's a driver drive-by, take some money
GivePlayerMoney(killerid, -10000);
Expand Down
4 changes: 2 additions & 2 deletions frontend/docs/scripting/functions/GetPlayerWeaponState.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/wstate", true))
{
new WEAPONSTATE:state = GetPlayerWeaponState(playerid);
new WEAPONSTATE:weaponState = GetPlayerWeaponState(playerid);

static weaponStates[4][64] =
{
Expand All @@ -37,7 +37,7 @@ public OnPlayerCommandText(playerid, cmdtext[])
};

new string[144];
format(string, sizeof(string), "Your weapon state: %s", weaponStates[state]);
format(string, sizeof(string), "Your weapon state: %s", weaponStates[weaponState]);
SendClientMessage(playerid, -1, string);
return 1;
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/docs/scripting/functions/GetSVarType.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Returns `SERVER_VARTYPE_NONE` (0) if a server variable with the given name does
```c
stock PrintSVar(varname[])
{
switch(GetSVarType(varname))
switch (GetSVarType(varname))
{
case SERVER_VARTYPE_NONE:
{
Expand Down
6 changes: 3 additions & 3 deletions frontend/docs/scripting/functions/GetSVarsUpperIndex.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ The highest set SVar ID.

```c
// Store the upper index in the variable 'SVarUpperIndex' + 1
new SVarUpperIndex = GetSVarsUpperIndex() + 1;
new sVarUpperIndex = GetSVarsUpperIndex() + 1;

// This sVarCount variable will store how many sVars are set as we count them.
new sVarCount;

new sVarName[128];

for(new i = 0; i != sVarUpperIndex; i++) // Loop through all sVar IDs under the upper index
for (new i = 0; i != sVarUpperIndex; i++) // Loop through all sVar IDs under the upper index
{
// At first, we need to get SVar name
GetSVarNameAtIndex(i, sVarName, sizeof(sVarName));
Expand All @@ -36,7 +36,7 @@ for(new i = 0; i != sVarUpperIndex; i++) // Loop through all sVar IDs under the
}
}

printf("There are %i server-variables set. Upper index (highest ID): %i.", sVarCount, SVarUpperIndex-1);
printf("There are %i server-variables set. Upper index (highest ID): %i.", sVarCount, SVarUpperIndex - 1);
```

## Related Functions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Gets the current vehicle [landing gear state](../resources/landinggearstate) fro
## Examples

```c
new LANDING_GEAR_STATE:state = GetVehicleLandingGearState(vehicleid);
new LANDING_GEAR_STATE:landingGearState = GetVehicleLandingGearState(vehicleid);
```

## Related Functions
Expand Down
2 changes: 1 addition & 1 deletion frontend/docs/scripting/functions/GetVehiclePoolSize.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Gets the highest vehicleid currently in use on the server. Note that in SA:MP th
RepairAllVehicles()
{
// vehicleids start at 1
for(new i = 1, j = GetVehiclePoolSize(); i <= j; i++)
for (new i = 1, j = GetVehiclePoolSize(); i <= j; i++)
{
RepairVehicle(i);
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/docs/scripting/functions/IsPlayerUsingOmp.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Returns 1 if the player is using the open.mp launcher, otherwise 0.
public OnPlayerConnect(playerid)
{
// Player is using the open.mp launcher
if(IsPlayerUsingOmp(playerid))
if (IsPlayerUsingOmp(playerid))
{
SendClientMessage(playerid, -1, "You are using the open.mp launcher.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public OnPlayerConnect(playerid)
public OnPlayerSpawn(playerid)
{
// Check if this gangzone exists
if(IsValidPlayerGangZone(playerid, gGangZoneID[playerid]))
if (IsValidPlayerGangZone(playerid, gGangZoneID[playerid]))
{
PlayerGangZoneDestroy(playerid, gGangZoneID[playerid]);
gGangZoneID[playerid] = INVALID_GANG_ZONE;
Expand Down
2 changes: 1 addition & 1 deletion frontend/docs/scripting/functions/IsVehicleStreamedIn.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Checks if a vehicle is streamed in for a player. Only nearby vehicles are stream
```c
new streamedVehicleCount;

for(new i = 1; i < MAX_VEHICLES; i++)
for (new i = 1; i < MAX_VEHICLES; i++)
{
if (IsVehicleStreamedIn(i, playerid))
{
Expand Down
4 changes: 2 additions & 2 deletions frontend/docs/scripting/functions/NPC_GetWeaponState.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public OnPlayerCommandText(playerid, cmdtext[])
if (!NPC_IsValid(npcid))
return SendClientMessage(playerid, 0xFF0000FF, "Invalid NPC.");

new WEAPONSTATE:state = WEAPONSTATE:NPC_GetWeaponState(npcid);
new WEAPONSTATE:weaponState = WEAPONSTATE:NPC_GetWeaponState(npcid);

static weaponStates[5][64] =
{
Expand All @@ -44,7 +44,7 @@ public OnPlayerCommandText(playerid, cmdtext[])
"Reloading"
};

SendClientMessage(playerid, 0x00FF00FF, "NPC %d weapon state: %s (%d)", npcid, weaponStates[state], _:state);
SendClientMessage(playerid, 0x00FF00FF, "NPC %d weapon state: %s (%d)", npcid, weaponStates[weaponState], _:weaponState);
return 1;
}
return 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This function returns the number of bytes the server has received from the playe
## Examples

```c
public OnPlayerCommandText(playerid,cmdtext[])
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/bytesreceived"))
{
Expand Down
2 changes: 1 addition & 1 deletion frontend/docs/scripting/functions/NetStats_BytesSent.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This function returns the number of bytes the server has sent to the player.
## Examples

```c
public OnPlayerCommandText(playerid,cmdtext[])
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/bytes_sent"))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This function returns the amount of time (in milliseconds) that a player has bee
## Examples

```c
public OnPlayerCommandText(playerid,cmdtext[])
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/connectedtime"))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This function returns the number of messages the server has received from the pl
## Examples

```c
public OnPlayerCommandText(playerid,cmdtext[])
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/msgs"))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ the number of messages the player has received in the last second.
## Examples

```c
public OnPlayerCommandText(playerid,cmdtext[])
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp(cmdtext, "/msgpersec"))
{
Expand Down
Loading
Loading