Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(strcmp(cmd, "/sethpinradius", true) == 0)
- {
- new str[MAX_STRING];
- if(PlayerInfo[playerid][pAdmin] > 10)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_RED, "Usage: /sethpinradius [Radius] [Health]");
- return 1;
- }
- new radius;
- radius = strval(tmp);
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid, COLOR_RED, "Usage: /sethpinradius [Radius] [Health] - 2");
- return 1;
- }
- new hp, Float:health;
- hp = strval(tmp);
- new Float:x,Float:y,Float:z;
- new Float:x1,Float:y1,Float:z1;
- GetPlayerPos(playerid,x,y,z);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(PlayerToPoint(radius, i, x, y, z) && i != playerid)
- {
- SetPlayerHealth(i, GetPlayerHealth(i,health) + hp);
- GetPlayerPos(i,x1,y1,z1);
- new Float:Distance;
- new Float:xd,Float:yd,Float:zd;
- xd = x1 - x;
- yd = y1 - y;
- zd = z1 - z;
- Distance = floatsqroot(xd*xd + yd*yd + zd*zd);
- new name[32];
- GetPlayerName(i, name, sizeof(name));
- format(str, sizeof(str), "Your distance from %s, is %f", name, Distance);
- SendClientMessage(playerid, TEAM_CYAN_COLOR, str);
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "Except you, everyone in the radius had those HP");
- return 1;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement