Need help with script.. [code on using /enter]
#1

Hello, I was scripting a place today, but I am having a little trouble, would anyone be able to tell me how I can make an /enter command so that if the player types it when he is not at the " I " icon that he cannot enter, where as if he was, he can enter?

//CODE

Код:
 	if(!strcmp("/Enter", cmdtext, true))
		{
	GameTextForPlayer(playerid, "~g~Welcome to Alhambra!",3500,5);
	SetPlayerInterior(playerid, 17);
	SetPlayerPos(playerid,493.5872,-22.6800,1000.6797);
	CreatePickup(1239,1, -1921.4227,564.1207,35.2072);
	return 1;
		}
Thanks in advance.
Reply
#2

What "I" Icon? Something on the map? If that icon is something that you're created, then show it.
Reply
#3

There probably is a better way to do this through PayerToPoint but since you want to use the icon this should probably work:

pawn Код:
if(!strcmp("/Enter", cmdtext, true))
{
    new float:X, float:Y, float:Z;
    GetPlayerPos(playerid,X,Y,Z)
    if(X=-1921.4227 && Y=564.1207 && Z=35.2072)
    {
        GameTextForPlayer(playerid, "~g~Welcome to Alhambra!",3500,5);
        SetPlayerInterior(playerid, 17);
        SetPlayerPos(playerid,493.5872,-22.6800,1000.6797);
    }
    return 1;
}
IMPORTANT: put "CreatePickup(1239,1, -1921.4227,564.1207,35.2072);" under OnGamemodeInit not in the teleport itself.

you can also add an "else" error statement (i.e. SendClientMessage(playerid,COLOR,"You Are Not At The Marker!");
Reply
#4

Quote:
Originally Posted by cοοp
What "I" Icon? Something on the map? If that icon is something that you're created, then show it.
He meant the pick-up
Quote:

CreatePickup(1239,1, -1921.4227,564.1207,35.2072);

Reply
#5

I guess that he meant "1" instead of "I". But whatever, now you've done it.
Reply
#6

Sorry, if you guys are unclear by what I mean, I meant the information icon.
Reply
#7

Quote:
Originally Posted by Hiitch
Sorry, if you guys are unclear by what I mean, I meant the information icon.
yeah that is what I thought it was. BTW does it work?
Reply
#8

the way that it works is, when the player steps on it, he / she needs to type /enter to go to alhambra (interior 17). but when they type /enter, it doesnt matter where they are, they enter it anyways.
Reply
#9

and my bad, yeah it does work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)