Posts: 672
Threads: 89
Joined: Jan 2010
Hey!
Me again ....bla bla bla
I have a Vehicle Spawn FS (/v car id)!
I want to disable the /v command at DM areas but idk how since its another FS and the DM areas are in the GM!
thanks!
Posts: 2,929
Threads: 160
Joined: Feb 2009
Reputation:
0
Set a variable... I recommand PVars.
If player is in DM use SetPVarInt(playerid, "InDM", true);
if he exits SetPVarInt(playerid, "InDM", false);
Then in cmd: if(GetPVarInt(playerid, "InDM")) return SendClientMessage(playerid, RED, "You can't use this command in DM");
Posts: 672
Threads: 89
Joined: Jan 2010
Quote:
Originally Posted by Joe_
Put the command into your gamemode.
pawn Код:
//top of script
new DM[MAX_PLAYERS];
//OnPlayerConnect & OnPlayerDisconnect
DM[playerid] = 0;
//Under the command which you use to teleport you to the DM
DM[playerid] = 1;
//Under the command to remove u from the DM
DM[playerid] = 0;
//then, under the command '/v' add a check
if(DM[playerid]) return SendClientMessage(playerid, COLOR, "You can't use this command in a DM zone");
Or as above said, use pVars, I still use arrays though, not got round to using pVars.
|
Ummm but if there is the FS...should i do something in the FS aswell?
I mean...
Posts: 672
Threads: 89
Joined: Jan 2010
this is a part from the code i have created
pawn Код:
dcmd_vehicle(playerid, params[])
return dcmd_v(playerid, params);
dcmd_v(playerid, params[])
{
if(VEH[playerid] == 1) return SendClientMessage(playerid, red, "You can't use this command while at DM area");
{
new idx,iString[128];
if (params[0] == '\0') // Same effect as a !strlen check.
{
SendClientMessage(playerid, 0xFF4040FF, "[USAGE]: /v MODELID/NAME or /vehicle MODELID/NAME");
return 1;
}
But aint working
I have few thigs like this that work perfect!
Posts: 672
Threads: 89
Joined: Jan 2010
Posts: 517
Threads: 22
Joined: Mar 2010
Reputation:
0
You haven't, I just tested this, IT WORKS.