/gymenter /gymexit
#1

hey, i want two /enter and /exit commands:

so on the gym enter, i want a text to say : /gymenter
and on the gym exit, a text must say /gymexit

the commands are /gymenter & /gymexit

you can only type /gymenter or /gymexit when you are on the right spot to type it. if not it wont work

AddPlayerClass(0,320.2555,231.0873,889.5491,2.4040 ,0,0,0,0,0,0); // gym enter
AddPlayerClass(0,320.2745,232.1795,889.5491,177.26 91,0,0,0,0,0,0); // gym exit
Reply
#2

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 10, enterx, entery, enterz) // can enter
{
    SetPlayerPos(playerid, enterx, entery, enterz);
    return SetPlayerInterior(playerid, gyminterior);
}
if(IsPlayerInRangeOfPoint(playerid, 10, exitx, exity, exitz) // can exit
{
    SetPlayerPos(playerid, exitx, exity, exitz);
    return SetPlayerInterior(playerid, 0);
}
SendClientMessage(playerid, color, "You are not near the gym entrance or exit.");
Reply
#3

pawn Код:
// @ Top of the script:

new Gym_Enter;
new Gym_Exit;

// @ OnGameModeInit:

Gym_Enter = CreatePickup(1239, 23, 320.2555, 231.0873, 889.5491, 0);
Gym_Exit = CreatePickup(1239, 23, 320.2745, 232.1795, 889.5491, 0);

// @ OnPlayerPickUpPickup:

if(pickupid == Gym_Enter)
{
    GameTextForPlayer(playerid, "TYPE: /GYMENTER", 2000, 4);
}
else if(pickupid == Gym_Exit)
{
    GameTextForPlayer(playerid, "TYPE: /GYMEXIT", 2000, 4);
}

// @ OnPlayerCommandText:

if(strcmp(cmdtext, "/gymenter", true) == 0)
{
    if(IsPlayerInRangeOfPoint(playerid, 5, 320.2555, 231.0873, 889.5491))
    {
        SetPlayerPos(playerid, 320.2745, 232.1795, 889.5491);
        SetPlayerInterior(playerid, ???); // YOUR INTERIOR.
        return 1;
    }
}
if(strcmp(cmdtext, "/gymexit", true) == 0)
{
    if(IsPlayerInRangeOfPoint(playerid, 5, 320.2745, 232.1795, 889.5491))
    {
        SetPlayerPos(playerid, 320.2555, 231.0873, 889.5491);
        SetPlayerInterior(playerid, 0);
        return 1;
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)