04.04.2016, 13:17
Very basic example:
https://sampwiki.blast.hk/wiki/Keys
https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
PHP код:
public OnPlayerKeyStateChange ( playerid, newkeys, oldkeys ) {
if ( newkeys & KEY_SECONDARY_ATTACK ) {
// Change the three 00.00's to your entrance point's coordinates
if ( IsPlayerInRangeOfPoint ( playerid, 5.0, 00.00, 00.00, 00.00 ) ) {
// SetPlayerPos ...
// etc etc
}
// Change these 00.00's to your exit point's coordinates ...
else if ( IsPlayerInRangeOfPoint ( playerid, 5.0, 00.00, 00.00, 00.00 ) ) {
// SetPlayerPos ...
// etc etc
}
}
return true ;
}
https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint