08.12.2012, 17:51
PHP код:
//Topo do seu gm
new ccolete[MAX_PLAYERS];
//OnPlayerConnect
ccolete[playerid] = 0;
//OnPlayerDeath
ccolete[playerid] = 0;
//Comando
if(strcmp(cmdtext, "/colete", true) == 0)
{
if(ccolete[playerid] == 1){SendClientMessage(playerid, 0xFF6F28AA, "{FF0000}[ERRO]: {FFFFFF}Vocк ja usou colete");return 1;}
SetPlayerArmour(playerid, 100.0);
ccolete[playerid] = 1;
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s comprou {FF00FF}colete {FF0000}( /Colete )", pname);
SendClientMessageToAll(0xFFFFAE96, string);
GivePlayerMoney(playerid, -100);
return true;
}
@EDIT: Estava dando uma 2Є olhada no tуpico, e percebi, й para comprar colete ou vida