Making a /megaphone command - 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: Making a /megaphone command (
/showthread.php?tid=80456)
Making a /megaphone command -
gemadon - 04.06.2009
How do I make it so a player has to be in a certain vehicle for a command to work? Please HELP
Re: Making a /megaphone command -
Badger(new) - 04.06.2009
pawn Код:
if(IsPlayerInVehicle(playerid,/*Here you put the vehicle ID*/))return SendClientMessage(playerid,RED,"You Need to be in a certain vehicle for this to work!");
Re: Making a /megaphone command -
gemadon - 04.06.2009
Quote:
|
Originally Posted by -The_Badger-
pawn Код:
if(IsPlayerInVehicle(playerid,/*Here you put the vehicle ID*/))return SendClientMessage(playerid,RED,"You Need to be in a certain vehicle for this to work!");
|
1 more question... if you wanted to remove a player from a vehicle when they enter a certain car, how do you do it? I put IsPlayerInVehicle under OnPlayerEnterVehicle but it doesnt work when I go try it
Re: Making a /megaphone command -
Badger(new) - 04.06.2009
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new Float:X,Float:Y, Float:Z;
GetPlayerPos(playerid,X,Y,Z);
if(IsPlayerInVehicle(playerid,/*the vehicle*/)){
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),playerid, 0, 1);
SetPlayerPos(playerid,X,Y,Z);
}
return 1;
}