[HELP]Can't use command in that zone!
#1

Hay everyone, I made a dm zone, and I can't make when is player in that zone, than he can't use any other comamnd, also I don't now how to make when somebody kill him when he is in that zone, than he spawn again in that zone, pliss help me, thanks

Here is command

Код:
CMD:minigun(playerid,params[])
{
   new name[24];
   new string[48];
   SetPlayerPos(playerid, 2555.6736,2844.0222,10.8203);
   GivePlayerWeapon(playerid, 38, 9999);
   GetPlayerName(playerid, name, sizeof(name));
   format(string, sizeof(string), ""COL_RED"%s "COL_LIGHTBLUE">>/minigun<<", name);
   SendClientMessageToAll(COLOR_GREEN, string);
   return 1;
}
Reply
#2

what your looking for is https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Reply
#3

omfg I now for that but If I set it, then player must be in that cooridnates and than type command but I need when he type /minigun, automatically he can't use any other command which is in GM
Reply
#4

Well in that case u will need to put some variable down.
EXAMPLE
pawn Код:
//first at the top
new InDmZone[MAX_PLAYERS];

//then this when u enter ur DM
InDmZone[playerid]=1;

//And then in all ur other command that u don't want the player to acceses when he is in the DM u do
If(InDmZone[playerid]==1) return //what ever u want to return,like a message or what ever
And is not necessary to swear
Because next time u might not get any help
Reply
#5

doesn't work
Код:
D:\Private\Server\gamemodes\freeroam.pwn(878) : warning 215: expression has no effect
878 is InDmZone[playerid]==1;
Reply
#6

Sorry I done it wrong change that to
InDmZone[playerid]=1;
U can go back and take a look i edit it currectly now :P
Reply
#7

now it's right but when I leave that zone (die) than I can't use any command, help again
Reply
#8

Then:

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
InDmZone[playerid] = 0;
return 1;
}
Reply
#9

I must set it in my /exitdm command and you really help me, bt if is not roblem how can I set when somebody kill me (or anybody else) in minigun zone, than he spawn agian in that zone ?
Reply
#10

Ah, then this should work; put this in "public OnPlayerDeath(playerid, killerid, reason)"

pawn Код:
if(InDmZone[playerid] == 1)
{
     SetPlayerPos(playerid, X, Y, Z);
     SendDeathMessage(killerid, playerid, reason);
     return 1;
}
Reply
#11

yeah thanks everyone, lock this
Reply
#12

you need to use
pawn Код:
IsPlayerInArea ( Float: minx , Float: miny , Float: maxx , Float: maxy )
just search around sa-mp you'll see about this tutorial
Reply
#13

Quote:
Originally Posted by AK47317
Посмотреть сообщение
you need to use
pawn Код:
IsPlayerInArea ( Float: minx , Float: miny , Float: maxx , Float: maxy )
just search around sa-mp you'll see about this tutorial
I made that, when I type /exitdm than it spawn me on my server spawn and then I can use any other commands, thanks for help everyone
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)