Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- uRcon Console CMDS is a for the console made Script, which
- makes it possible to use commands which are standard Ingame
- in the console
- You are allowed to edit this script for your own usage.
- You are allowed to use this script for your server.
- It would be nice when the cmd /credits keeps.
- You won't re-release this script by calming it as your own.
- INFORMATION:
- The commands gets since v1.0 R2 with "/" directly in the
- console used.
- You can define the firt charactere which shall be used by
- changing the "/" to your custom charactere.
- All commands gets listed with /cmds and /cmds2
- (More will follow!)
- Bugs and ideas can be sended via the following links as pm to me:
- http://gta-sa-mp.de/forum/user/290-ulbi1990/
- http://forum.sa-mp.de/index.php?page=User&userID=23895
- http://forum.sa-mp.com/member.php?u=155872
- You can also write a Feedback/Bug Reports and Ideas in the following thread:
- http://bit.ly/15OzlMa
- */
- #include <a_samp>
- #include <sscanf2>
- #if !defined RCMD_PREFIX
- #define RCMD_PREFIX "/" //define the prefix which shall be used! Standard "/"
- #endif
- #if !defined rcmd
- #define rcmd(%1,%2,%3) if((strcmp((%3), RCMD_PREFIX #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (rcmd_%1(""))) || (((%3)[(%2) + 1] == 32) && (rcmd_%1((%3)[(%2) + 2]))))) return 1
- #endif
- new ChatBlock;
- forward KickTimer(playerid);
- public OnFilterScriptInit()
- {
- print(" ");
- print("\t\t|=================================|");
- print("\t\t| uRcon Console CMDS v1.0 R2 |");
- print("\t\t| scriptet by ulbi1990 |");
- printf("\t\t| %scmds - shows all commands |", RCMD_PREFIX);
- print("\t\t|=================================|");
- print(" ");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- rcmd(cmds,4,cmd);
- rcmd(kickall,7,cmd);
- rcmd(slapall,7,cmd);
- rcmd(cc,2,cmd);
- rcmd(freezeall,9,cmd);
- rcmd(unfreezeall,11,cmd);
- rcmd(blockchat,9,cmd);
- rcmd(allowchat,9,cmd);
- rcmd(killall,7,cmd);
- rcmd(healall,7,cmd);
- rcmd(allgod,6,cmd);
- rcmd(allgodoff,9,cmd);
- rcmd(kick,4,cmd);
- rcmd(ann,3,cmd);
- rcmd(credits,7,cmd);
- rcmd(slap,4,cmd);
- rcmd(freeze,6,cmd);
- rcmd(unfreeze,8,cmd);
- rcmd(heal,4,cmd);
- rcmd(kill,4,cmd);
- rcmd(god,3,cmd);
- rcmd(godoff,6,cmd);
- rcmd(cmds2,5,cmd);
- return 1;
- }
- public OnPlayerText(playerid,text[])
- {
- if(ChatBlock==1)
- {
- SendClientMessage(playerid,0xFF0000FF,"Der Chat wurde von einem Administrator geblockt!");
- return 0;
- }
- return 1;
- }
- rcmd_cmds(command[])
- {
- if(!strlen(command))
- {
- printf("%scredits - Shows a list about people which make this script possible",RCMD_PREFIX);
- printf("%skickall - kicks all players on the server",RCMD_PREFIX);
- printf("%sslapall - slaps all players on the server",RCMD_PREFIX);
- printf("%scc - clears the chat for all players",RCMD_PREFIX);
- printf("%sfreezeall - freezes all players on the server",RCMD_PREFIX);
- printf("%sunfreezeall - unfreezes all players on the server",RCMD_PREFIX);
- printf("%sblockchat - blocks the chat for all players",RCMD_PREFIX);
- printf("%sallowchat - unblocks the chat for all players",RCMD_PREFIX);
- printf("%shealall - heals all players on the server",RCMD_PREFIX);
- printf("%skillall - Kills all players on the server",RCMD_PREFIX);
- printf("%sallgod - gives all players godmode",RCMD_PREFIX);
- printf("%sallgodoff - takes the godmode from all players",RCMD_PREFIX);
- printf("%skick <Playerid> <reason> - kicks a specific player with a reason",RCMD_PREFIX);
- printf("%sann <Text> - shows a announcment as GameText for all players",RCMD_PREFIX);
- print(" ");
- printf("%scmds2 - next cmdlist",RCMD_PREFIX);
- }
- return 1;
- }
- rcmd_cmds2(command[])
- {
- if(!strlen(command))
- {
- printf("%sslap <Playerid> - slaps a specific player on the server",RCMD_PREFIX);
- printf("%sfreeze <Playerid> - freezes a specific player on the server",RCMD_PREFIX);
- printf("%sunfreeze <Playerid> - unfreezes a specific player on the server",RCMD_PREFIX);
- printf("%sheal <Playerid> - heals a specific player on the server",RCMD_PREFIX);
- printf("%skill <Playerid> - kills a specific player on the server",RCMD_PREFIX);
- printf("%sgod <Playerid> - gives a specific player godmode",RCMD_PREFIX);
- printf("%sgodoff <Playerid> - takes from a specific player the godmode",RCMD_PREFIX);
- }
- return 1;
- }
- rcmd_kickall(command[])
- {
- if(!strlen(command))
- {
- for(new i=0;i<MAX_PLAYERS;i++)
- {
- Kick(i);
- }
- print("All players got kicked!");
- }
- return 1;
- }
- rcmd_slapall(command[])
- {
- if(!strlen(command))
- {
- for(new i=0;i<MAX_PLAYERS;i++)
- {
- new Float:zPos[3];
- GetPlayerPos(i,zPos[0],zPos[1],zPos[2]);
- SetPlayerPos(i,zPos[0],zPos[1],zPos[2]+12);
- }
- print("All players got slaped!");
- }
- return 1;
- }
- rcmd_cc(command[])
- {
- if(!strlen(command))
- {
- for(new i=0;i<100;i++)
- {
- SendClientMessageToAll(-1," ");
- }
- print("Chat got cleared!");
- }
- return 1;
- }
- rcmd_freezeall(command[])
- {
- if(!strlen(command))
- {
- for(new i=0;i<MAX_PLAYERS;i++)
- {
- TogglePlayerControllable(i,0);
- }
- print("All players got freezed!");
- }
- return 1;
- }
- rcmd_unfreezeall(command[])
- {
- if(!strlen(command))
- {
- for(new i=0;i<MAX_PLAYERS;i++)
- {
- TogglePlayerControllable(i,1);
- }
- print("Allall players got unfreezed!");
- }
- return 1;
- }
- rcmd_blockchat(command[])
- {
- if(!strlen(command))
- {
- print("Chat gets now blocked!");
- ChatBlock=1;
- }
- return 1;
- }
- rcmd_allowchat(command[])
- {
- if(!strlen(command))
- {
- print("Chat is now unblocked!");
- ChatBlock=0;
- }
- return 1;
- }
- rcmd_killall(command[])
- {
- if(!strlen(command))
- {
- for(new i=0;i<MAX_PLAYERS;i++)
- {
- SetPlayerHealth(i,-1);
- }
- print("All players got killed!");
- }
- return 1;
- }
- rcmd_healall(command[])
- {
- if(!strlen(command))
- {
- for(new i=0;i<MAX_PLAYERS;i++)
- {
- SetPlayerHealth(i,100);
- }
- print("All players got healed!");
- }
- return 1;
- }
- rcmd_allgod(command[])
- {
- if(!strlen(command))
- {
- for(new i=0;i<MAX_PLAYERS;i++)
- {
- SetPlayerHealth(i,10000000);
- }
- print("All players got set to godmode!");
- }
- return 1;
- }
- rcmd_allgodoff(command[])
- {
- if(!strlen(command))
- {
- for(new i=0;i<MAX_PLAYERS;i++)
- {
- SetPlayerHealth(i,100);
- }
- print("All players got godmode removed!");
- }
- return 1;
- }
- rcmd_kick(command[])
- {
- new pID,reason[56],name[MAX_PLAYER_NAME+1],str[128];
- if(strlen(command)) return printf("[USAGE]: \"%skick [Playerid] [Reason]\"", RCMD_PREFIX);
- {
- if(sscanf(command,"us[55]",pID,reason)) return printf("[USAGE]: \"%skick [Playerid] [Reason]\"", RCMD_PREFIX);
- {
- if(pID==INVALID_PLAYER_ID) return print("This player isn't connected!");
- {
- GetPlayerName(pID,name,sizeof(name));
- format(str,sizeof(str),"%s got kicked via Rcon console. [Reason: %s]",name,reason);
- SendClientMessageToAll(0xFF0000FF,str);
- printf("%s",str);
- SetTimerEx("KickTimer",500,0,"i",pID);
- }
- }
- }
- return 1;
- }
- rcmd_ann(command[])
- {
- new announce[56];
- if(strlen(command)) return printf("[USaGE]: \"%sann [Announce]\"", RCMD_PREFIX);
- {
- if(sscanf(command,"s[56]",announce)) return printf("[USAGE]: \"%sann [Announce]\"", RCMD_PREFIX);
- {
- GameTextForAll(announce,4000,3);
- printf("Announce: %s",announce);
- }
- }
- return 1;
- }
- rcmd_credits(command[])
- {
- if(!strlen(command))
- {
- print("Scriptidea & Script: ulbi1990");
- print("Rcmd Define: Correlli");
- print("Sscanf2: Alex aka Y_Less");
- print("a_samp: SA:MP Team");
- }
- return 1;
- }
- rcmd_slap(command[])
- {
- new pID,Float:zPos[3];
- if(strlen(command)) return printf("[USAGE]: \"%sslap [Playerid]\"", RCMD_PREFIX);
- {
- if(sscanf(command,"u",pID)) return printf("[USAGE]: \"%sslap [Playerid]\"", RCMD_PREFIX);
- {
- if(pID==INVALID_PLAYER_ID) return print("This player isn't connected!");
- {
- GetPlayerPos(pID,zPos[0],zPos[1],zPos[2]);
- SetPlayerPos(pID,zPos[0],zPos[1],zPos[2]+12);
- printf("%d got slaped!",pID);
- }
- }
- }
- return 1;
- }
- rcmd_freeze(command[])
- {
- new pID;
- if(strlen(command)) return printf("[USAGE]: \"%sfreeze [Playerid]\"", RCMD_PREFIX);
- {
- if(sscanf(command,"u",pID)) return printf("[USAGE]: \"%sfreeze [Playerid]\"", RCMD_PREFIX);
- {
- if(pID==INVALID_PLAYER_ID) return print("This player isn't connected!");
- {
- TogglePlayerControllable(pID,0);
- printf("%d got freezed!",pID);
- }
- }
- }
- return 1;
- }
- rcmd_unfreeze(command[])
- {
- new pID;
- if(strlen(command)) return printf("[USAGE]: \"%sunfreeze [Playerid]\"", RCMD_PREFIX);
- {
- if(sscanf(command,"u",pID)) return printf("[USAGE]: \"%sunfreeze [Playerid]\"", RCMD_PREFIX);
- {
- if(pID==INVALID_PLAYER_ID) return print("This player isn't connected!");
- {
- TogglePlayerControllable(pID,1);
- printf("%d got unfreezed!",pID);
- }
- }
- }
- return 1;
- }
- rcmd_heal(command[])
- {
- new pID;
- if(strlen(command)) return printf("[USAGE]: \"%sheal [Playerid]\"", RCMD_PREFIX);
- {
- if(sscanf(command,"u",pID)) return printf("[USAGE]: \"%sheal [Playerid]\"", RCMD_PREFIX);
- {
- if(pID==INVALID_PLAYER_ID) return print("This player isn't connected!");
- {
- SetPlayerHealth(pID,100);
- printf("%d got healed!",pID);
- }
- }
- }
- return 1;
- }
- rcmd_kill(command[])
- {
- new pID;
- if(strlen(command)) return printf("[USAGE]: \"%skill [Playerid]\"", RCMD_PREFIX);
- {
- if(sscanf(command,"u",pID)) return printf("[USAGE]: \"%skill [Playerid]\"", RCMD_PREFIX);
- {
- if(pID==INVALID_PLAYER_ID) return print("This player isn't connected!");
- {
- SetPlayerHealth(pID,-1);
- printf("%d got killed!",pID);
- }
- }
- }
- return 1;
- }
- rcmd_god(command[])
- {
- new pID;
- if(strlen(command)) return printf("[USAGE]: \"%sgod [Playerid]\"", RCMD_PREFIX);
- {
- if(sscanf(command,"u",pID)) return printf("[USAGE]: \"%sgod [Playerid]\"", RCMD_PREFIX);
- {
- if(pID==INVALID_PLAYER_ID) return print("This player isn't connected!");
- {
- SetPlayerHealth(pID,10000000000);
- printf("%d got set to godmode!",pID);
- }
- }
- }
- return 1;
- }
- rcmd_godoff(command[])
- {
- new pID;
- if(strlen(command)) return printf("[USAGE]: \"%sgodoff [Playerid]\"", RCMD_PREFIX);
- {
- if(sscanf(command,"u",pID)) return printf("[USAGE]: \"%sgodoff [Playerid]\"", RCMD_PREFIX);
- {
- if(pID==INVALID_PLAYER_ID) return print("This player isn't connected!");
- {
- SetPlayerHealth(pID,100);
- printf("%d got godmode removed!",pID);
- }
- }
- }
- return 1;
- }
- public KickTimer(playerid)
- {
- Kick(playerid);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment