Criando a Variavel:
Criando funções:
Como usar:
- Código:
enum E_PLAYER_DATA {
pCash
}
new Player[MAX_PLAYERS][E_PLAYER_DATA];
Criando funções:
- Código:
GetPlayerCash(playerid) //Geta a quantidade de cash do player
return Player[playerid][pCash];
GivePlayerCash(playerid, amount) //Seta determinada quantia de cash ao player
return Player[playerid][pCash] += amount;
ResetPlayerCash(playerid) //Reseta o cash do player
return Player[playerid][pCash] = 0;
Como usar:
- Código:
//Dar cash ao player
GivePlayerCash(playerid, 500);
//Tirar cash do player
GivePlayerCash(playerid, -500);
//Geta o cash do player
GetPlayerCash(playerid);
//Reseta o cash do player
ResetPlayerCash(playerid);
Creditos: ╭໑˚『Cauã』₊꒷꒦