is it possable? - 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: is it possable? (
/showthread.php?tid=215817)
is it possable? -
hadzx - 24.01.2011
is it possable to make the hydra rcon only? so if your logged into rcon it lets you stay inside it and if your not then you cant stay inside.
if so can somebody help i got a rough idea but ive been searching on ******,sampforums everrywwhere and cant find anything the only thing i found was name only vehicles but i want rcon.
thx
Re: is it possable? -
iggy1 - 24.01.2011
Here is how i'd do it.
pawn Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
if(!IsPlayerAdmin(playerid) && GetVehicleModel(vehicleid) == 520)
SetVehicleParamsForPlayer(vehicleid, forplayerid, 0, 1);
return 1;
}
Re: is it possable? -
Stigg - 24.01.2011
IsPlayerAdmin ?
Peace...
Re: is it possable? -
hadzx - 24.01.2011
Quote:
Originally Posted by iggy1
Here is how i'd do it.
pawn Код:
public OnVehicleStreamIn(vehicleid, forplayerid) { if(!IsPlayerAdmin(playerid) && GetVehicleModel(vehicleid) == 520) SetVehicleParamsForPlayer(vehicleid, forplayerid, 0, 1); return 1; }
|
thanks 1 error tho
Код:
C:\Users\Stephen-Laptop\Desktop\server samp - Copy\gamemodes\lvpg.pwn(459) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
edit where in that code do i put if your not the rcon admin it says "your not allowed to use this!"
Re: is it possable? -
HyperZ - 24.01.2011
pawn Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
if(!IsPlayerAdmin(forplayerid) && GetVehicleModel(vehicleid) == 520)
SetVehicleParamsForPlayer(vehicleid, forplayerid, 0, 1);
return 1;
}
Re: is it possable? -
iggy1 - 24.01.2011
Its forplayerid not playerid.
EDIT: this is another method like what you want.
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(!IsPlayerAdmin(playerid) && GetVehicleModel(vehicleid) == 520)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, 0xff0000FF, "You are not admin.");
}
return 1;
}
Re: is it possable? -
hadzx - 24.01.2011
Quote:
Originally Posted by iggy1
Its forplayerid not playerid.
|
... mk still confused
and the other code complied and it wouldnt let me in atall
ugh i knew this was hard >_<
Re: is it possable? -
hadzx - 24.01.2011
bump please hellp:P
Re: is it possable? -
iggy1 - 24.01.2011
I changed the code a little it should work if not sorry.
pawn Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
if(GetVehicleModel(vehicleid) == 520)
{
if(!IsPlayerAdmin(playerid))
{
SetVehicleParamsForPlayer(vehicleid, forplayerid, 0, 1);
SendClientMessage(playerid, 0xff0000FF, "Only admin can fly hydra's");
}
}
return 1;
}
Re: is it possable? -
Grim_ - 24.01.2011
The above code will send a message once the vehicle is streamed in, which would send the same message multiple times, once every time the player enters the area for the vehicle to be streamed. This can be done by simply removing the player from the vehicle upon entrance:
pawn Код:
public OnPlayerStateChange( playerid, newstate, oldstate )
{
if( newstate == PLAYER_STATE_DRIVER && GetVehicleModel( GetPlayerVehicleID( playerid ) ) == 520 && !IsPlayerAdmin( playerid ) )
{
SendClientMessage( playerid, 0xFF0000FF, "Only admins can fly hydra's" );
RemovePlayerFromVehicle( playerid );
}
return 1;
}