Security Panel / Swipe card Help - 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: Security Panel / Swipe card Help (
/showthread.php?tid=83665)
Security Panel / Swipe card Help -
b0r1quajay - 26.06.2009
i ned help making a security panel / swipe card machine to open my fire department gate, its going to be set that only a medic skin/ fireman skin can open the gate, im new to the whole onplayerkeystatechange thing, please help.
heres the pastebin:
http://pastebin.com/f4ac4ef01
Re: Security Panel / Swipe card Help -
Lazarus - 27.06.2009
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if((newkeys == KEY_SECONDARY_ATTACK)
{
if(GetPlayerSkin(playerid) == 280 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 284 || GetPlayerSkin(playerid) == 285 || GetPlayerSkin(playerid) == 286 || GetPlayerSkin(playerid) == 265 || GetPlayerSkin(playerid) == 266 || GetPlayerSkin(playerid) == 267 || GetPlayerSkin(playerid) == 71)
{
MoveObject(fdgate1, 1761.259399, -1691.880127, 18.295528);
SendClientMessage(playerid, COLOR_RED, "You've opened the Gate.");
}
}
return 1;
}
Is that what you're trying to do?
Re: Security Panel / Swipe card Help -
Chaprnks - 27.06.2009
Quote:
Originally Posted by Lazarus
pawn Код:
if((newkeys == KEY_SECONDARY_ATTACK)
|
pawn Код:
newkeys & KEY_SECONDARY_ATTACK
More efficient.