06.03.2014, 11:58
pawn Код:
// OnPlayerConnect
SetPVarInt(playerid, "VendoCmds", 0);
// --
CMD:vercmds(playerid)
{
if(!IsPlayerAdmin(playerid)) return 1;
if(GetPVarInt(playerid, "VendoCmds") == 0)
{
SetPVarInt(playerid, "VendoCmds", 1);
SendClientMessage(playerid, -1, "Vendo comandos ativado.");
}
else if(GetPVarInt(playerid, "VendoCmds") == 1)
{
SetPVarInt(playerid, "VendoCmds", 0);
SendClientMessage(playerid, -1, "Vendo comandos desativado.");
}
return 1;
}
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
new myam_Name[MAX_PLAYER_NAME], String[125];
GetPlayerName(playerid, myam_Name, sizeof(myam_Name));
if(success){
format(String, sizeof(String), "** %s digitou o comando %s {00FF00}[existente]", myam_Name, cmdtext);
for(new my = 0; my<MAX_PLAYERS; my++){
if(IsPlayerConnected(my)){
if(IsPlayerAdmin(my) && GetPVarInt(my, "VendoCmds") == 1){
SendClientMessage(my, -1, String);
}
}
}
}
if(!success){
format(String, sizeof(String), "** %s digitou o comando %s {FF0000}[inexistente]", myam_Name, cmdtext);
for(new my = 0; my<MAX_PLAYERS; my++){
if(IsPlayerConnected(my)){
if(IsPlayerAdmin(my) && GetPVarInt(my, "VendoCmds") == 1){
SendClientMessage(my, -1, String);
}
}
}
}
return 1;
}