new Float: x, Float: y, Float: z, ; GetPlayerPos(playerid, x, y, z); |
CreateExplosion(x, y, z, 11, 25.0); |
Easy:
Lets do the Command, you must only have this to "convert" to a command processor. First, you have to find out, which Coordinats the player have: Now we got the Position. Lets create the Explosion, with the Position: 11 stands for the type 25.0stands for the radius End: If you want to do more Explosion, you can do a Timer, with repeating function. But, one or maybe two Explosion can kill one Player... |
This is not to kill other players, this is so players will not come near me, and if I have a explosion repeating over and over the player wont come near me.
EDIT: And I already got it so I get the players cords, I need help making the command it's self. |
You could say it...
I do this like I think this is right.. Do a for loop, do a variable up to 500, if the variable ends by the 500th "Explosion", stop the loop. If you want, that someone dont want to come so near to you, there are better methods. |
CMD:explode(playerid, params[]) { if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command."); if(PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command."); new Float:x, Float:y, Float:z; { CreateExplosion(x, y, z, 11, 25.0); SetPlayerArmour(playerid, 1000000000.0); SetPlayerHealth(playerid, 1000000000.0); SetTimerEx("Explode", 500, 0, "d", playerid); } else { ClearAnimations(playerid); SetPlayerArmour(playerid, 100.0); SetPlayerHealth(playerid, 100.0); return 1; } return 1; }
CMD:drop(playerid, params[]) { new pID; if(sscanf(params, "u", pID)) { new Float: x, Float: y, Float: z, ; GetPlayerPos(u, x, y, z + 150); } } |
Lets say you see someone.
And he is a little kid who wants to troll. Doing a command shouldnґt be a problem... SScanf also.. A really basic Command! The Target "jump" 150 M to the z Coordinate, so upward. |
CMD:explode(playerid, params[]) { if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command."); if(PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command."); { new Float ![]() GetPlayerPos( playerid, x, y, z ); CreateExplosion(x, y, z, 11, 25.0); SetPlayerArmour(playerid, 1000000000.0); SetPlayerHealth(playerid, 1000000000.0); SetTimerEx("Explode", 500, 0, "d", playerid); } else { ClearAnimations(playerid); SetPlayerArmour(playerid, 100.0); SetPlayerHealth(playerid, 100.0); return 1; } return 1; } |
CMD:explode(playerid, params[]) { if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command."); if(PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command."); { new Float, Float:y, Float:z; GetPlayerPos( playerid, x, y, z ); CreateExplosion(x, y, z, 11, 25.0); SetPlayerArmour(playerid, 1000000000.0); SetPlayerHealth(playerid, 1000000000.0); SetTimerEx("Explode", 500, 0, "d", playerid); } return 1; } forward Explode (playerid); public Explode (playerid { ClearAnimations(playerid); SetPlayerArmour(playerid, 100.0); SetPlayerHealth(playerid, 100.0); return 1; }
No, dont.
There are some mistakes... Wait //EDIT Код:
CMD:explode(playerid, params[]) { if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command."); if(PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command."); { new Float, Float:y, Float:z; GetPlayerPos( playerid, x, y, z ); CreateExplosion(x, y, z, 11, 25.0); SetPlayerArmour(playerid, 1000000000.0); SetPlayerHealth(playerid, 1000000000.0); SetTimerEx("Explode", 500, 0, "d", playerid); } return 1; } forward Explode (playerid); public Explode (playerid { ClearAnimations(playerid); SetPlayerArmour(playerid, 100.0); SetPlayerHealth(playerid, 100.0); return 1; } |
CMD:explode(playerid, params[]) { if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command."); if(PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command."); { new Float, Float:y, Float:z; GetPlayerPos( playerid, x, y, z ); SetPlayerArmour(playerid, 1000000000.0); SetPlayerHealth(playerid, 1000000000.0); SetTimerEx("Explode", 5000, 0, "d", playerid); for( new = i; i < 500, i++ ) { CreateExplosion(x, y, z, 11, 25.0); } return 1; } return 1; } forward Explode (playerid); public Explode (playerid { ClearAnimations(playerid); SetPlayerArmour(playerid, 100.0); SetPlayerHealth(playerid, 100.0); return 1; } |
If you want to learn something, you could try it on your own...
Here is the code: Untested, seen that return 1; is there because of the loop, could do a break... //edit forgot i++ |