[HELP]Can't use command in that zone! -
System64 - 03.05.2011
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;
}
Re: [HELP]Can't use command in that zone! -
park4bmx - 03.05.2011
what your looking for is
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Re: [HELP]Can't use command in that zone! -
System64 - 03.05.2011
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
Re: [HELP]Can't use command in that zone! -
park4bmx - 03.05.2011
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
Re: [HELP]Can't use command in that zone! -
System64 - 04.05.2011
doesn't work
Код:
D:\Private\Server\gamemodes\freeroam.pwn(878) : warning 215: expression has no effect
878 is InDmZone[playerid]==1;
Re: [HELP]Can't use command in that zone! -
park4bmx - 04.05.2011
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
Re: [HELP]Can't use command in that zone! -
System64 - 04.05.2011
now it's right but when I leave that zone (die) than I can't use any command, help again
Re: [HELP]Can't use command in that zone! -
Wesley221 - 04.05.2011
Then:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
InDmZone[playerid] = 0;
return 1;
}
Re: [HELP]Can't use command in that zone! -
System64 - 04.05.2011
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 ?
Re: [HELP]Can't use command in that zone! -
Wesley221 - 04.05.2011
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;
}
Re: [HELP]Can't use command in that zone! -
System64 - 04.05.2011
yeah thanks everyone, lock this
Re: [HELP]Can't use command in that zone! -
AK47317 - 04.05.2011
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
Re: [HELP]Can't use command in that zone! -
System64 - 04.05.2011
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