SA-MP Forums Archive
Teleport cmd - 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)
+--- Thread: Teleport cmd (/showthread.php?tid=342669)



Teleport cmd - Spike Cena - 14.05.2012

Quick question:
when l create a map with MTA that is making "CreateObject".
I create the teleport cmd to go to that map but I dont know where to put that cmd in the GM.
Can someone help pls?


Re: Teleport cmd - [KHK]Khalid - 14.05.2012

https://sampwiki.blast.hk/wiki/OnPlayerCommandText


Re: Teleport cmd - thefatshizms - 14.05.2012

here is an example :

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 OnFilterScriptExit()
{
    return 1;
}
public OnPlayerConnect(playerid)
{
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/teleport", cmdtext, true, 10) == 0)
    {
        SetPlayerPos(playerid, changeme);
        return 1;
    }
    return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
    return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
    return 1;
}

public OnRconCommand(cmd[])
{
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    return 1;
}

public OnObjectMoved(objectid)
{
    return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
    return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
    return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
    return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
    return 1;
}

public OnPlayerExitedMenu(playerid)
{
    return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
    return 1;
}

public OnPlayerUpdate(playerid)
{
    return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
    return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
    return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
    return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    return 1;
}
change the "change me" to the co of ur map hope this helps


Re: Teleport cmd - Spike Cena - 14.05.2012

ty


Re: Teleport cmd - Faisal_khan - 14.05.2012

Quote:
Originally Posted by thefatshizms
Посмотреть сообщение
here is an example :

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/teleport", cmdtext, true, 10) == 0)
    {
        SetPlayerPos(playerid, changeme);
        return 1;
    }
    return 0;
}
change the "change me" to the co of ur map hope this helps
Yeah he is right. You can try to explain a bit more fatshizms. But good work. instead of changeme write the co-ordinates like x, y, z.


Re: Teleport cmd - thefatshizms - 14.05.2012

Quote:
Originally Posted by Faisal_khan
Посмотреть сообщение
Yeah he is right. You can try to explain a bit more fatshizms. But good work. instead of changeme write the co-ordinates like x, y, z.
yeh soz


Re: Teleport cmd - Spike Cena - 14.05.2012

Thanks it sure helped


Re: Teleport cmd - Spike Cena - 14.05.2012

#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/teleport", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid, changeme);
return 1;
}
return 0;
}
Is it souse to go like this?


Re: Teleport cmd - thefatshizms - 14.05.2012

Quote:
Originally Posted by Spike Cena
Посмотреть сообщение
#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/teleport", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid, changeme);
return 1;
}
return 0;
}
Is it souse to go like this?
btw use [ PAWN ] and [ /PAWN ] without spaces when posting code

u need to change the "changeme" to the x,y,z pos of ur map so i suggest u go ingame (ofc loading the map in the server first) then doing /save map go to your samp folder and saved positions which should be in your gta userfiles and get the x,y,z for e.g

say i have already done the save part i go to my saved positions and find the code which should look something like this:

AddStaticVehicle(555,-1773.7599,1205.3926,24.8102,358.0844,58,1); // map
note: THIS IS ONLY EXAMPLE !
the numbers i have made bold r the numbers which u have to replace the changeme with
(again this is example use r own saved pos or ur come to what ever pos i put here )


Re: Teleport cmd - Faisal_khan - 14.05.2012

Quote:
Originally Posted by Spike Cena
Посмотреть сообщение
pawn Код:
#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/teleport", cmdtext, true, 10) == 0)
    {
        SetPlayerPos(playerid, changeme);
        return 1;
    }
    return 0;
}
Is it souse to go like this?
Yeah it is supposed to be this way. Just follow thefatshizms way he will explain u with further problems.