21.05.2010, 08:47
how can I make a command that launches a bomb to a person selected? like /sendbomb and a missile go to the select id xD ?
Originally Posted by [ZDM
jumbo ]
no /sendbomb you start a missile from u and this missile go to the selected id |
dcmd(explode,7,cmdtext);
dcmd_explode(playerid,params[])
{
if(IsPlayerDAdminByDeadly[playerid][LoggedIn] == 1)
{
if(IsPlayerDAdminByDeadly[playerid][Level] >= 3)
{
new Index;
new tmp[256]; tmp = strtok(params,Index);
new tmp2[256]; tmp2 = strtok(params,Index);
if(!strlen(params)) return
SendClientMessage(playerid, LIGHTBLUE2, "Usage: /explode [PlayerID] [Reason]") &&
SendClientMessage(playerid, orange, "Function: Will Explode the specified player");
new player1;
new string[128];
new playername[MAX_PLAYER_NAME];
new adminname [MAX_PLAYER_NAME];
player1 = strval(tmp);
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && (IsPlayerDAdminByDeadly[player1][Level] != ServerInfo[MaxAdminLevel]))
{
GetPlayerName(player1, playername, sizeof(playername));
GetPlayerName(playerid, adminname, sizeof(adminname));
SendCommandToAdmins(playerid,"Explode");
new Float:burnx, Float:burny, Float:burnz;
GetPlayerPos(player1,burnx, burny, burnz);
CreateExplosion(burnx, burny , burnz, 7,10.0);
if(strlen(tmp2))
{
format(string,sizeof(string),"|- You have been exploded by Administrator %s | Reason: %s -|",adminname,params[2]);
SendClientMessage(player1,blue,string);
format(string,sizeof(string),"|- You have exploded %s | Reason: %s -|", playername,params[2]);
return SendClientMessage(playerid,BlueMsg,string);
}
else
{
format(string,sizeof(string),"|- You have been exploded by Administrator %s | Reason: Not Specified! -|",adminname);
SendClientMessage(player1,blue,string);
format(string,sizeof(string),"|- You have Exploded %s -|", playername);
return SendClientMessage(playerid,BlueMsg,string);
}
}
else return SendClientMessage(playerid, red, "ERROR: Player is not connected or is the highest level admin");
}
else return ErrorMessages(playerid, 1);
}
else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}