12.07.2012, 13:11
pawn Код:
dcmd_saveallstats(playerid,params[])
{
#pragma unused params
if(PInfo[playerid][Level] < 4) return SendClientMessage(playerid,red,error);
for(new i = 0; i < MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
SaveStats(i);
SendClientMessage(i,green,"» Stats saved!");
}
}
return 1;
}
dcmd_createshop(playerid,params[])
{
#pragma unused params
new string[128],ID = Shopcount;
if(PInfo[playerid][Level] < 5) return SendClientMessage(playerid,red,error);
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
format(string,sizeof(string),"Admin/Shops/%i.ini",BankCount);
INI_Open(string);
INI_WriteFloat("Posx",x);
INI_WriteFloat("Posy",y);
INI_WriteFloat("Posz",z);
INI_Save();
INI_Close();
binfo[ID][Posx] = x;
binfo[ID][Posy] = y;
binfo[ID][Posz] = z;
format(string,sizeof(string),"*** Shop ID %d has been created!",Shopcount);
SendClientMessage(playerid,green,string);
Create3DTextLabel("Trucking shop",yellow,binfo[ID][Posx],binfo[ID][Posy],binfo[ID][Posz],65.0,0,1);
tscp[ID] = CreateDynamicCP(sinfo[ID][Posx],sinfo[ID][Posy],sinfo[ID][Posz],2.0,-1,-1,-1);
Shopcount++;
PlaySound(playerid,1100);
return 1;
}
dcmd_createbank(playerid,params[])
{
#pragma unused params
new string[128],ID = BankCount;
if(PInfo[playerid][Level] < 5) return SendClientMessage(playerid,red,error);
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
format(string,sizeof(string),"Admin/Banks/%i.ini",BankCount);
INI_Open(string);
INI_WriteFloat("Posx",x);
INI_WriteFloat("Posy",y);
INI_WriteFloat("Posz",z);
INI_Save();
INI_Close();
binfo[ID][Posx] = x;
binfo[ID][Posy] = y;
binfo[ID][Posz] = z;
format(string,sizeof(string),"*** Bank ID %d has been created!",BankCount);
SendClientMessage(playerid,green,string);
Create3DTextLabel("Bank",yellow,binfo[ID][Posx],binfo[ID][Posy],binfo[ID][Posz],65.0,0,1);
BankP[ID] = CreateDynamicPickup(1274, 23, binfo[ID][Posx],binfo[ID][Posy],binfo[ID][Posz], 0, 0,-1,100.0);
BankExit[ID] = CreateDynamicPickup(1274, 23, 2305.8223,-16.1381,26.7496, ID, 0,-1,100.0);
Create3DTextLabel("Bank exit",yellow,2305.8223,-16.1381,26.7496,65.0,ID,1);
BankCount++;
PlaySound(playerid,1100);
return 1;
}
dcmd_acmds(playerid,params[])
{
#pragma unused params
if(PInfo[playerid][Level] < 1) return SendClientMessage(playerid,red,error);
ShowPlayerDialog(playerid,Admincmds,2,""lgreen2"Please Choose Your Level:",""lblue"Level 1 \n"lgreen"Level 2 \n"lgreen2"Level 3 \n"lyellow2"Level 4 \n"lorange"Level 5","Choose","Close");
return 1;
}
dcmd_setweather(playerid,params[])
{
new weather,string[100];
if(PInfo[playerid][Level] < 2) return SendClientMessage(playerid,red,error);
if(sscanf(params,"i",weather)) return SendClientMessage(playerid,green2,"USAGE: "lyellow2"/setweather <weather ID>");
SetWeather(weather);
format(string,sizeof(string),"» Admin %s(ID:%d) has set the global weather to "lblue"%i"lgreen2"!",GetPName(playerid),playerid,weather);
SendClientMessageToAll(green2,string);
PlaySoundForAll(1098);
return 1;
}
dcmd_settime(playerid,params[])
{
new hour, string[128];
if(PInfo[playerid][Level] < 2) return SendClientMessage(playerid,red,error);
if(sscanf(params,"i",hour)) return SendClientMessage(playerid,0xAFFF00FF,"USAGE: "lyellow2"/settime <hour>") && SendClientMessage(playerid,0xAFFF00FF,"FFUNCTION: "lblue"Sets the global time to the hour specified!");
if(hour < 0 || hour > 24) return SendClientMessage(playerid,red,"ERROR: "lgreen2"Invalid time! Use ranges from 0 to 24 only!");
Hours = hour;
SetWorldTime(hour);
PlaySoundForAll(1098);
format(string,sizeof(string),"*** Admin %s(ID:%d) has set the global time to "lblue"%i"lgreen2"!",GetPName(playerid),playerid,hour);
SendClientMessageToAll(blue,string);
return 1;
}
dcmd_kick(playerid,params[])
{
new id,reason[128],string[250];
if(PInfo[playerid][Level] < 2) return SendClientMessage(playerid,red,error);
if(sscanf(params,"us[128]",id,reason)) return SendClientMessage(playerid,0xAFFF00FF,"USAGE: "lyellow2"/kick <playerid> <reason>");
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid,red,notconnected);
format(string,sizeof(string),"*** %s(ID:%d) has been kicked by Admin %s(ID:%d) for %s",GetPName(id),id,GetPName(playerid),playerid,reason);
SendClientMessageToAll(red,string);
PlaySoundForAll(1141);
format(string,sizeof(string),"\t\t"lred"YOU HAVE BEEN KICKED - READ THE FOLLOWING DETAILS! \n\n"lyellow"YOUR NAME: "lorange"%s \n"lyellow"ADMIN NAME:"lorange" %s \n"lyellow"REASON: "lorange"%s \n\n\t\t"lred"This is NOT a ban so you may rejoin!",GetPName(id),GetPName(playerid),reason);
ShowPlayerDialog(id,9000,0,""lred"KICKED",string,"OK","");
Kick(id);
return 1;
}
dcmd_setlevel(playerid,params[])
{
new id,lvl,string[128];
if(PInfo[playerid][Level] < 5) return SendClientMessage(playerid,red,error);
if(sscanf(params,"ui",id,lvl)) return SendClientMessage(playerid,green2,"USAGE: "lyellow2"/setlevel <id> <level>");
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid,red,notconnected);
format(string,sizeof(string),"*** %s(ID:%d) has set your admin level to %d!",GetPName(playerid),playerid,lvl);
SendClientMessage(id,green,string);
if(PInfo[id][Level] < lvl)
{
GameTextForPlayer(id,"~g~~h~~h~Promoted!",4000,3);
PlaySound(id,1057);
}
if(PInfo[id][Level] > lvl)
{
GameTextForPlayer(id,"~r~~h~Demoted!",4000,3);
PlaySound(playerid,1085);
}
format(string,sizeof(string),"*** You've set %s(ID:%d)'s level to %d!",GetPName(id),id,lvl);
SendClientMessage(playerid,green,string);
PInfo[id][Level] = lvl;
return 1;
}
dcmd_ban(playerid,params[])
{
new id,reason[128],string[380],ip[16],ipp[16],file[128];
if(PInfo[playerid][Level] < 3) return SendClientMessage(playerid,red,error);
if(sscanf(params,"us[128]",id,reason)) return SendClientMessage(playerid,green2,"USAGE: "lyellow2"/ban <id> <reason>");
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid,red,notconnected);
format(string,sizeof(string),"*** %s(ID:%d) has been banned by Admin %s(ID:%d) for %s",GetPName(id),id,GetPName(playerid),playerid,reason);
SendClientMessageToAll(red,string);
new d,mm,y,h,m;
getdate(d,mm,y);
gettime(h,m);
format(string,sizeof(string),"\t\t"lred"YOU HAVE BEEN BANNED - READ THE FOLLOWING DETAILS! \n\n"lyellow"YOUR NAME: %s \nADMIN NAME: %s \nREASON WHY YOU GOT BANNED: %s \nDATE AND TIME: %d.%d.%d at %d:%d \n\n\t\t"lorange"If you wish to make an unban appeal, please take a screenshot of this box and go to www.nsg-gaming.net.",GetPName(id),GetPName(playerid),reason,d,mm,y,h,m);
ShowPlayerDialog(id,9001,0,""lred"BANNED",string,"OK","");
GetPlayerIp(playerid,ipp,16);
GetPlayerIp(id,ip,16);
PlaySoundForAll(1009);
format(file,sizeof(file),"Admin/Bans/%s.ini",ip);
INI_Open(file);
INI_WriteString("Player",GetPName(id));
INI_WriteString("PlayerIP",ip);
INI_WriteString("Admin",GetPName(playerid));
INI_WriteString("AdminIP",ipp);
INI_WriteString("Reason",reason);
INI_Save();
INI_Close();
format(file,sizeof(file),"Admin/Users/%s.ini",GetPName(id));
INI_Open(file);
INI_WriteInt("Banned",1);
INI_Save();
INI_Close();
Kick(id);
return 1;
}
dcmd_unban(playerid,params[])
{
#pragma unused params
if(PInfo[playerid][Level] < 3) return SendClientMessage(playerid,red,error);
ShowPlayerDialog(playerid,Unbandialog,1,""lgreen"UNBAN A PLAYER","Please type the ip of the player you want to "lgreen"unban"lwhite": \n","Unban","Close");
return 1;
}
dcmd_givemoney(playerid,params[])
{
new id,amount,string[128];
if(PInfo[playerid][Level] < 2) return SendClientMessage(playerid,red,error);
if(sscanf(params,"ui",id,amount)) return SendClientMessage(playerid,green2,"USAGE: "lyellow2"/givemoney <id / name> <amount>");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,red,notconnected);
GivePlayerMoney(id,amount);
format(string,sizeof(string),"» Admin %s(ID:%d) gave you "lblue"$%d"lgreen" cash!",GetPName(playerid),playerid,amount);
SendClientMessage(id,green,string);
format(string,sizeof(string),"» You gave %s(ID:%d) "lblue"$%d"lgreen" cash!",GetPName(id),id,amount);
SendClientMessage(playerid,green,string);
PlaySound(id,1058);
PlaySound(playerid,1058);
return 1;
}
dcmd_sethealth(playerid,params[])
{
new id,amount,string[128];
if(PInfo[playerid][Level] < 2) return SendClientMessage(playerid,red,error);
if(sscanf(params,"ui",id,amount)) return SendClientMessage(playerid,green2,"USAGE: "lyellow2"/sethealth <id/name> <amount of health>");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,red,notconnected);
SetPlayerHealth(id,amount);
format(string,sizeof(string),"» You have set %s(ID:%d)'s health to %i",GetPName(id),id,amount);
SendClientMessage(playerid,blue,string);
return 1;
}
dcmd_setarmour(playerid,params[])
{
new id,amount,string[128];
if(PInfo[playerid][Level] < 3) return SendClientMessage(playerid,red,error);
if(sscanf(params,"ui",id,amount)) return SendClientMessage(playerid,green2,"USAGE: "lyellow2"/setarmour <id/name> <amount of armour>");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,red,notconnected);
SetPlayerArmour(id,amount);
format(string,sizeof(string),"» You have set %s(ID:%d)'s armour to %i",GetPName(id),id,amount);
SendClientMessage(playerid,blue,string);
return 1;
}
dcmd_akill(playerid,params[])
{
new id,Float:health;
if(PInfo[playerid][Level] < 2) return SendClientMessage(playerid,red,error);
if(sscanf(params,"u",id)) return SendClientMessage(playerid,green2,"USAGE: "lyellow2"/akill <id>");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,red,notconnected);
GetPlayerHealth(id,health);
if(health <= 0) return SendClientMessage(playerid,red,"ERROR: "lyellow2"That player is already dead!");
SetPlayerHealth(id,0);
SendFMessage(playerid,green2,"» You have killed %s(ID:%d)",GetPName(id),id);
SendFMessage(id,green2,"» You have been killed by Admin %s(ID:%d)",GetPName(playerid),playerid);
return 1;
}
dcmd_setplayercompletedmissions(playerid,params[])
{
new id,amount,string[128];
if(PInfo[playerid][Level] < 4) return SendClientMessage(playerid,red,error);
if(sscanf(params,"ui",id,amount)) return SendClientMessage(playerid,green2,"USAGE: "lyellow2"/setplayercompletedmissions <id/name> <amount of completed missions>");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,red,notconnected);
PInfo[id][Missionspassed] = amount;
SetPlayerScore(id,amount);
format(string,sizeof(string),"» Admin %s(ID:%d) has set your completed missions to %d",GetPName(playerid),playerid,amount);
SendClientMessage(id,green2,string);
format(string,sizeof(string),"» You have set %s(ID:%d)'s completed missions to %d",GetPName(id),id,amount);
SendClientMessage(playerid,green2,string);
return 1;
}
dcmd_resetplayermissions(playerid,params[])
{
new id;
if(PInfo[playerid][Level] < 4) return SendClientMessage(playerid,red,error);
if(sscanf(params,"u",id)) return SendClientMessage(playerid,green2,"USAGE: "lyellow2"/resetplayermissions <id/name>");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,red,notconnected);
if(PInfo[id][Missionspassed] == 0) return SendClientMessage(playerid,red,"ERROR: "lyellow2"That player hasn't done any missions!");
PInfo[id][Missionspassed] = 0;
SetPlayerScore(id,0);
SendFMessage(id,green2,"» Admin %s(ID:%d) has reset your missions count!",GetPName(playerid),playerid);
SendFMessage(playerid,green2,"» You have reset %s(ID:%d)'s missions count!",GetPName(id),id);
return 1;
}
dcmd_cancelpmission(playerid,params[])
{
new id;
if(PInfo[playerid][Level] < 4) return SendClientMessage(playerid,red,error);
if(sscanf(params,"u",id)) return SendClientMessage(playerid,green2,"USAGE: "lyellow2"/cancelpmission <id/name>");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,red,notconnected);
IsPlayerInMission[id] = 0;
CancelPlayersCurrentMission(id);
SendFMessage(playerid,green2,"» You have canceled %s(ID:%d)'s current mission!",GetPName(id),id);
SendFMessage(id,green2,"» Admin %s(ID:%d) has canceled your current mission!",GetPName(playerid),playerid);
return 1;
}
dcmd_setwantedlvl(playerid,params[])
{
new id,lvl,string[128];
if(PInfo[playerid][Level] < 3) return SendClientMessage(playerid,red,error);
if(sscanf(params,"ui",id,lvl)) return SendClientMessage(playerid,green2,"USAGE: "lyellow2"/setwantedlvl <id/name> <wanted level>");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,red,notconnected);
if(lvl < 0 || lvl > 6) return SendClientMessage(playerid,red,"ERROR: "lyellow2"Invalid wanted level! Range from 0 to 6.");
SetPlayerWantedLevel(id,lvl);
format(string,sizeof(string),"» You have set "lblue"%s(ID:%d)'s"lgreen2" wanted level to "lblue"%d"lgreen2"!",GetPName(id),id,lvl);
SendClientMessage(playerid,green2,string);
format(string,sizeof(string),"» Admin "lblue"%s(ID:%d)"lgreen2" has set your wanted level to "lblue"%i"lgreen2"!",GetPName(playerid),playerid,lvl);
SendClientMessage(id,green2,string);
return 1;
}
dcmd_get(playerid,params[])
{
new id,Float:x,Float:y,Float:z;
if(PInfo[playerid][Level] < 3) return SendClientMessage(playerid,red,error);
if(sscanf(params,"u",id)) return SendClientMessage(playerid,green2,"USAGE: "lyellow2"/get <id/name>");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,red,notconnected);
GetPlayerPos(playerid,x,y,z);
SetPlayerInterior(id,GetPlayerInterior(playerid));
if(!IsPlayerInAnyVehicle(id))
{
SetPlayerPos(id,x+2,y,z);
SetPlayerInterior(playerid,GetPlayerInterior(id));
}
else
{
SetVehiclePos(GetPlayerVehicleID(id),x+2,y,z);
}
SendFMessage(playerid,green2,"» You have successfully teleported "lblue"%s(ID:%d)"lgreen2" to your location!",GetPName(id),id);
return 1;
}
dcmd_goto(playerid,params[])
{
new id,Float:x,Float:y,Float:z,string[128];
if(PInfo[playerid][Level] < 3) return SendClientMessage(playerid,red,error);
if(sscanf(params,"u",id)) return SendClientMessage(playerid,green2,"USAGE: "lyellow2"/goto <id/name>");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,red,notconnected);
GetPlayerPos(id,x,y,z);
SetPlayerInterior(playerid,GetPlayerInterior(id));
if(!IsPlayerInAnyVehicle(playerid))
{
SetPlayerPos(playerid,x+2,y,z);
}
else
{
SetVehiclePos(GetPlayerVehicleID(playerid),x+2,y,z);
PutPlayerInVehicle(playerid,GetPlayerVehicleID(playerid),0);
}
format(string,sizeof(string),"» You have successfully teleported to "lblue"%s(ID:%d)"lgreen"!",GetPName(id),id);
SendClientMessage(playerid,green,string);
return 1;
}
dcmd_admins(playerid,params[])
{
#pragma unused params
new string[450],count = 0;
for(new i = 0;i < MAX_PLAYERS; i++)
{
if(PInfo[i][Level] > 2)
{
format(string,sizeof(string),"%s"lgreen2"%s(ID:%d)[Level: %d] \n",string,GetPName(i),i,PInfo[i][Level]);
ShowPlayerDialog(playerid,4565,0,"Admins Online",string,"OK","");
count++;
}
else if(count == 0)
{
ShowPlayerDialog(playerid,4565,0,"Admins Online",""lred"No Admins Online!","OK","");
}
}
return 1;
}
dcmd_setmoney(playerid,params[])
{
new id,amount,string[128];
if(PInfo[playerid][Level] < 3) return SendClientMessage(playerid,red,error);
if(sscanf(params,"ui",id,amount)) return SendClientMessage(playerid,green2,"USAGE: "lyellow2"/setmoney «id/name» «amount»");
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid,red,notconnected);
ResetPlayerMoney(id);
GivePlayerMoney(id,amount);
format(string,sizeof(string),"» Admin "lblue"%s(ID:%d)"lgreen" has set your cash to "lblue"$%d"lgreen"!",GetPName(playerid),playerid,amount);
SendClientMessage(id,green,string);
format(string,sizeof(string),"» You have set "lblue"%s(ID:%d)"lgreen"'s cash to "lblue"$%d"lgreen"!",GetPName(id),id,amount);
SendClientMessage(playerid,green,string);
PlaySound(id,1058);
PlaySound(playerid,1058);
return 1;
}
dcmd_jail(playerid,params[])
{
new id,string[128];
if(PInfo[playerid][Level] < 3) return SendClientMessage(playerid,red,error);
if(sscanf(params,"u",id)) return SendClientMessage(playerid,green2,"USAGE: "lyellow2"/jail <id>");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,red,notconnected);
Jailplayer(id);
format(string,sizeof(string),"» Admin %s(ID:%d) has jailed %s(ID:%d) for 3 minutes.",GetPName(playerid),playerid,GetPName(id),id);
SendClientMessageToAll(red,string);
PlaySound(playerid,1002);
PlaySound(id,1002);
return 1;
}
dcmd_unjail(playerid,params[])
{
new id,string[128];
if(PInfo[playerid][Level] < 3) return SendClientMessage(playerid,red,error);
if(sscanf(params,"u",id)) return SendClientMessage(playerid,green2,"USAGE: "lyellow2"/unjail <id>");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,red,notconnected);
releaseplayer(id);
format(string,sizeof(string),"» %s(ID:%d) has been released from jail by Admin %s(ID:%d).",GetPName(id),id,GetPName(playerid),playerid);
SendClientMessageToAll(darkgreen,string);
PlaySound(id,1057);
KillTimer(Jailtimer[id]);
return 1;
}
dcmd_freeze(playerid,params[])
{
new id,string[128];
if(PInfo[playerid][Level] < 2) return SendClientMessage(playerid,red,error);
if(sscanf(params,"u",id)) return SendClientMessage(playerid,green2,"USAGE: "lyellow2"/freeze <id>");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,red,notconnected);
Freezeplayer(id);
format(string,sizeof(string),"» %s(ID:%d) has been frozen by Admin %s(ID:%d)",GetPName(id),id,GetPName(playerid),playerid);
SendClientMessageToAll(red,string);
PlaySound(id,1084);
return 1;
}
dcmd_unfreeze(playerid,params[])
{
new id,string[128];
if(PInfo[playerid][Level] < 2) return SendClientMessage(playerid,red,error);
if(sscanf(params,"u",id)) return SendClientMessage(playerid,green2,"USAGE: "lyellow2"/unfreeze <id>");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,red,notconnected);
TogglePlayerControllable(id,1);
PInfo[id][Frozen] = 0;
GameTextForPlayer(id,"~g~~h~~h~Unfrozen",4000,3);
format(string,sizeof(string),"» %s(ID:%d) has been unfrozen by Admin %s(ID:%d)",GetPName(id),id,GetPName(playerid),playerid);
SendClientMessageToAll(darkgreen,string);
KillTimer(Freezetimer[id]);
PlaySound(id,1057);
return 1;
}
dcmd_slap(playerid,params[])
{
new id,Float:x,Float:y,Float:z,Float:health,string[128];
if(PInfo[playerid][Level] < 2) return SendClientMessage(playerid,red,error);
if(sscanf(params,"u",id)) return SendClientMessage(playerid,green2,"USAGE: "lyellow2"/slap <id>");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,red,notconnected);
GetPlayerPos(id,x,y,z);
SetPlayerPos(id,x,y,z+14);
GetPlayerHealth(id,health);
format(string,sizeof(string),"» %s(ID:%d) has been slapped by Admin %s(ID:%d) [%f Health Left]",GetPName(id),id,GetPName(playerid),playerid,health);
SendClientMessageToAll(orange,string);
PlaySoundForAll(1190);
PlaySound(id,1190);
return 1;
}
dcmd_heal(playerid,params[])
{
new id,string[128];
if(PInfo[playerid][Level] < 2) return SendClientMessage(playerid,red,error);
if(sscanf(params,"u",id)) return SendClientMessage(playerid,green2,"USAGE: "lyellow2"/heal <id>");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,red,notconnected);
SetPlayerHealth(playerid,100);
format(string,sizeof(string),"» You have been healed by Admin %s(ID:%d)",GetPName(playerid),playerid);
SendClientMessage(id,green,string);
format(string,sizeof(string),"» You have healed %s(ID:%d)",GetPName(id),id);
SendClientMessage(playerid,green,string);
return 1;
}
dcmd_healall(playerid,params[])
{
#pragma unused params
new string[128];
if(PInfo[playerid][Level] < 3) return SendClientMessage(playerid,red,error);
for(new i = 0;i < MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
SetPlayerHealth(i,100);
PlaySound(i,1057);
}
}
format(string,sizeof(string),"» Admin %s(ID:%d) has healed everyone!",GetPName(playerid),playerid);
SendClientMessageToAll(green,string);
return 1;
}
dcmd_armourall(playerid,params[])
{
#pragma unused params
new string[128];
if(PInfo[playerid][Level] < 3) return SendClientMessage(playerid,red,error);
for(new i = 0;i < MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
SetPlayerArmour(i,100);
PlaySound(i,1057);
}
}
format(string,sizeof(string),"» Admin %s(ID:%d) has restored everyone's armour!",GetPName(playerid),playerid);
SendClientMessageToAll(green,string);
return 1;
}
dcmd_giveallmoney(playerid,params[])
{
#pragma unused params
new amount,string[128];
if(PInfo[playerid][Level] < 3) return SendClientMessage(playerid,red,error);
if(sscanf(params,"i",amount)) return SendClientMessage(playerid,green2,"USAGE: "lyellow2"/giveallmoney <amount>");
for(new i = 0;i < MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
GivePlayerMoney(i,amount);
PlaySound(i,1057);
}
}
format(string,sizeof(string),"» Admin %s(ID:%d) gave everyone $%d cash!",GetPName(playerid),playerid,amount);
SendClientMessageToAll(green,string);
return 1;
}
dcmd_announce(playerid,params[])
{
new text[128],string[128];
if(PInfo[playerid][Level] < 3) return SendClientMessage(playerid,red,error);
if(sscanf(params,"s[128]",text)) return SendClientMessage(playerid,green2,"USAGE: "lyellow2"/announce <message>");
format(string,sizeof(string),"~w~%s",text);
GameTextForAll(string,4000,3);
return 1;
}
dcmd_setname(playerid,params[])
{
#define SHM SendHelpMessage
new id,name[MAX_PLAYER_NAME],oldname[MAX_PLAYER_NAME],string[160];
if(PInfo[playerid][Level] < 4) return SendClientMessage(playerid,red,error);
if(sscanf(params,"us[24]",id,name)) return SHM(playerid,"/setname <id/name> <new name>","Sets a new name for the player specified!");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,red,notconnected);
GetPlayerName(id,oldname,sizeof(oldname));
SetPlayerName(id,name);
format(string,sizeof(string),"» Admin %s(ID:%d) has changed "lblue"%s(ID:%d)'s "lgreen2"name to "lblue"%s"lgreen2"!",GetPName(playerid),playerid,oldname,id,GetPName(id));
SendClientMessageToAll(green2,string);
return 1;
}