AllowAdminTeleport() : function is deprecated. Please see OnPlayerClickMap()
#1

Well, it's mysql gamemode, Roleplay gamemode.
When I type ingame CMD's it says: sscanf error: System not initialised.
It says that when I type some admin CMD's.
And when I start the gamemode it says:

Quote:

[14:54:47] foreach called
[14:54:47] *** Audio Plugin: Started TCP server on port 7777
[14:54:47] *** Audio_SetPack: Audio pack set to "default_pack" (transferable and automated)
[14:54:47] MySQL: Connected (0) to root @ localhost via TCP/IP. MySQL version 5.5.27.
[14:54:47] AllowAdminTeleport() : function is deprecated. Please see OnPlayerClickMap()
[14:54:47] Job Positions have been loaded
[14:54:47] 400 Houses loaded from database
[14:54:47] 50 Garages loaded from database
[14:54:47] 9 Buildings loaded from database
[14:54:47] 50 Businesses loaded from database
[14:54:47] 11 Factions loaded from database
[14:54:47] -----------------------------------------------
[14:54:47] Gamemoder done by with help from Hollywood & Draak
[14:54:47] ! SCRIPT LOADED SCRIPT LOADED SCRIPT LOADED SCRIPT LOADED !
[14:54:47] -----------------------------------------------
[14:54:47] Number of vehicle models: 32

I deleted AllowAdminTeleport function from all includes, because when I start the server it says;
AllowAdminTeleport() : function is deprecated. Please see OnPlayerClickMap()
And when I compiled the gamemode it said some error on C:\Users\user\Desktop\linux\pawno\include\gamemode \Publics\OnGameModeInit
I tried to compile OnGameModeInit without AllowAdminTeleport function, and without OnPlayerClickMap.
And I get those errors:
Quote:

C:\Users\user\Desktop\linux\pawno\include\gamemode \Publics\OnGameModeInit.pwn(1) : warning 235: public function lacks forward declaration (symbol "OnGameModeInit")
C:\Users\user\Desktop\linux\pawno\include\gamemode \Publics\OnGameModeInit.pwn(3) : error 017: undefined symbol "Streamer_TickRate"
C:\Users\user\Desktop\linux\pawno\include\gamemode \Publics\OnGameModeInit.pwn(4) : error 017: undefined symbol "Streamer_CellDistance"
C:\Users\user\Desktop\linux\pawno\include\gamemode \Publics\OnGameModeInit.pwn(5) : warning 217: loose indentation
C:\Users\user\Desktop\linux\pawno\include\gamemode \Publics\OnGameModeInit.pwn(5) : error 017: undefined symbol "Audio_CreateTCPServer"
C:\Users\user\Desktop\linux\pawno\include\gamemode \Publics\OnGameModeInit.pwn(6) : error 017: undefined symbol "Audio_SetPack"
C:\Users\user\Desktop\linux\pawno\include\gamemode \Publics\OnGameModeInit.pwn(7) : warning 217: loose indentation
C:\Users\user\Desktop\linux\pawno\include\gamemode \Publics\OnGameModeInit.pwn( : error 017: undefined symbol "GetServerVarAsString"
C:\Users\user\Desktop\linux\pawno\include\gamemode \Publics\OnGameModeInit.pwn( : warning 202: number of arguments does not match definition
C:\Users\user\Desktop\linux\pawno\include\gamemode \Publics\OnGameModeInit.pwn(9) : error 017: undefined symbol "mysql_connect"
C:\Users\user\Desktop\linux\pawno\include\gamemode \Publics\OnGameModeInit.pwn(10) : warning 217: loose indentation
C:\Users\user\Desktop\linux\pawno\include\gamemode \Publics\OnGameModeInit.pwn(10) : error 017: undefined symbol "fexist"
C:\Users\user\Desktop\linux\pawno\include\gamemode \Publics\OnGameModeInit.pwn(12) : error 017: undefined symbol "JoinCounter"
C:\Users\user\Desktop\linux\pawno\include\gamemode \Publics\OnGameModeInit.pwn(12) : error 017: undefined symbol "dini_Int"
C:\Users\user\Desktop\linux\pawno\include\gamemode \Publics\OnGameModeInit.pwn(14) : error 017: undefined symbol "dini_Create"
C:\Users\user\Desktop\linux\pawno\include\gamemode \Publics\OnGameModeInit.pwn(15) : error 017: undefined symbol "dini_IntSet"
C:\Users\user\Desktop\linux\pawno\include\gamemode \Publics\OnGameModeInit.pwn(1 : error 017: undefined symbol "MAX_VEHICLES"
C:\Users\user\Desktop\linux\pawno\include\gamemode \Publics\OnGameModeInit.pwn(20) : error 017: undefined symbol "Fuel"
C:\Users\user\Desktop\linux\pawno\include\gamemode \Publics\OnGameModeInit.pwn(20) : warning 215: expression has no effect
C:\Users\user\Desktop\linux\pawno\include\gamemode \Publics\OnGameModeInit.pwn(20) : error 001: expected token: ";", but found "]"
C:\Users\user\Desktop\linux\pawno\include\gamemode \Publics\OnGameModeInit.pwn(20) : error 029: invalid expression, assumed zero
C:\Users\user\Desktop\linux\pawno\include\gamemode \Publics\OnGameModeInit.pwn(20) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


16 Errors.

Please help me, thanks.
Reply
#2

pawn Код:
public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ) {
    if (IsPlayerAdmin(playerid)) {
        SetPlayerPosFindZ(playerid, fX, fY, fZ);
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by Djole1337
Посмотреть сообщение
pawn Код:
public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ) {
    if (IsPlayerAdmin(playerid)) {
        SetPlayerPosFindZ(playerid, fX, fY, fZ);
    }
    return 1;
}
Thanks, where to put that?
And when I type /gotols, or any admin teleport CMD it says:

sscanf error: System not initialisied.
I'm sure it's because those errors in the OnGameModeInit.
Reply
#4

That gamemode is probably outdated. Sscanf has been updated and you need to include the latest version, plus update the mode. The function you mentioned before was removed "AllowAdminTeleport" and you can use the callback a user posted above. It does the same thing.

From what I see from the errors, you have removed the first lines with the includes/defines. And in line 1 is the OnGameModeInit callback. Include a_samp.inc, Dini.inc and a_mysql.inc
Reply
#5

Quote:
Originally Posted by _Zeus
Посмотреть сообщение
That gamemode is probably outdated. Sscanf has been updated and you need to include the latest version, plus update the mode. The function you mentioned before was removed "AllowAdminTeleport" and you can use the callback a user posted above. It does the same thing.

From what I see from the errors, you have removed the first lines with the includes/defines. And in line 1 is the OnGameModeInit callback. Include a_samp.inc, Dini.inc and a_mysql.inc
But it doesn't let me to compile OnGameModeInit.
And I got sscanf2.
Reply
#6

If you look better to the code, you will see that the first error is from line 1. That means the OnGameModeInit callback is in that line and you miss:
pawn Код:
#include <a_samp>
#include <a_mysql>
#include <dini>
// #include Audio file? If it has.
#include <sscanf2>

new
    Fuel
;

main() {}

public OnGameModeInit()
// rest..
Reply
#7

Quote:
Originally Posted by _Zeus
Посмотреть сообщение
If you look better to the code, you will see that the first error is from line 1. That means the OnGameModeInit callback is in that line and you miss:
pawn Код:
#include <a_samp>
#include <a_mysql>
#include <dini>
// #include Audio file? If it has.
#include <sscanf2>

new
    Fuel
;

main() {}

public OnGameModeInit()
// rest..
But the OnGameModeInit starts like this:
It's a new PWN file.

Quote:

public OnGameModeInit()
{
Streamer_TickRate(150);
Streamer_CellDistance(300);
Audio_CreateTCPServer(7777);
Audio_SetPack("default_pack", true);
new ip[ 32 ];
GetServerVarAsString( "bind", ip, sizeof( ip ) );
mysql_connect( HOST_ADDR, HOST_USER, HOST_PASS, HOST_DATA );
if(fexist("IBP/Other/JoinCounter.cfg"))
{
JoinCounter = dini_Int("IBP/Other/JoinCounter.cfg", "Connections");
} else {
dini_Create("IBP/Other/JoinCounter.cfg");
dini_IntSet("IBP/Other/JoinCounter.cfg", "Connections", 0);
}
//================================================== ========================
for(new c=0;c<MAX_VEHICLES;c++)
{
Fuel[c] = 100;
VehicleLightsOn[c] = false;
}
//================================================== ========================
for(new i = 0; i < MAX_PLAYERS; i++) { ShowHud[i] = 1; }
new query[1328];
format(query, sizeof(query), "UPDATE Accounts SET CarKey = '0'");
mysql_query(query);
format(query, sizeof(query), "UPDATE Accounts SET WeedTimer = '0'");
mysql_query(query);
format(query, sizeof(query), "UPDATE Accounts SET On‌line = '0'");
mysql_query(query);
//================================================== ========================

Reply
#8

That's what he said. You're missing the includes! Copy the piece of code he provided above and paste it in top of your script.
Reply
#9

My bad, I think I don't have to compile it, just to save it.
Because the main gamemode loads those PWN files.
Reply
#10

No, you don't.

If you use separated files, you need to include them like:
pawn Код:
#include "somename.pwn"
But why do you prefer to use a file for each callback? I mean, if you want to host your server then you will need to upload all these files, when you can just upload the .amx file and keep everything in a gamemode (1 file).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)