SA-MP Forums Archive
PutPlayerInVehicle - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: PutPlayerInVehicle (/showthread.php?tid=159806)



Disable commands - rbN. - 14.07.2010

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?


Re: PutPlayerInVehicle - MadeMan - 14.07.2010

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


Re: PutPlayerInVehicle - rbN. - 14.07.2010

@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?


Re: PutPlayerInVehicle - MadeMan - 14.07.2010

You can use CallRemoteFunction

https://sampwiki.blast.hk/wiki/CallRemoteFunction


Re: PutPlayerInVehicle - rbN. - 14.07.2010

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 ?


Re: PutPlayerInVehicle - DJDhan - 14.07.2010

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


Re: PutPlayerInVehicle - rbN. - 14.07.2010

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 ^^.


Re: PutPlayerInVehicle - MadeMan - 14.07.2010

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");



Re: PutPlayerInVehicle - rbN. - 14.07.2010

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


Re: PutPlayerInVehicle - Jefff - 15.07.2010

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