25.09.2013, 16:14
i need someone to help me i need this cmd is for admins /cc(clearchat), /disarm, /reports, /weapon(dialog). Player commands /fix, /admins, /report. Its been a long time that im not scripting so i forgot
if(strcmp(cmd, "/report", true) == 0)
{
new str[200];
GetPlayerName(playerid, str, 24);
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[96];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result)) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /report [text]");
format(str, sizeof str, "Report from [%d] %s: %s", playerid, str, result);
for(new i = 0; i < MAX_PLAYERS; i ++) { if(IsPlayerAdmin(i)) SendClientMessage(i, 0xFFFF00FF, str); }
SendClientMessage(playerid, 0xFFFF00FF, "Your report message was sent to online administrators, thank you.");
return 1;
}
dcmd_cc(playerid,params[])
{
for(new i = 0; i < 250; i++) SendClientMessageToAll(0x00000000," ");//250 should be enough
return 1;
}
CMD:disarm(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, color, "You're not an RCON admin.");
new giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, color, "Correct usage: /disarm [playerid/name]");
ResetPlayerWeapons(giveplayerid);
return 1;
}
CMD:admins(playerid, params[])
{
new pname[MAX_PLAYER_NAME], string[60];
for(new i = 0; i < MAX_PLAYERS: i ++)
{
if(IsPlayerConnected(i) && IsPlayerAdmin(i))
{
GetPlayerName(i, pname, sizeof(pname));
format(string, sizeof(string), "Admin: %s ID: %d", pname, i);
SendClientMessage(playerid, color, string);
}
}
return 1;
}
CMD:fix(playerid, params[]) { if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "You are not in a vehicle!"); if(GetPlayerState(playerid) != 2) return SendClientMessage(playerid, -1, "You are not in the driver seat!"); RepairVehicle(GetPlayerVehicleID(playerid)); SendClientMessage(playerid, -1, "Your vehicle has been sucessfully repaired!"); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); return 1; }
#include <zcmd>
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 927)
{
if(response)
{
switch(listitem)
{
case 0:
{
GivePlayerWeapon(playerid, 1, 500);
SendClientMessage(playerid, -1, "You have been given Brass Knuckles");
}
case 1:
{
GivePlayerWeapon(playerid, 2, 500);
SendClientMessage(playerid, -1, "You have been given a Golf Club");
}
case 2:
{
GivePlayerWeapon(playerid, 3, 500);
SendClientMessage(playerid, -1, "You have been given a Nightstick");
}
case 3:
{
GivePlayerWeapon(playerid, 4, 200);
SendClientMessage(playerid, -1, "You have been given a Knife");
}
case 4:
{
GivePlayerWeapon(playerid, 5, 500);
SendClientMessage(playerid, -1, "You have been given a Baseball Bat");
}
case 5:
{
GivePlayerWeapon(playerid, 6, 500);
SendClientMessage(playerid, -1, "You have been given a Shovel");
}
case 6:
{
GivePlayerWeapon(playerid, 7, 200);
SendClientMessage(playerid, -1, "You have been given a Pool Cue");
}
case 7:
{
GivePlayerWeapon(playerid, 8, 100);
SendClientMessage(playerid, -1, "You have been given a Katana");
}
case 8:
{
GivePlayerWeapon(playerid, 9, 100);
SendClientMessage(playerid, -1, "You have been given a Chainsaw");
}
case 9:
{
GivePlayerWeapon(playerid, 10, 100);
SendClientMessage(playerid, -1, "You have been given a Double-ended Dildo");
}
case 10:
{
ShowPlayerDialog(playerid, 928, DIALOG_STYLE_LIST, "Weapons", "Dildo\nVibrator\nSilver Vibrator\nFlowers\nCane\nGrenade\nTear Gas\nMolotov Cocktail\n9mm\nSilenced 9mm\nNext Page", "Select", "Cancel");
}
}
}
}
if(dialogid == 928)
{
if(response)
{
switch(listitem)
{
case 0:
{
GivePlayerWeapon(playerid, 11, 500);
SendClientMessage(playerid, -1, "You have been given a Dildo");
}
case 1:
{
GivePlayerWeapon(playerid, 12, 500);
SendClientMessage(playerid, -1, "You have been given a Vibrator");
}
case 2:
{
GivePlayerWeapon(playerid, 13, 500);
SendClientMessage(playerid, -1, "You have been given a Silver Vibrator");
}
case 3:
{
GivePlayerWeapon(playerid, 14, 200);
SendClientMessage(playerid, -1, "You have been given Flowers");
}
case 4:
{
GivePlayerWeapon(playerid, 15, 500);
SendClientMessage(playerid, -1, "You have been given a cane");
}
case 5:
{
GivePlayerWeapon(playerid, 16, 500);
SendClientMessage(playerid, -1, "You have been given Grenades");
}
case 6:
{
GivePlayerWeapon(playerid, 17, 200);
SendClientMessage(playerid, -1, "You have been given Tear Gas");
}
case 7:
{
GivePlayerWeapon(playerid, 18, 100);
SendClientMessage(playerid, -1, "You have been given Molotov Cocktails");
}
case 8:
{
GivePlayerWeapon(playerid, 22, 100);
SendClientMessage(playerid, -1, "You have been given a 9mm");
}
case 9:
{
GivePlayerWeapon(playerid, 23, 100);
SendClientMessage(playerid, -1, "You have been given a Silenced 9mm");
}
case 10:
{
ShowPlayerDialog(playerid, 930, DIALOG_STYLE_LIST, "Weapons", "Desert Eagle\nShotgun\nSawnoff Shotgun\nCombat Shotgun\nMicro SMG\nMp5\nAK-47\nM4\nTec-9\nCounty Rifle\nNext Page", "Select", "Cancel");
}
}
}
}
if(dialogid == 930)
{
if(response)
{
switch(listitem)
{
case 0:
{
GivePlayerWeapon(playerid, 24, 500);
SendClientMessage(playerid, -1, "You have been given a Desert Eagle");
}
case 1:
{
GivePlayerWeapon(playerid, 25, 500);
SendClientMessage(playerid, -1, "You have been given a Shotgun");
}
case 2:
{
GivePlayerWeapon(playerid, 26, 500);
SendClientMessage(playerid, -1, "You have been given a Sawnoff Shotgun");
}
case 3:
{
GivePlayerWeapon(playerid, 27, 200);
SendClientMessage(playerid, -1, "You have been given a Combat Shotgun");
}
case 4:
{
GivePlayerWeapon(playerid, 28, 500);
SendClientMessage(playerid, -1, "You have been given a Micro SMG");
}
case 5:
{
GivePlayerWeapon(playerid, 29, 500);
SendClientMessage(playerid, -1, "You have been given an Mp5");
}
case 6:
{
GivePlayerWeapon(playerid, 30, 200);
SendClientMessage(playerid, -1, "You have been given an AK-47");
}
case 7:
{
GivePlayerWeapon(playerid, 31, 100);
SendClientMessage(playerid, -1, "You have been given an M4");
}
case 8:
{
GivePlayerWeapon(playerid, 32, 100);
SendClientMessage(playerid, -1, "You have been given a Tec-9");
}
case 9:
{
GivePlayerWeapon(playerid, 33, 100);
SendClientMessage(playerid, -1, "You have been given a County Rifle");
}
case 10:
{
ShowPlayerDialog(playerid, 931, DIALOG_STYLE_LIST, "Weapons", "Sniper Rifle\nRPG\nHS Rocket\nFlamethrower\nMinigun\nSatchel Charge\nDetonator\nSpraycan\nFire Extinguister\nCamera\nParachute", "Select", "Cancel");
}
}
}
}
if(dialogid == 931)
{
if(response)
{
switch(listitem)
{
case 0:
{
GivePlayerWeapon(playerid, 34, 500);
SendClientMessage(playerid, -1, "You have been given Sniper Rifle");
}
case 1:
{
GivePlayerWeapon(playerid, 35, 500);
SendClientMessage(playerid, -1, "You have been given a RPG");
}
case 2:
{
GivePlayerWeapon(playerid, 36, 500);
SendClientMessage(playerid, -1, "You have been given a HS rocket");
}
case 3:
{
GivePlayerWeapon(playerid, 37, 200);
SendClientMessage(playerid, -1, "You have been given a Flamethrower");
}
case 4:
{
GivePlayerWeapon(playerid, 38, 500);
SendClientMessage(playerid, -1, "You have been given a Minigun");
}
case 5:
{
GivePlayerWeapon(playerid, 39, 500);
SendClientMessage(playerid, -1, "You have been given Satchel Charges");
}
case 6:
{
GivePlayerWeapon(playerid, 40, 200);
SendClientMessage(playerid, -1, "You have been given a Detonator");
}
case 7:
{
GivePlayerWeapon(playerid, 41, 100);
SendClientMessage(playerid, -1, "You have been given a Spray can");
}
case 8:
{
GivePlayerWeapon(playerid, 42, 100);
SendClientMessage(playerid, -1, "You have been given a Fire Extinguisher");
}
case 9:
{
GivePlayerWeapon(playerid, 43, 100);
SendClientMessage(playerid, -1, "You have been given a Camera");
}
case 10:
{
GivePlayerWeapon(playerid, 46, 100);
SendClientMessage(playerid, -1, "You have been given a Parachute");
}
}
}
}
return 1;
}
CMD:weapon(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You are not authorized to use this command. (RCON Only)");
ShowPlayerDialog(playerid, 927, DIALOG_STYLE_LIST, "Weapons", "Brass Knuckles\nGolf Club\nNightstick\nKnife\nBaseball Bat\nShovel\nPool Cue\nKatana\nChainsaw\nDouble-ended Dildo\nNext Page", "Select", "Cancel");
return 1;
}
CMD:report(playerid,params[])
{
new id, reason[35], string[128], sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME];
if(sscanf(params,"uz", id, reason)) return SendClientMessage(playerid, COLOR_GREY,"[True:RP]: /report [playerid/partofname] [reason]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_GREY,"Invalid player ID");
else
{
GetPlayerName(id, name,sizeof(name));
GetPlayerName(playerid, sendername, sizeof(sendername));
new hour, minute, second, year, month, day;
gettime(hour, minute, second);
getdate(year, month, day);
format(string, sizeof(string), "[ID:%d] %s has reported %s: %s. [Date:%d/%d/%d][Time: %d:%d:%d]", playerid, sendername, name, reason, month, day, year, hour, minute, second);
ABroadCast(COLOR_LIGHTRED,string,1);
format(string, sizeof(string), "Use /markfalse [id] or /acceptreport [id]");
ABroadCast(COLOR_LIGHTBLUE,string,1);
format(string, sizeof(string), "Your report was just sent to the online admins use (/reply) to reply, please wait for a reply");
SendClientMessage(playerid,COLOR_LIGHTRED,string);
PlayerNeedsHelp[playerid] = 1;
format(string, sizeof(string), "[ID:%d] %s has reported %s: %s. [Date:%d/%d/%d][Time: %d:%d:%d]", playerid, sendername, name, reason, month, day, year, hour, minute, second);
WriteReportsLog(string);
return 1;
}
}