, Someone say using CallRemoteFunction// In Gamemode
CMD:dm(playerid, params[])
{
InDM[playerid] = 1;
SendClientMessage(playerid, 0xFFFFFFFF, "You are in DM");
return 1;
}
// In Filterscript
CMD:car(playerid, params[])
{
if(InDM[playerid] == 1) return SendClientMessage(playerid, 0xFFFFFFFF, "You can't spawn car when in DM");
return 1;
}
|
You can use PVars to across variables like this between gamemodes and filterscripts.
https://sampwiki.blast.hk/wiki/Per-player_variable_system |
CMD:dm(playerid, params[])
{
SetPVarInt(playerid,"InDM",1);
SendClientMessage(playerid, 0xFFFFFFFF, "You are in DM");
return 1;
}
GetPVarInt(playerid,"InDM");
//in gamemode
CMD:dm(playerid, params[])
{
SetPVarInt(playerid,"InDM",1);
SendClientMessage(playerid, 0xFFFFFFFF, "You are in DM");
return 1;
}
//in Filterscript
CMD:car(playerid, params[])
{
GetPVarInt(playerid, "InDM");
SendClientMessage(playerid, 0xFFFFFFFF, "you can't use cars when in DM");
return 1;
}
if(GetPVarInt(playerid, "InDM")) return SendClientMessage(playerid, 0xFFFFFFFF, "you can't use cars when in DM");
|
You have to include it inside a condition, you'd be able to if you knew how if-else conditions work.
Example below: pawn Код:
When you remove someone from the DM zone, simply use DeletePVar |