All pastes #443671 Raw Edit

Stuff

public text v1 · immutable
·published 2007-04-16 22:30 UTC
rendered paste body
public OnPlayerCommandText(playerid, cmdtext[])
{
//Kicked commands exploit
if (!IsPlayerConnected(playerid)){
return 1;


voidplayer[playerid] = 1;
SetTimer("ClearVoid",2000,0);

new string[256];
new tmp[256];
new cmd[256];
new idx;
new setting;
new setting2;
cmd = strtok(cmdtext, idx);

if(strfind(cmdtext,"/report",true)==0)
{
new playername[MAX_PLAYER_NAME];
new reportname[MAX_PLAYER_NAME];
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)){
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /report [playerid] [reason] (/reasons)");
return 1;
}
setting = strval(tmp);
if(!IsPlayerConnected(setting))
{
SendClientMessage(playerid, COLOR_WHITE, "That Player is not connected...");
return 1;
}
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)){
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /report [playerid] [reason] (/reasons)");
return 1;
}
setting2 = strval(tmp);
if(setting2 > 9)
{
SendClientMessage(playerid, COLOR_WHITE, "That is not a valid reason");
return 1;
}
if(setting2 == 0)
{
SendClientMessage(playerid, COLOR_WHITE, "That is not a valid reason");
return 1;
}
else{
GetPlayerName(playerid,playername,sizeof(playername));
GetPlayerName(setting,reportname,sizeof(reportname));
SendClientMessage(playerid,COLOR_RED,"*** BB: A report has been sent to the online admins");
}
switch(setting2)
{
	case 1:format(string,sizeof(string),"*** BB: %s has reported %s using Anti-Cheat Revenge",playername,reportname);
	case 2:format(string,sizeof(string),"*** BB: %s has reported %s using Godmode",playername,reportname);
	case 3:format(string,sizeof(string),"*** BB: %s has reported %s using Air Break",playername,reportname);
	case 4:format(string,sizeof(string),"*** BB: %s has reported %s using Money Cheats",playername,reportname);
	case 5:format(string,sizeof(string),"*** BB: %s has reported %s using Indoor Weapons",playername,reportname);
	case 6:format(string,sizeof(string),"*** BB: %s has reported %s using Speed Cheats",playername,reportname);
	case 7:format(string,sizeof(string),"*** BB: %s has reported %s using Vehicle Warping",playername,reportname);
	case 8:format(string,sizeof(string),"*** BB: %s has reported %s using Flying Cars",playername,reportname);
	case 9:format(string,sizeof(string),"*** BB: %s has reported %s using Weapon Cheats",playername,reportname);
}
SendMessageToAdmins(string);
printf(string);
return 1;
}

if(strfind(cmdtext,"/reasons",true)==0){
SendClientMessage(playerid,COLOR_ORANGE,"Reasons:");
SendClientMessage(playerid,COLOR_ORANGE,"Reason 1: Anti-Cheat Revenge");
SendClientMessage(playerid,COLOR_ORANGE,"Reason 2: Godmode");
SendClientMessage(playerid,COLOR_ORANGE,"Reason 3: Air Break");
SendClientMessage(playerid,COLOR_ORANGE,"Reason 4: Money Cheats");
SendClientMessage(playerid,COLOR_ORANGE,"Reason 5: Indoor Weapons");
SendClientMessage(playerid,COLOR_ORANGE,"Reason 6: Speed Cheats");
SendClientMessage(playerid,COLOR_ORANGE,"Reason 7: Vehicle Warping");
SendClientMessage(playerid,COLOR_ORANGE,"Reason 8: Flying Cars");
SendClientMessage(playerid,COLOR_ORANGE,"Reason 9: Weapon Cheats");
return 1;
}

return 0;
}