14.07.2015, 20:50
explode cmd please
CMD:explode(playerid, params[]) {
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
CreateExplosion(x, y, z, 6, 10.0);
return 1;
}
command(explodir, playerid, params[]) {
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "[ERRO]: Vocк Nгo Tem Permissгo Para Usar Esse Comando Apenas Admin 1+ !.");
new
explodido,
Float:x,
Float:y,
Float:z
;
if(sscanf(params,"u",explodido)) return SendClientMessage(playerid, -1,"[USO]:/explodir [ID]");
if(!IsPlayerConnected(explodido)) return SendClientMessage(playerid, -1,"[ERRO]: Jogador nгo conectado");
GetPlayerPos(explodido,x,y,z);
CreateExplosion(x,y,z,7,10.0);
return 1;
}
CMD:explode(playerid, params[]) { new string[128], ID, Float:x, Float:y, Float:z; //Define ID (the playerid you are going to explode) and the floats where the explosion shall be created (ID's position). if(sscanf(params, "u", ID)) SendClientMessage(playerid, -1, "Correct usage: /explode <playerid/name>"); //Show a message with correct usage of the command, if inputted wrong. else if(!IsPlayerConnected(ID)) SendClientMessage(playerid, -1, "That player is not online."); //Output if ID is not online. else //If everything has gone fine, do this. { GetPlayerPos(ID, x, y, z); //Get ID's pos and store the pos in the floats x, y, z. CreateExplosion(x, y, z, 12, 10.0); //Create an explosion at the pos retrieved from x, y, z. format(string,sizeof(string), "You have exploded %s(%d).", PlayerName(ID), ID); //Store neat message showing that you've exploded "IDsName(ID)", eg. Barry(16) in string. SendClientMessage(playerid, -1, string); //Output the string to the client. } }