SA-MP Forums Archive
[SOLVED] Teleporting... - 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: [SOLVED] Teleporting... (/showthread.php?tid=127901)



[SOLVED] Teleporting... - yoan103 - 15.02.2010

Hi guys i have this script
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/test", cmdtext, true, 10) == 0)
	{
	if (IsPlayerInAnyVehicle(playerid)) {
	SetVehiclePos(GetPlayerVehicleID(playerid), 1234.16978, 1252.26287, 6126.62168);
	}
	else {
	SetPlayerPos(playerid, 1234.16978, 1252.26287, 6126.62168);
	}
}
Oh sorry i meant that it teleports me but it sends me out SERVER: Unknown Command


Re: Teleporting... - dice7 - 15.02.2010

It should work. There's something else wrong


Re: Teleporting... - smeti - 15.02.2010

pawn Код:
return 1;
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/test", cmdtext, true, 10) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            SetVehiclePos(GetPlayerVehicleID(playerid), 1234.16978, 1252.26287, 6126.62168);
        } else {
            SetPlayerPos(playerid, 1234.16978, 1252.26287, 6126.62168);
        }
        return 1; // end
    }
    return 0;
}



Re: Teleporting... - Fedee! - 15.02.2010

Try this:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/test", cmdtext, true, 10) == 0)

    {
        if (IsPlayerInAnyVehicle(playerid))
        {
            SetVehiclePos(GetPlayerVehicleID(playerid), 1234.16978, 1252.26287, 6126.62168);

        }
        else
        {
            SetPlayerPos(playerid, 1234.16978, 1252.26287, 6126.62168);

        }
    }
    return 1;
}
EDIT: Aww you won me xD


Re: Teleporting... - BlackFoX - 15.02.2010

Код:
if(!strcmp(cmdtext,"/test",true))
{
	if(!IsPlayerInAnyVehicle(playerid))return SetPlayerPos(...);
	else return SetVehiclePos(GetPlayerVehicleID(playerid),...);
}