SA-MP Forums Archive
/enter /exit help me to create it! - 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: /enter /exit help me to create it! (/showthread.php?tid=243241)



/enter /exit help me to create it! - leingod - 22.03.2011

how i can make /enter on every yellow down arrow except house..
then when to exit building /exit.. please show me how..


Re: /enter /exit help me to create it! - Ironboy - 22.03.2011

No need of making a enter and exit command.You just go and stand in the yellow arrow then you will be automatically enter the shop or whatever..


Re: /enter /exit help me to create it! - leingod - 22.03.2011

no.. i want with command.. i don't like just like that..
please did you know how ?


Re: /enter /exit help me to create it! - Ironboy - 22.03.2011

Like this you can script
pawn Код:
if(strcmp(cmd, "/enter", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsPlayerInRangeOfPoint(playerid,2.0, X,Y,Z)) // change X Y Z coords
            {
                SetPlayerPos(playerid, X, Y, Z); // change X Y Z coords
                SetPlayerInterior(playerid,INTERIOR HERe); //change the interior.
            }
            else
            {
                SendClientMessage(playerid, 0x33CCFFAA, "You need to be near the door to use this feature!");
            }
        }
        return 1;
    }
if(strcmp(cmd, "/exit", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsPlayerInRangeOfPoint(playerid,2.0, X,Y,Z))  // change X Y Z coords
            {
                SetPlayerPos(playerid, X, Y, Z); // change X Y Z coords
            }
            else
            {
                SendClientMessage(playerid, 0x33CCFFAA, "You need to be near the door to use this feature!");
            }
        }
        return 1;
    }
If you have any doubt in this? Just ask.


Re: /enter /exit help me to create it! - Pz - 22.03.2011

Quote:
Originally Posted by Ironboy
Посмотреть сообщение
Like this you can script
pawn Код:
if(strcmp(cmd, "/enter", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsPlayerInRangeOfPoint(playerid,2.0, X,Y,Z)) // change X Y Z coords
            {
                SetPlayerPos(playerid, X, Y, Z); // change X Y Z coords
                SetPlayerInterior(playerid,INTERIOR HERe); //change the interior.
            }
            else
            {
                SendClientMessage(playerid, 0x33CCFFAA, "You need to be near the door to use this feature!");
            }
        }
        return 1;
    }
if(strcmp(cmd, "/exit", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsPlayerInRangeOfPoint(playerid,2.0, X,Y,Z))  // change X Y Z coords
            {
                SetPlayerPos(playerid, X, Y, Z); // change X Y Z coords
            }
            else
            {
                SendClientMessage(playerid, 0x33CCFFAA, "You need to be near the door to use this feature!");
            }
        }
        return 1;
    }
If you have any doubt in this? Just ask.
Having lots of entries, and exits would make both of those commands really long. There are many other methods.


Re: /enter /exit help me to create it! - Ironboy - 22.03.2011

Yes there is a lots of methods too.And you teach him 1 method.........


Re: /enter /exit help me to create it! - leingod - 22.03.2011

where i put the script ongamemodeinit / onplayercomandtext ?


Re: /enter /exit help me to create it! - Stigg - 22.03.2011

Quote:
Originally Posted by leingod
Посмотреть сообщение
where i put the script ongamemodeinit / onplayercomandtext ?
Put it under:

Код:
public OnPlayerCommandText(playerid, cmdtext[])



Re: /enter /exit help me to create it! - leingod - 22.03.2011

well after i do what all you guys said.. then i compile this and have any errors..
please help
Код:
C:\Users\AS4732Z\Desktop\MY SAMP Server\bizantium server\filterscripts\enternexit.pwn(27) : error 017: undefined symbol "cmd"
C:\Users\AS4732Z\Desktop\MY SAMP Server\bizantium server\filterscripts\enternexit.pwn(43) : warning 209: function "OnPlayerCommandText" should return a value
C:\Users\AS4732Z\Desktop\MY SAMP Server\bizantium server\filterscripts\enternexit.pwn(43) : error 010: invalid function or declaration
C:\Users\AS4732Z\Desktop\MY SAMP Server\bizantium server\filterscripts\enternexit.pwn(45) : error 010: invalid function or declaration
C:\Users\AS4732Z\Desktop\MY SAMP Server\bizantium server\filterscripts\enternexit.pwn(47) : error 010: invalid function or declaration
C:\Users\AS4732Z\Desktop\MY SAMP Server\bizantium server\filterscripts\enternexit.pwn(51) : error 010: invalid function or declaration
C:\Users\AS4732Z\Desktop\MY SAMP Server\bizantium server\filterscripts\enternexit.pwn(56) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
what must i do ?


Re: /enter /exit help me to create it! - Stigg - 22.03.2011

Show us your code. Without it, we can't help.