SA-MP Forums Archive
How to script /v and /teles? - 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: How to script /v and /teles? (/showthread.php?tid=363665)



How to script /v and /teles? - SuNL1GhT - 28.07.2012

Hello guys, today, I just scripted teleports and something else.

I just meet a problem, that is, how to script /v and /teles?

Hope you can help, if who gave me the best answer, I'll give him a "+rep"


Re: How to script /v and /teles? - McCurdy - 28.07.2012

What command you want with /v and /teles

I don't know with /v but maybe /teles is show all command teleport command right?


Re: How to script /v and /teles? - SuNL1GhT - 28.07.2012

Quote:
Originally Posted by McCurdy
Посмотреть сообщение
What command you want with /v and /teles

I don't know with /v but maybe /teles is show all command teleport command right?
Yes, I want /v is like

[USAGE] /v [carname/carid]

and /teles is in dialog.


Re: How to script /v and /teles? - Cxnnor - 28.07.2012

AT THE TOP OF YOUR SCRIPT BELOW #INCLUDE <A_SAMP>:
pawn Код:
enum
{
    DIALOG_TELEPORT
}

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/tele", cmdtext, true, 10) == 0)
    {
        ShowPlayerDialog(playerid, DIALOG_TELEPORT, DIALOG_STYLE_LIST, "Teleport", " //Your teleports here (ls\nlv\nsf) etc.", "Option 1", "Option 2");
        return 1;
    }
    return 0;
}
And then this should help for OnDialogResponse: https://sampwiki.blast.hk/wiki/OnDialogResponse


Re: How to script /v and /teles? - kbalor - 28.07.2012

Here's the Vehicle for /v (carname)

http://pastebin.com/sKcFX3MA


Re: How to script /v and /teles? - SuNL1GhT - 28.07.2012

Well, I just tried to script /teles. This is my script

pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#define DIALOG_TELEPORT 1

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
    print("\n----------------------------------");
    print(" My server");
    print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("Full of fuck");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    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("/teles", cmdtext, true, 10) == 0)
    {
        ShowPlayerDialog(playerid, DIALOG_TELEPORT, DIALOG_STYLE_LIST, "Teleports", "Los Santos\nLos Santos Airport\nSan Fierro\nSan Fierro Airport\nLas Venturas\nLas Venturas Airport", "Select", "Select");
        return 1;
    }
   
    if (strcmp("/rules", cmdtext, true, 10) == 0)
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "____________Server Rules____________");
        SendClientMessage(playerid, 0xFFFFFFFF, "1. No spamming in the server.");
        SendClientMessage(playerid, 0xFFFFFFFF, "2. No flaming/hate speech/insulting in the server.");
        SendClientMessage(playerid, 0xFFFFFFFF, "3. No hacking in the server.");
        SendClientMessage(playerid, 0xFFFFFFFF, "4. Don't ask for admin position.");
        SendClientMessage(playerid, 0xFFFFFFFF, "5. No carjacking.");
    }
    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[])
{
    if (dialogid == DIALOG_TELEPORT)
    {
        if (response)
        {
            if(listitem == 0)
            {
                SetPlayerPos(playerid, 1126.5134,-2037.2488,69.8835);
                SetPlayerInterior(playerid, 0);
                SendClientMessage(playerid, 0xFFFF3333, "Welcome to Los Santos. Enjoy yourself here.");
            }
            if(listitem == 1)
            {
                SetPlayerPos(playerid, 1961.7916,-2190.1570,13.5469);
                SetPlayerInterior(playerid, 0);
                SendClientMessage(playerid, 0xFFFF3333, "Welcome to Los Santos Airport. Enjoy yourself here.");
            }
            if(listitem == 2)
            {
                SetPlayerPos(playerid, -2624.2061,1407.9656,7.1016);
                SetPlayerInterior(playerid, 0);
                SendClientMessage(playerid, 0xFFFF3333, "Welcome to San Fierro. Enjoy yourself here.");
            }
            if(listitem == 3)
            {
                SetPlayerPos(playerid, -1158.0082,32.9491,14.1484);
                SetPlayerInterior(playerid, 0);
                SendClientMessage(playerid, 0xFFFF3333, "Welcome to San Fierro Airport. Enjoy yourself here.");
            }
            if(listitem == 4)
            {
                SetPlayerPos(playerid, 2002.6938,1544.3606,13.5859);
                SetPlayerInterior(playerid, 0);
                SendClientMessage(playerid, 0xFFFF3333, "Welcome to Las Venturas. Enjoy yourself here.");
            }
            if(listitem == 5)
            {
                SetPlayerPos(playerid, 1319.0251,1250.5656,10.8203);
                SetPlayerInterior(playerid, 0);
                SendClientMessage(playerid, 0xFFFF3333, "Welcome to Las Venturas Airport. Enjoy yourself here.");
            }
        }
        return 1;
    }
    return 0;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    return 1;
}
When I clicked one of the list, they didn't respond. :<


And thanks for the /v, I'll try it later. (It doesn't work)