how to make my teleport command work
#1

Im working on a teleport command and i really need help!

command so far

Код:
// teleport v 1.2
#define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" TELEPORT Version 1.2 - Made by JonnyBoy");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" TELEPORT V 1.2 - By JonnyBoy");
	print("----------------------------------\n");
}

#endif

if(!strcmp(cmdtext,"/sf",true)) {
    SetPlayerPos(playerid, -1448,325, -325,1149, 15);
    SetPlayerAngle(playerid, 0);
    return 1;
}
if(!strcmp(cmdtext,"/lv",true)) {
    SetPlayerPos(playerid, 1677,544, 1426,837, 15);
    SetPlayerAngle(playerid, 0);
    return 1;
}
if(!strcmp(cmdtext,"/ls",true)) {
    SetPlayerPos(playerid, 1546,908, -2313,5, 15);
    SetPlayerAngle(playerid, 0);
    return 1;
}
ERROR Problem

Код:
D:\Rockstar Games\GTA San Andreas MP Server\filterscripts\tele.pwn(32) : error 010: invalid function or declaration
D:\Rockstar Games\GTA San Andreas MP Server\filterscripts\tele.pwn(35) : error 010: invalid function or declaration
D:\Rockstar Games\GTA San Andreas MP Server\filterscripts\tele.pwn(37) : error 010: invalid function or declaration
D:\Rockstar Games\GTA San Andreas MP Server\filterscripts\tele.pwn(40) : error 010: invalid function or declaration
D:\Rockstar Games\GTA San Andreas MP Server\filterscripts\tele.pwn(42) : error 010: invalid function or declaration
D:\Rockstar Games\GTA San Andreas MP Server\filterscripts\tele.pwn(45) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
CREDITS

JonnyBoy - Idea, Commands

-Waiting help-
Reply
#2

Put them under OnPlayerCommandText.
Reply
#3

new OnPlayerCommandText?

or something like that?
Reply
#4

Quote:
Originally Posted by jonnyboy
Посмотреть сообщение
new OnPlayerCommandText?

or something like that?
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
Or if it doesn't know what it is make a forward.

pawn Код:
forward OnPlayerCommandText(playerid, cmdtext[]);
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
Reply
#5

Quote:
Originally Posted by jonnyboy
Посмотреть сообщение
new OnPlayerCommandText?

or something like that?
pawn Код:
// teleport v 1.2
#define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" TELEPORT Version 1.2 - Made by JonnyBoy");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
    print("\n----------------------------------");
    print(" TELEPORT V 1.2 - By JonnyBoy");
    print("----------------------------------\n");
}

#endif

public OnPlayerCommandText(playerid,cmdtext[])
{
    if(!strcmp(cmdtext,"/sf",true)) {
        SetPlayerPos(playerid, -1448,325, -325,1149, 15);
        SetPlayerAngle(playerid, 0);
        return 1;
    }
    if(!strcmp(cmdtext,"/lv",true)) {
        SetPlayerPos(playerid, 1677,544, 1426,837, 15);
        SetPlayerAngle(playerid, 0);
        return 1;
    }
    if(!strcmp(cmdtext,"/ls",true)) {
        SetPlayerPos(playerid, 1546,908, -2313,5, 15);
        SetPlayerAngle(playerid, 0);
        return 1;
    }
        return 0;
}
Reply
#6

pawn Код:
// teleport v 1.2
#define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" TELEPORT Version 1.2 - Made by JonnyBoy");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
    print("\n----------------------------------");
    print(" TELEPORT V 1.2 - By JonnyBoy");
    print("----------------------------------\n");
}

#endif

forward OnPlayerCommandText(playerid, cmdtext[]);
public OnPlayerCommandText(playerid,cmdtext[])
{
    if(!strcmp(cmdtext,"/sf",true)) {
        SetPlayerPos(playerid, -1448,325, -325,1149, 15);
        SetPlayerAngle(playerid, 0);
        return 1;
    }
    if(!strcmp(cmdtext,"/lv",true)) {
        SetPlayerPos(playerid, 1677,544, 1426,837, 15);
        SetPlayerAngle(playerid, 0);
        return 1;
    }
    if(!strcmp(cmdtext,"/ls",true)) {
        SetPlayerPos(playerid, 1546,908, -2313,5, 15);
        SetPlayerAngle(playerid, 0);
        return 1;
    }
        return 0;
}
ERROR:

Код:
D:\Rockstar Games\GTA San Andreas MP Server\filterscripts\tele.pwn(36) : warning 202: number of arguments does not match definition
D:\Rockstar Games\GTA San Andreas MP Server\filterscripts\tele.pwn(36) : warning 202: number of arguments does not match definition
D:\Rockstar Games\GTA San Andreas MP Server\filterscripts\tele.pwn(37) : error 017: undefined symbol "SetPlayerAngle"
D:\Rockstar Games\GTA San Andreas MP Server\filterscripts\tele.pwn(41) : warning 202: number of arguments does not match definition
D:\Rockstar Games\GTA San Andreas MP Server\filterscripts\tele.pwn(41) : warning 202: number of arguments does not match definition
D:\Rockstar Games\GTA San Andreas MP Server\filterscripts\tele.pwn(42) : error 017: undefined symbol "SetPlayerAngle"
D:\Rockstar Games\GTA San Andreas MP Server\filterscripts\tele.pwn(46) : warning 202: number of arguments does not match definition
D:\Rockstar Games\GTA San Andreas MP Server\filterscripts\tele.pwn(46) : warning 202: number of arguments does not match definition
D:\Rockstar Games\GTA San Andreas MP Server\filterscripts\tele.pwn(47) : error 017: undefined symbol "SetPlayerAngle"
D:\Rockstar Games\GTA San Andreas MP Server\filterscripts\tele.pwn(50) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Reply
#7

Use a dot (.) for floating point numbers, not a comma. Commas seperate arguments.
Second, it is SetPlayerFacingAngle, not SetPlayerAngle.
Reply
#8

Quote:
Originally Posted by Vince
Посмотреть сообщение
Use a dot (.) for floating point numbers, not a comma. Commas seperate arguments.
Second, it is SetPlayerFacingAngle, not SetPlayerAngle.
Where should i put the (.)? and what floating point numbers
Reply
#9

Quote:
Originally Posted by jonnyboy
Посмотреть сообщение
Where should i put the (.)? and what floating point numbers
A tip: DO NOT call a script that you didn't make yours.

(If you made this you would have known what you were doing, and what the different code is, atleast know what Float was).
Reply
#10

Код:
public OnPlayerCommandText(playerid,cmdtext[])
{    
if(!strcmp(cmdtext,"/sf",true)) 
{        
SetPlayerPos(playerid, -1448.325, -325.1149, 15);        
SetPlayerAngle(playerid, 0);        
return 1;    
}    
if(!strcmp(cmdtext,"/lv",true)) 
{        
SetPlayerPos(playerid, 1677.544, 1426.837, 15);        
SetPlayerAngle(playerid, 0);       
return 1;    
}    
if(!strcmp(cmdtext,"/ls",true)) 
{       
SetPlayerPos(playerid, 1546.908, -2313.5, 15);       
SetPlayerAngle(playerid, 0);        
return 1;   
}        
return 0;
}
Copy and pastte and done
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)