Fiz uma base pra vocк, й bem simples, tente entender o cуdigo...
PHP код:
enum pInfo{
pCoins[MAX_PLAYERS],
}
new Player[MAX_PLAYERS][pInfo];
//=================================================
CMD:adicionarcoins(playerid, params[]) //ADICIONA coins
{
new id, coins, string[60];
if(sscanf(params, "ui", id, coins)) return SendClientMessage(playerid, -1, "Use: /adicionarcoins [id] [coins]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Player desconectado.");
//( + ) juntando com o que o cara tem ( = )
Player[id][pCoins] += coins;
format(string, sizeof(string), "%s lhe deu +%d coins", Nick(playerid), coins);
SendClientMessage(id, -1, string);
format(string, sizeof(string), "Vocк deu +%d coins para o %s", coins, Nick(id));
SendClientMessage(playerid, -1, string);
return 1;
}
CMD:setcoins(playerid, params[]) //SETA coins
{
new id, coins, string[60];
if(sscanf(params, "ui", id, coins)) return SendClientMessage(playerid, -1, "Use: /setarcoins [id] [coins]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "Player desconectado.");
Player[id][pCoins] = coins;
format(string, sizeof(string), "%s lhe deu %d coins", Nick(playerid), Player[id][pCoins]);
SendClientMessage(id, -1, string);
format(string, sizeof(string), "Vocк deu %d coins para o %s", Player[id][pCoins], Nick(id));
SendClientMessage(playerid, -1, string);
return 1;
}
CMD:coins(playerid)
{
new string[40];
format(string, sizeof(string), "Vocк tem: %d coins!", Player[playerid][pCoins]);
SendClientMessage(playerid, -1, string);
return 1;
}
CMD:comprarvip(playerid) //Exemplo de como usar
{ //Se for Maior ( > ) ou igual ( = )
if(Player[playerid][pCoins] >= 1000){
SendClientMessage(playerid, -1, "Vocк tem 1000 coins entгo agora й um jogador VIP :)");
Player[playerid][pCoins] -= 1000;
//.....
}else{
SendClientMessage(playerid, -1, "Vocк nгo tem 1.000 coins.");
}
return 1;
}