24.03.2013, 10:44
Here you go my man calibrated just for you 
(Stealing this idea for myself too hehe)

(Stealing this idea for myself too hehe)
Код:
CMD:forcecmd(playerid, params[]) { // Set your command prefix here #define cmdprefix "cmd" #if !defined isnull #define isnull(%1) \ ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1])))) #endif new Target; new cmdParams[50]; new cmdToForce[50]; if(PlayerInfo[playerid][AdminLevel] < 5) SendClientMessage(playerid, COLOR_ERROR, "ERROR: You are not authorized to perform this command."); else { sscanf(params, "us[50]s[50]", Target, cmdToForce, cmdParams); if(isnull(cmdToForce)) SendClientMessage(playerid, COLOR_USAGE, "USAGE: /forcecmd [playerid/PartOfName] [command-to-force] [command-parameters]"); else { if(!IsPlayerConnected(Target)) SendClientMessage(playerid, COLOR_USAGE, "Player is not connected - USAGE: /forcecmd [playerid/PartOfName] [command-to-force] [command-parameters]"); else { format(cmdToForce, sizeof(cmdToForce), "%s_%s", cmdprefix, cmdToForce); if(funcidx(cmdToForce) != -1) { if(isnull(cmdParams)) CallLocalFunction(cmdToForce, "i", Target); else CallLocalFunction(cmdToForce, "is", Target, cmdParams); } else SendClientMessage(playerid, COLOR_USAGE, "FUNCTION DOES NOT EXIST - USAGE: /forcecmd [playerid/PartOfName] [command-to-force] [command-parameters]"); } } } return 1; }