SA-MP Forums Archive
/pass cmd setting player position - 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: /pass cmd setting player position (/showthread.php?tid=245052)



/pass cmd setting player position - Jack- - 29.03.2011

How do i make this work ? also how do i get it to say "%playername% has passed through the door".
Also it says unknown command when i do it ig but it still puts me in the position when i had it working.

pawn Код:
#define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
if(IsPlayerInRangeOfPoint(playerid, 3.0, 1060.0122,1310.9846,10.8203,95.8134))
if(!strcmp(cmdtext, "/pass", true))
{
       SetPlayerPos(playerid,1055.8455,1310.4878,10.8961,268.9397);
}
if(IsPlayerInRangeOfPoint(playerid, 3.0,1055.8455,1310.4878,10.8961,268.9397))
if(!strcmp(cmdtext, "/pass", true))
{
       SetPlayerPos(playerid,1060.0122,1310.9846,10.8203,95.8134);
}


public OnFilterScriptExit()
{
    return 1;
}

#endif



Re: /pass cmd setting player position - antonio112 - 29.03.2011

pawn Код:
#define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
        new Name[MAX_PLAYER_NAME], String[ 80 ];
        GetPlayerName(playerid, Name, sizeof(Name));
     
if(!strcmp(cmdtext, "/pass", true))
{
       if(IsPlayerInRangeOfPoint(playerid, 3.0, 1060.0122,1310.9846,10.8203,95.8134))
       {
             SetPlayerPos(playerid,1055.8455,1310.4878,10.8961,268.9397);
             format( String, sizeof String, "Player %s has passed through the door.", Name);
             SendClientMessageToAll( -1, String);
       }
}
if(!strcmp(cmdtext, "/pass", true))
{
       if(IsPlayerInRangeOfPoint(playerid, 3.0,1055.8455,1310.4878,10.8961,268.9397))
       {
              SetPlayerPos(playerid,1060.0122,1310.9846,10.8203,95.8134);
              format( String, sizeof String, "Player %s has passed through the door.", Name);
              SendClientMessageToAll( -1, String);
       }
}
You check if player is in position, after he entered the specific command.