23.08.2010, 09:01
(
Последний раз редактировалось mrcoolballs; 23.08.2010 в 09:26.
)
that could work but im trying to get my own "owner" thing, so i can make a bunch of commands that only the owner can use
i would really apreciate it if somebody could help me put something under onplayercommandtext that would take effect to every command
i was thinking something along the lines of
but that wouldnt work... anyone?
EDIT: Nevermind i figured it out, it was the order of the statements i had in it i changed it around a bit, i doubt this will help anyone but anyway heres my code that worked
i would really apreciate it if somebody could help me put something under onplayercommandtext that would take effect to every command
i was thinking something along the lines of
Код:
if(PlayerInfo[otherplayer][Owner] = 1) return 0;
EDIT: Nevermind i figured it out, it was the order of the statements i had in it i changed it around a bit, i doubt this will help anyone but anyway heres my code that worked
Код:
if(strcmp(cmd,"/mute",true) == 0) { new tmp[256]; new id; tmp = strtok(cmdtext,idx); id = strval(tmp); if (Logged[playerid] == 1) { if(PlayerInfo[playerid][Level] > 2) { if(!strlen(tmp)) { SendClientMessage(playerid,ORANGE,"USAGE: /mute ID"); return 1; } if(PlayerInfo[id][Owner] == 0) { if(!IsPlayerConnected(id)) { SendClientMessage(playerid,YELLOW,"Invalid ID"); } else { new string[128]; new name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,sizeof(name)); new nname[MAX_PLAYER_NAME]; GetPlayerName(id,nname,sizeof(nname)); format(string,sizeof(string)," * You have muted %s *",nname); SendClientMessage(playerid,YELLOW,string); format(string,sizeof(string)," * you have been muted by %s for 10 Minutes!",name); SendClientMessage(id,BRIGHTRED,string); SetTimerEx("MuteTimer", 600000, false, "i", id); PlayerInfo[id][Muted] = 1; return 1; } } else { SendClientMessage(playerid,GREY,"You cannot use this command on the owner!"); return 1; } } else { SendClientMessage(playerid,ORANGE,"You Have to be Level 3 to use this command"); return 1; } } else { SendClientMessage(playerid,ORANGE,"You have to be logged in to use this command!"); return 1; } return 1; }