02/11/2021 23:25
(28/09/2020 21:17)BrunoBM16 Escreveu:Código PHP:static
bool:IsPlayerSynced[MAX_PLAYERS char],
PlayerAmmo[MAX_PLAYERS char],
PlayerUpdateTick[MAX_PLAYERS];
public OnPlayerUpdate(playerid)
{
if(gettime() > PlayerUpdateTick[playerid])
{
static current_weapon, current_ammo;
PlayerUpdateTick[playerid] = gettime() + 2;
GetPlayerWeaponData(playerid, 0, current_weapon, current_ammo);
IsPlayerSynced{playerid} = (current_ammo != PlayerAmmo{playerid});
SetPlayerAmmo(playerid, current_weapon, !current_ammo);
PlayerAmmo{playerid} = current_ammo;
}
return 1;
}
//Utilizando IsPlayerSynced{playerid} em algum lugar...
Eu tenho umas dúvidas:
1° static bool:IsPlayerSynced[MAX_PLAYERS char]
Esse 'char' define o que?
2° PlayerAmmo{playerid} é a mesma coisa que PlayerAmmo[playerid] ?