script line that 'talks' for a player?
#1

Hello,

I have a filterscript in my server that enables your vehicle getting auto repaired if damage <350.
you can disable this with the command /ar

now, i want to make a demolition derby in the blood bowl stadium.
and a demolition derby is about crashing into other people and get them damage.
but with my filterscript you're not able do destroy a car when someone is inside.

does anyone know a line of script that can actually 'talk' for the player so when the player enters interior 15 (the blood bowl arena) the script automaticly 'says' /ar?
and maybe if you leave interior 15 the script says it again? to enable the autorepair again?


(sorry for bad english)
Reply
#2

Quote:
Originally Posted by Ariehh
Посмотреть сообщение
Hello,

I have a filterscript in my server that enables your vehicle getting auto repaired if damage <350.
you can disable this with the command /ar

now, i want to make a demolition derby in the blood bowl stadium.
and a demolition derby is about crashing into other people and get them damage.
but with my filterscript you're not able do destroy a car when someone is inside.

does anyone know a line of script that can actually 'talk' for the player so when the player enters interior 15 (the blood bowl arena) the script automaticly 'says' /ar?
and maybe if you leave interior 15 the script says it again? to enable the autorepair again?


(sorry for bad english)
I don't know if that is able, but you could make a cmd like /dd to enter the destruction derby and then you will just place averything that should happend in there (so if you want to enable car destruction you could make a function in on car takedmg or something (just take the things that is in the cmd /ar and place them in /dd cmd))
Sorry if you didn't understand what i wrote xD
Reply
#3

Quote:

I don't know if that is able, but you could make a cmd like /dd to enter the destruction derby and then you will just place averything that should happend in there (so if you want to enable car destruction you could make a function in on car takedmg or something (just take the things that is in the cmd /ar and place them in /dd cmd))
Sorry if you didn't understand what i wrote xD

no i do not really understand what you are saying xD

but i think it can be done with just 1 line of code.
(I dont know very much about coding/scripting but lets try xd)

ive got a teleport menu and in pawno ther are 4 lines for that teleport:
coordinates,
intrerior id
virtual world (??)
controllable yes/no

Код:
case 7: //Arena
			{
				SetPlayerPos(playerid,-1412.9663, 935.2322, 1036.4211);
				SetPlayerInterior(playerid, 15);
				SetPlayerVirtualWorld(playerid, 0);
   				TogglePlayerControllable(playerid, 1);
			}
maybe you can add something like this:
Код:
GetPlayerInterior (playerid, INTER)
if INTER = 15 (playerid, cmd(/ar))
i dont know if these lines are valid codes
Reply
#4

Just paste the /ar code at the demolition entering code?
Reply
#5

lol youre right xD ill try that :P

EDIT: the auto repair is in a filterscript.
maybe you can disable a filterscript while in an interior?
Reply
#6

Just add:
pawn Код:
OnPlayerCommandText(playerid, "/ar");
whenever you want to call a command directly. Should work fine.
Reply
#7

i think you dont understand what i mean.

If ANYONE enters interior id 15,
i want the GAMEMODEscript to disable a FILTERscript.
and is ANYONE leaves interior 15,
i want the GAMEMODEscript to enable the said FILTERscript again.

wow, why didnt i say it like this before :P
Reply
#8

I used PVars here because it will be a lot easier than writing public functions to use cross script.

pawn Код:
//when they enter the derby
SetPVarInt( playerid, "in_derby", 1 );

//when they leave
DeletePVar( playerid, "in_derby" );

//in your /ar command at the top
if( GetPVarInt( playerid, "in_derby" ) ) return 1;//or return a message or what ever
Better to do this than unload the FS. Use this in any commands you want disabled in the derby.

EDIT: You will also want to send the /ar command like vince said if they already have auto-repair active.

Quote:
Originally Posted by Vince
Посмотреть сообщение
Just add:
pawn Код:
OnPlayerCommandText(playerid, "/ar");
whenever you want to call a command directly. Should work fine.
Reply
#9

Quote:
Originally Posted by iggy1
Посмотреть сообщение
I used PVars here because it will be a lot easier than writing public functions to use cross script.

pawn Код:
//when they enter the derby
SetPVarInt( playerid, "in_derby", 1 );

//when they leave
DeletePVar( playerid, "in_derby" );

//in your /ar command at the top
if( GetPVarInt( playerid, "in_derby" ) ) return 1;//or return a message or what ever
Better to do this than unload the FS. Use this in any commands you want disabled in the derby.
okay i do understand it, and i will add the SetPVarInt and DeletePVar to my gamemode script,
but could you please add it to my filterscript?
i dont know where to put it exactly :$

i hope you could do this for me
Reply
#10

Just your /ar command needs changing in the FS.
pawn Код:
dcmd_ar(playerid, params[])
{
    #pragma unused params
   
    if( GetPVarInt( playerid, "in_derby" ) )//must be set when they enter the game
    {
        SendClientMessage(playerid, -1, "<SERVER> You cannot use that command in the derby.");
        return 1;
    }
   
    if (AutoRepairTrigger[playerid] == 0)
    {
        AutoRepairTrigger[playerid] = 1;
        SendClientMessage(playerid, 0x99FFFFAA, "Automatisch repareren uit. /ar om weer aan te zetten");
        return 1;
    }
    else if (AutoRepairTrigger[playerid] == 1)
    {
        AutoRepairTrigger[playerid] = 0;
        SendClientMessage(playerid, 0x99FFFFAA, "Automatisch repareren aan!");
        return 1;
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)