[HELP] Someone please help me command wire
#1

Can anyone help me to temporarily place a time in this command:
To be well Example: /WIRE <NICK OR ID> TIME(30s,1,2,3m) (<REASON>)

Код:
dcmd_wire(playerid,params[]) {
  if(IsPlayerCommandLevel(playerid,"wire")) {
  		if(!strlen(params)) return SendClientMessage(playerid,red,"Syntax Error: \"/WIRE <NICK OR ID> (<REASON>)\".");
    new tmp[256],Index; tmp = strtok(params,Index);
	  	new id; if(!IsNumeric(tmp)) id = ReturnPlayerID(tmp); else id = strval(tmp);
		if(IsPlayerConnected(id) && id != INVALID_PLAYER_ID && id != playerid) {
		  if(!Variables[id][Wired]) {
		    SendCommandMessageToAdmins(playerid,"WIRE");
			  new string[256],name[24],ActionName[24]; GetPlayerName(playerid,name,24); GetPlayerName(id,ActionName,24);
			  if(!strlen(params[strlen(tmp)+1])) format(string,256,"\"%s\" has been wired by Administrator \"%s\".",ActionName,name);
				else format(string,256,"\"%s\" has been wired by Administrator \"%s\". (Reason: %s)",ActionName,name,params[strlen(tmp)+1]);
				Variables[id][Wired] = true, Variables[id][WiredWarnings] = Config[WiredWarnings];
		  	return SendClientMessageToAll(yellow,string);
			} else return SendClientMessage(playerid,red,"ERROR: This player has already been wired.");
		} else return SendClientMessage(playerid,red,"ERROR: You can not wire yourself or a disconnected player.");
	} else return SendLevelErrorMessage(playerid,"wire");
}
dcmd_unwire(playerid,params[]) {
  if(IsPlayerCommandLevel(playerid,"unwire")) {
  		if(!strlen(params)) return SendClientMessage(playerid,red,"Syntax Error: \"/UNWIRE <NICK OR ID>\".");
  		new id; if(!IsNumeric(params)) id = ReturnPlayerID(params); else id = strval(params);
		if(IsPlayerConnected(id) && id != INVALID_PLAYER_ID) {
		  if(Variables[id][Wired]) {
		    SendCommandMessageToAdmins(playerid,"UNWIRE");
			  new string[256],name[24],ActionName[24]; GetPlayerName(playerid,name,24); GetPlayerName(id,ActionName,24);
				Variables[id][Wired] = false, Variables[id][WiredWarnings] = Config[WiredWarnings];
			  if(id != playerid) { format(string,256,"\"%s\" has been unwired by Administrator \"%s\".",ActionName,name); return SendClientMessageToAll(yellow,string); }
			  else return SendClientMessage(playerid,yellow,"You have successfully unwired yourself.");
    	} else return SendClientMessage(playerid,red,"ERROR: This player is not wired.");
		} else return SendClientMessage(playerid,red,"ERROR: You can not unwire a disconnected player.");
	} else return SendLevelErrorMessage(playerid,"unwire");
}
Reply


Messages In This Thread
[HELP] Someone please help me command wire - by BlackSkull - 07.04.2010, 20:10
Re: [HELP] Time in command wire - by BlackSkull - 07.04.2010, 23:34
Re: [HELP] Someone please help me command wire - by BlackSkull - 29.04.2010, 00:59
Re: [HELP] Someone please help me command wire - by dcmd_crash - 29.04.2010, 01:05

Forum Jump:


Users browsing this thread: 1 Guest(s)