I'm going crazy.
#1

Can anybody help me with this?
I want to make an teleporter.
This is my script so far the 1 i am makin for the last 5 hours.

// This is a comment
// uncomment the line below if you want to write a filterscript

#include <a_samp>
#include <float>
#define FILTERSCRIPT
#if defined FILTERSCRIPT

#define DIALOG_TELEPORT 1
public OnFilterScriptInit()
{
CreatePickup (1239, 1,1816.2341, -1309.1089, 114.7674,0); //PenthouseTeleport
return 1;
}

public OnFilterScriptExit()
{

}
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
#define DIALOG_ID (874)
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new Float, Float:y, Float:z;//25
if(PRESSED(KEY_SPRINT))
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid, 1816.2341, -1309.1089, 114.7674))//30
{
SafeSetPlayerPos(playerid, Float, Float:y, Float:z)
}//32
}
}
return 1;
}



#endif

These are the warnings/error

(30) : warning 202: number of arguments does not match definition
(32) : error 017: undefined symbol "SafeSetPlayerPos"
(25) : warning 203: symbol is never used: "z"
(25) : warning 203: symbol is never used: "y"
(25) : warning 203: symbol is never used: "x"

1 Error.
Reply
#2

Okay what you have above is just weird lol.

Try
pawn Код:
new tele;

public OnGameModeInit()
{
    tele = CreatePickup (1239, 1,1816.2341, -1309.1089, 114.7674,0);
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == tele)
    {
        SafeSetPlayerPos(playerid, x,y,z); // change the x y z to your coordinates.
    }
    return 1;
}
Reply
#3

I want to make an menu.
When i press enter i get a menu.
Reply
#4

pawn Код:
#define PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
#define DIALOG_TELEPORT 1

// Without the pickup if you are just near the 1816.2341, -1309.1089, 114.7674 coordinates press enter the dialog should appear! *not tested should work though*

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(PRESSED(KEY_SECONDARY_ATTACK))
    {
        if(IsPlayerInRangeOfPoint(playerid,5.0/*Change it to your radius*/,1816.2341, -1309.1089, 114.7674))
        {
            ShowPlayerDialog(playerid,DIALOG_TELEPORT,DIALOG_STYLE_MSGBOX/*Not sure what style you wanted*/,"Teleport","Do you want to teleport?","Yes","No");
        }
    }
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case DIALOG_TELEPORT:
        {
            if(response)
            {
                SetPlayerPos(playerid,x,y,z); // your x y z:)
            }
        }
    }
    return 1;
}
Reply
#5

This doesnt work.

My pawn code :test.pwn

p.s the menu i want is a list.
1. go ....
2. go....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)