Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(strcmp(cmd, "/bot", true) == 0)
- {
- new botcmd;
- tmp = strtok(cmdtext, idx);
- if(!IsPlayerAdmin(playerid))
- {
- SendClientMessage(playerid, COLOR_BRIGHTRED, "Admins Only!");
- return 1;
- }
- if(!strlen(tmp)) {
- SendClientMessage(playerid, COLOR_WHITE, "USAGE: /bot [name/age/say/raw/toggle]");
- return 1;
- }
- if(strcmp(tmp, "name", true)==0)
- botcmd = 1;
- else if(strcmp(tmp, "say", true)==0)
- botcmd = 2;
- else if(strcmp(tmp, "raw", true)==0)
- botcmd = 3;
- else if(strcmp(tmp, "toggle", true)==0)
- botcmd = 4;
- else if(strcmp(tmp, "age", true)==0)
- botcmd = 5;
- tmp = strtok(cmdtext, idx);
- if(botcmd < 6 && !strlen(tmp)) {
- if(botcmd==0)
- SendClientMessage(playerid, COLOR_WHITE, "USAGE: /bot [name/say/raw/toggle]");
- else if(botcmd==1)
- SendClientMessage(playerid, COLOR_WHITE, "USAGE: /bot [name] [name]");
- else if(botcmd==2)
- SendClientMessage(playerid, COLOR_WHITE, "USAGE: /bot [say] [msg]");
- else if(botcmd==3)
- SendClientMessage(playerid, COLOR_WHITE, "USAGE: /bot [raw] [raw data]");
- else if(botcmd==4)
- SendClientMessage(playerid, COLOR_WHITE, "USAGE: /bot [toggle] [on | off]");
- else if(botcmd==5)
- SendClientMessage(playerid, COLOR_WHITE, "USAGE: /bot [age] [age]");
- return 1;
- }
- if(botcmd==1)//Bot Name
- {
- if(BotOn == 0)
- {
- SendClientMessage(playerid, COLOR_WHITE, "The Bot is turned off so you cannot use this CMD.");
- return 1;
- }
- new Thing[200], Name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Name, sizeof(Name));
- format(Thing, sizeof(Thing), "%s has changed the servers bot name from %s to %s", Name, BotName, tmp);
- SendClientMessageToAll(COLOR_YELLOW, Thing);
- format(BotName, sizeof(BotName), "%s", tmp);
- return 1;
- } else if (botcmd==2)//Bot say
- {
- if(BotOn == 0)
- {
- SendClientMessage(playerid, COLOR_WHITE, "The Bot is turned off so you cannot use this CMD.");
- return 1;
- }
- SendBotMsg(playerid, cmdtext[9]);
- return 1;
- } else if (botcmd==3)//Bot raw
- {
- if(BotOn == 0)
- {
- SendClientMessage(playerid, COLOR_WHITE, "The Bot is turned off so you cannot use this CMD.");
- return 1;
- }
- SendBotRaw(playerid, cmdtext[9]);
- return 1;
- } else if (botcmd==4)//Bot toggle
- {
- if(strcmp(tmp, "on", true) == 0)
- {
- if(BotOn == 1)
- {
- SendClientMessage(playerid, COLOR_YELLOW, "The Bot is already switched on");
- }
- else
- {
- BotOn = 1;
- SendClientMessageToAll(COLOR_YELLOW, "The servers bot has been switched on!");
- }
- } else if(strcmp(tmp, "off", true) == 0)
- {
- if(BotOn == 0)
- {
- SendClientMessage(playerid, COLOR_YELLOW, "The Bot is already switched off");
- }
- else
- {
- BotOn = 0;
- SendClientMessageToAll(COLOR_YELLOW, "The servers bot has been switched Off!");
- }
- }
- } else if (botcmd==5)//Bot age
- {
- if(BotOn == 0)
- {
- SendClientMessage(playerid, COLOR_WHITE, "The Bot is turned off so you cannot use this CMD.");
- return 1;
- }
- new Thing[200], Name[MAX_PLAYER_NAME];
- new AGE;
- AGE = strval(tmp);
- GetPlayerName(playerid, Name, sizeof(Name));
- format(Thing, sizeof(Thing), "%s has changed the bots age from %s to %d", Name, BotAge, AGE);
- SendClientMessageToAll(COLOR_YELLOW, Thing);
- format(BotAge, sizeof(BotAge), "%d", AGE);
- return 1;
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment