Admin Only Teleport HELP
#1

I need a teleport to teleport a admin only to a place like i have the x,y,z whatever i just need the script like i want its command to be /gotoim meaning goto impound i did /save ingame and it gave me this 283,2499.3477,2773.0620,10.8203,77.6898,0,0,0,0,0, 0 so now i need a script for me to add this and also if you could just leave the command clear so i can change the command into what ever i want
Reply
#2

use

pawn Код:
SetPlayerPos( playerid, Coordinates here);
Reply
#3

how do i add the command i just started scripting so i kinda dont know
Reply
#4

Quote:
Originally Posted by djlolypop
Посмотреть сообщение
how do i add the command i just started scripting so i kinda dont know
what command processor are you using?
Reply
#5

My position saving system looks like this, just for you to see how it might look when it's finished:
pawn Код:
dcmd_spos(playerid, params[])
{
    new posName[50];
    if(sscanf(params, "s", posName))return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /spos [Position Name]");

    new filenameP[32+MAX_PLAYER_NAME], PlaName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, PlaName, sizeof(PlaName));

    new pCount=0;
    do
    {
        #if defined UseGreenAACFolders
        format(filenameP, sizeof(filenameP), "GreenAAC/Positions/%s.pos%i.ini", PlaName, pCount);
        #else
        format(filenameP, sizeof(filenameP), "%s.pos%i.ini", PlaName, pCount);
        #endif
        pCount++;
    }
    while(pCount<=9&&fexist(filenameP));
   
    if(pCount==10)
    {
        SendClientMessage(playerid, COLOR_ORANGE, "All spaces in use!");
        SendClientMessage(playerid, COLOR_ORANGE,"Use \"/lpos\" to get all positions listed. Use \"/dpos [key]\" to delete a position.");
        return 1;
    }

    dini_Create(filenameP);
    new Float:pX, Float:pY, Float:pZ;
    GetPlayerPos(playerid, pX, pY, pZ);
   
    dini_Set(filenameP, "PosName", posName);
   
    dini_FloatSet(filenameP,"SavedX", pX);
    dini_FloatSet(filenameP,"SavedY", pY);
    dini_FloatSet(filenameP,"SavedZ", pZ);
    new fMes[128];
    format(fMes, sizeof(fMes), "You successfully saved your position. It has the key \"%i\"! Remember it!", pCount);
    SendClientMessage(playerid, COLOR_ORANGE, fMes);
    SendClientMessage(playerid, COLOR_ORANGE, "Use \"/gpos [key]\" to go there. Use \"/dpos [key]\" to delete a position.");
    return 1;
}
And to teleport to the place:

pawn Код:
dcmd_gpos(playerid, params[])
{
    new poskey;
    new pName[MAX_PLAYER_NAME];
    new filepath[32+MAX_PLAYER_NAME];
   
    GetPlayerName(playerid, pName, sizeof(pName));

    if(sscanf(params, "i", poskey))return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gpos [key]");
    #if defined UseGreenAACFolders
    format(filepath, 20+sizeof(pName), "GreenAAC/Positions/%s.pos%i.ini", pName, poskey);
    #else
    format(filepath, 20+sizeof(pName), "%s.pos%i.ini", pName, poskey);
    #endif
    if(!fexist(filepath))return SendClientMessage(playerid, COLOR_WHITE, "[ERROR]The key you entered isn't in use!");

    else
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            SetVehiclePos(GetPlayerVehicleID(playerid), dini_Float(filepath, "SavedX"), dini_Float(filepath, "SavedY"), dini_Float(filepath, "SavedZ"));
        }
       
        else SetPlayerPos(playerid, dini_Float(filepath, "SavedX"),  dini_Float(filepath, "SavedY"), dini_Float(filepath, "SavedZ"));
       
        new stringy[50];
        format(stringy, sizeof(stringy), "You went to \"%s\"(Key: %i).",dini_Get(filepath, "PosName"), poskey);
        SendClientMessage(playerid, COLOR_ORANGE, stringy);
    }
    return 1;
}
Sorry, but i don't want to transform my whole code for you, the rest you need to do by yourself. I hope this helped you a bit.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)