Lets talk about loading files...
#1

Ok i'm done to roleplay admin system problem now i need another help
well the code is working but the loading source energy (which is the file that will load)
is making my gamemode have errors

Код:
D:\GTA San Andreas\RP Test Server\gamemodes\XR.pwn(564) : error 017: undefined symbol "playerid"
D:\GTA San Andreas\RP Test Server\gamemodes\XR.pwn(566) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
its my first time using such as a loading files using an include <file> not the fastest loading file ever.

inside the text file (name of textfile MapIcon)

Код:
/*
----------------------
|                    |
|   Xtreme Roleplay  |
|  Mapicon Loadfiles |
|   Important File!  |
|                    |
----------------------

*/

/* Datas are now loading */

#include <a_samp>

public OnPlayerConnect(playerid)
{
    SetPlayerMapIcon(playerid,1,1752.8557,-1903.0541,13.5631,55,1,MAPICON_LOCAL);
    return 1;
}
here is the problem i don't know what to do because the part

Код:
OnPlayerConnect(playerid) <<< the playerid - Gives me error
Please help me guys
Reply
#2

i forgot

Код:
Files()
{
	new File:txt = fopen("Server/Logs/Mapicons.txt", io_read);
    new string[256];
    while(fread(txt, string))
    {
		 GameTextForPlayer(playerid, "~w~Files are loading from data please wait...", 2000, 4);
		 LoadingFiles = SetTimer("Loadingfiles", 5000, true);
		 TogglePlayerControllable(playerid, 0);
    }
}
Код:
- This is on gamemode not in text file -
public OnPlayerConnect(playerid)
{
     Files();
     return 1;
}
Reply
#3

pawn Код:
Files(playerid)
{
    new File:txt = fopen("Server/Logs/Mapicons.txt", io_read);
    new string[256];
    while(fread(txt, string))
    {
         GameTextForPlayer(playerid, "~w~Files are loading from data please wait...", 2000, 4);
         LoadingFiles = SetTimer("Loadingfiles", 5000, true);
         TogglePlayerControllable(playerid, 0);
    }
}
pawn Код:
public OnPlayerConnect(playerid)
{
     Files(playerid);
     return 1;
}
Reply
#4

oh i see bro thanks (+rep+)
Reply
#5

lol now the problem is when i put Files(playerid); in every callbacks samp-server.exe close
know where to put it somewhere i try it on OnPlayerSpawn it crash my samp-server.exe too
Reply
#6

Mind showing us your server log inside a [code][./code] tags
Reply
#7

Код:
----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3d-R2, ©2005-2011 SA-MP Team

[20:49:04] filterscripts = ""  (string)
[20:49:04] 
[20:49:04] Server Plugins
[20:49:04] --------------
[20:49:04]  Loading plugin: streamer
[20:49:05] 

*** Streamer Plugin v2.5.2 by Incognito loaded ***

[20:49:05]   Loaded.
[20:49:05]  Loading plugin: sscanf
[20:49:05] 

[20:49:05]  ===============================

[20:49:05]       sscanf plugin loaded.     

[20:49:05]    © 2009 Alex "******" Cole

[20:49:05]  ===============================

[20:49:05]   Loaded.
[20:49:05]  Loading plugin: Whirlpool
[20:49:05]  
[20:49:05]  ==================
[20:49:05]  
[20:49:05]   Whirlpool loaded
[20:49:05]  
[20:49:05]  ==================
[20:49:05]  
[20:49:05]   Loaded.
[20:49:05]  Loaded 3 plugins.

[20:49:05] 
[20:49:05] Filterscripts
[20:49:05] ---------------
[20:49:05]   Loaded 0 filterscripts.

[20:49:05]       -------------------------------------
[20:49:05]       |        Xtreme Roleplay V1.0       |
[20:49:05]       |     Made by WP/TSU Management     |
[20:49:05]       |   with GAMER_PS2/[SP]Mr.Kakashi   |
[20:49:05]       |        Server Running 0.3d        |
[20:49:05]       |     Greetings by SAMP RP Teams    |
[20:49:05]       -------------------------------------

[20:49:05] Server Loading...
[20:49:05] Number of vehicle models: 0
[20:49:24] Incoming connection: 192.168.1.100:2056
[20:49:24] [join] Justine_Ramos has joined the server (0:192.168.1.100)
[20:49:24] [nick] Justine_Ramos nick changed to New_Name
[20:49:24] [nick] New_Name nick changed to Justine_Ramos
//>>>Then the crash begins here after i spawn lol <<<//
Reply
#8

Now your OnPlayerSpawn callback?
Reply
#9

What are you actually trying to achieve? You can't load pure Pawn code on runtime. You can do this:

pawn Код:
public OnPlayerConnect(playerid)
{
     #include "Server/Logs/MapIcons.txt"
     return 1;
}
and in your text file:

pawn Код:
SetPlayerMapIcon(playerid,1,1752.8557,-1903.0541,13.5631,55,1,MAPICON_LOCAL);
Reply
#10

pawn Код:
//top of script
new bool:LoadingFile[MAX_PLAYERS];

public OnPlayerSpawn(playerid)
{
    if(!LoadingFile[playerid])
    {
        Files(playerid); //Loading the Roleplay Datafiles from Server/Logs/
        LoadingFile[playerid] = true;
    }
    SetPlayerPos(playerid,1722.897705, -1881.476196, 13.564631);
    SetPlayerFacingAngle(playerid,358.715026);
    return 1;
}
i made the bool because when player spawn the files will load every spawn
i need to log out give the answer because my parents are so angry so fucking bitch!

bye
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)