Scripting /enter!
#1

Hello guys. I got few questions. I would be very heppy if you help me .
1) I scripted new Hospital at Bayside and added "heart" icon. I would like when player go through it to enter automatically inside the building (I mean to do not need to press /enter). My whole script is on the bottom of the thread so you can easily modify and check it.
2) I would like to add a admin nick system. I mean when admin type /turn and chose appear in the admin list, he must enter nickname that will be showed in /admins like that:
((You type /admins))
______________________________________________
ADMINS ONLINE:
[ONLINE:] Lead Administrator (PhoeNiX): Terell Banks [ID: 1]

I colored that I want in red just to understand for what I'm talking about, really I don't want to be red in game/I don't want to be scripted in red color.

And that are my questions. I would be glad if you explain me what kind of script I must enter and where for 1) (Adding automatically /enter ...) If it is not possible to enter automatically in buildings I will be happy if you just explain me how to make it when player go over the icon to show him: Type /enter to enter inside the building and when he type it to enter.
Thank you all in advance guys.
Best Regards
http://www.mediafire.com/?7brnn11vx25kisp
Reply
#2

Use OnPlayerPickUpPickup.
Reply
#3

And "IsPlayerInRangeOfPoint"!
Reply
#4

Why would you need to use that? Obviously they're at the pickup if they picked it up ._.
Reply
#5

Excuse me guys but I forgot to say that I'm beginner, may you please give me example and I forgot to upload my script now is edited.
Reply
#6

Can someone help me? I'll really appreciate it.
Reply
#7

Example.
pawn Код:
new hospitalpickup;
public OnGameModeInit()
{
    hospitalpickup = CreatePickup(model,type,x,y,z,virtualworld);
    return 1;
}
public OnPlayerPickUpPickup(playerid,pickupid)
{
    if(pickupid == hospitalpickup)
    {
        SetPlayerPos(playerid,x,y,z);
    }
}
================================================== =====
Defines a new variable that will later hold the pickup.
pawn Код:
new hospitalpickup;
Creates the pickup, and assigns the variable to that pickup.
pawn Код:
public OnGameModeInit()
{
    hospitalpickup = CreatePickup(model,type,x,y,z,virtualworld);
    return 1;
}
This part states that if a player picks up that pickup, then it will SetPlayerPos which is where you would put your coordinates.
pawn Код:
public OnPlayerPickUpPickup(playerid,pickupid)
{
    if(pickupid == hospitalpickup)
    {
        SetPlayerPos(playerid,x,y,z);
    }
}
Hope I helped.
Reply
#8

^

For multiple pickups:

pawn Код:
public OnPlayerPickUpPickup(playerid,pickupid)
{
    if(pickupid == hospitalpickup)
    {
        SetPlayerPos(playerid,x,y,z);
    }
    else if(pickupid == someotherpickup)
    {
        SetPlayerPos(playerid, x, y, z);
    }
}
Reply
#9

Thank you very much everyone. You helped me a lot.
Reply
#10

good luck with your server tho.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)