PutPlayerInVehicle
#1

How do you block commands? Like I have a /jetpack command in my gamemode, but actually the system is in a filterscript. So how to to disable /jetpack without putting the filterscript into the gamemode?
Reply
#2

You can't put player back in vehicle in OnPlayerExitVehicle. Use a timer or do it under OnPlayerStateChange.
Reply
#3

@MadeMan Thanks. I realised like 30 seconds before you said that :P. I spawned a nrg --> exitted it --> I went back to my other vehicle .

Anyways, thanks.

By the way, do you know how to block commands. Like I have a /jetpack command in my gamemode, but actually the system is in a filterscript. You know any way to disable /jetpack without putting the filterscript into gamemode?
Reply
#4

You can use CallRemoteFunction

https://sampwiki.blast.hk/wiki/CallRemoteFunction
Reply
#5

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
So how could I make
Код:
bool: Joined[MAX_PLAYERS],
into that?

Like
Код:
Joined[i] = true;
to the CallRemoteFunction?


I thought about

Код:
if(CallRemoteFunction("Joined[i]", "f", "true")) return SendClientMessage(playerid, COLOR_RED, "== You can't do this!");
but didn't had any success lol

Could you please do this one ?
Reply
#6

If you want to use "true" and "false", you can't do this:
Код:
if(CallRemoteFunction("Joined[i]", "f", "true")) return SendClientMessage(playerid, COLOR_RED, "== You Can't do this");
You need to use "s" for strings.

Then you need to use "strcmp" to compare the strings where you called the remote function from.

CallRemoteFunction @ the WIKI
Reply
#7

Quote:
Originally Posted by DJDhan
Посмотреть сообщение
If you want to use "true" and "false", you can't do this:
Код:
if(CallRemoteFunction("Joined[i]", "f", "true")) return SendClientMessage(playerid, COLOR_RED, "== You Can't do this");
You need to use "s" for strings.

Then you need to use "strcmp" to compare the strings where you called the remote function from.
Yes sorry, but could you please do it for me? I'm a noob in scripting lol ^^.
Reply
#8

Function in gamemode

pawn Код:
public IsPlayerJoined(playerid)
{
    if(Joined[playerid])
    {
        return 1;
    }
    else
    {
        return 0;
    }
}
call from filterscript

pawn Код:
if(CallRemoteFunction("IsPlayerJoined", "d", playerid)) return SendClientMessage(playerid, COLOR_RED, "== You Can't do this");
Reply
#9

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
Function in gamemode

pawn Код:
public IsPlayerJoined(playerid)
{
    if(Joined[playerid])
    {
        return 1;
    }
    else
    {
        return 0;
    }
}
call from filterscript

pawn Код:
if(CallRemoteFunction("IsPlayerJoined", "d", playerid)) return SendClientMessage(playerid, COLOR_RED, "== You Can't do this");
Woot, thanks.. LOVE YOU <3 D. not in gay way
Reply
#10

Or that way
pawn Код:
public IsPlayerJoined(playerid) return Joined[playerid] ? 1 : 0;
but simply
pawn Код:
public IsPlayerJoined(playerid) return Joined[playerid];
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)