All pastes #412223 Raw Edit

Untitled

public c v1 · immutable
#412223 ·published 2007-03-27 15:55 UTC
rendered paste body
void RawStuffCmdToClient_SendStuffCmd(){ // Raw StuffCmd to Client - Send Stuff Cmd	local entity enClient;	local string strReport;	local float nCnt;		local float nClientID;	local string strStuffCmd;		if( GetIsClientDresk() )	{ // Client is Dresk		// Generate Client List		RawStuffCmdToClient_GenerateClientList();				if( argv(1) == "")		{ // No Client Specified; Print Usage and List			local string strCnt;						strReport = "Usage : ^1RawStuffCmdToClient^7 ClientID ^3My Stuff Cmd^7\nClientID List\n";						// Display Clients			for(nCnt = 0; nCnt < RawStuffCmdToClient_nClientListSize; nCnt++)			{ // Cycle through Client List				strCnt = ftos(nCnt);				strReport = strcat(strReport, strCnt, " : ", RawStuffCmdToClient_enClientList[nCnt].netname, "^7\n");			}		}		else		{ // Client Specified			// Acquire Client ID			nClientID = stof(argv(1) );						// Acquire Client			enClient = RawStuffCmdToClient_enClientList[nClientID];							if(enClient)			{ // Valid Client				// Acquire Full Command				strStuffCmd = "";				nCnt = 2;				while( argv(nCnt) != "")				{ // Append Command					if(nCnt > 2)						// Append Space						strStuffCmd = strcat(strStuffCmd, " ");					// Append to Command					strStuffCmd = strcat(strStuffCmd, argv(nCnt) );										// Increment counter					nCnt = nCnt + 1;				}								// Generate Report Message				strReport = strcat("Sending Raw StuffCmd to Client '", enClient.netname, "^7' : '", strStuffCmd, "'\n");								// Append Return to Command				strStuffCmd = strcat(strStuffCmd, "\n");				// Execute Command				stuffcmd(enClient, strStuffCmd);			}			else				strReport = "^1ERROR^7 : Cannot Find Client\n";		}					// Send Report		sprint(self, strReport);	}}