Serious problem about my gamemode
#1

Hello,today i was trying to test my gamemode on a 4 slots volt-host server,but there is a problem.

The player can connect,but when it spawns,the server stops to run.

This is OnPlayerSpawn:

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(PlayerInfo[playerid][pVip] == 1) SetPlayerArmour(playerid, 90);
    if(PlayerInfo[playerid][pVip] == 1) Attach3DTextLabelToPlayer(vlabel, playerid, 0.0, 0.0, 0.7);

    SetPlayerVirtualWorld(playerid, 0);
    SetPlayerInterior(playerid, 0);

    IsRobbing[playerid] =0;
    zoneupdates[playerid] = 1;
    player_zone[playerid] = -1;
    if(!zoneupdate) zoneupdate = SetTimer("update_zones",1000,4);
    SetPlayerToTeamColour(playerid);
    if(gTeam[playerid] == TEAM_COP)
    {
    TextDrawShowForPlayer(playerid, CopClassTxd);
    SendClientMessage(playerid, COLOR_BLUE, "You are a cop now.See /help for more info and /cmds.");
    SendClientMessage(playerid, COLOR_BLUE, "Your job is to arrest criminals.Do NOT kill other COPS or CIVILIANS,you are the LAW,respect it and give the good example.");
    GiveCopWeps(playerid);
    }
    if(gTeam[playerid] == TEAM_CIV)
    {
    TextDrawShowForPlayer(playerid, CivClassTxd);
    SendClientMessage(playerid, COLOR_WHITE, "You are a civilian now.Your job is to rob players,stores and much more.Check /help for more info and /cmds.");
    SendClientMessage(playerid, COLOR_WHITE, "Please remember: This is NOT a deathmatch server,don't kill people randomly or you will be arrested or in extreme cases,killed.");
    GiveCivWeps(playerid);
    }
    return 1;
}
This is the logs:

Quote:

----------------------------------
[12:45:15] SFGW Cops&Robbers Initialized.
[12:45:15] ----------------------------------

[12:45:15] Number of vehicle models: 173
[12:46:41] Incoming connection: *****
[12:46:42] [join] Test has joined the server (0:*********)

----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3e-RC7, ©2005-2012 SA-MP Team

[12:47:40] filterscripts = "" (string)
[12:47:40]
[12:47:40] Server Plugins
[12:47:40] --------------
[12:47:40] Loading plugin: sscanf.so
[12:47:40]

[12:47:40] ===============================

[12:47:40] sscanf plugin loaded.

[12:47:40] © 2009 Alex "******" Cole

[12:47:40] 0.3d-R2 500 Players "dnee"

[12:47:40] ===============================

[12:47:40] Loaded.
[12:47:40] Loading plugin: streamer.so
[12:47:40]

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

[12:47:40] Loaded.
[12:47:40] Loading plugin: irc.so
[12:47:40]

*** IRC Plugin v1.4.2 by Incognito loaded ***

[12:47:40] Loaded.
[12:47:40] Loaded 3 plugins.

[12:47:40]
[12:47:40] Filterscripts
[12:47:40] ---------------
[12:47:40] Loaded 0 filterscripts.

[12:47:40] OnGameo
[12:47:40]
[12:47:40] =======================================
[12:47:40] | |
[12:47:40] | YSI version 1.03.0011 |
[12:47:40] | By Alex "******" Cole |
[12:47:40] | |
[12:47:40] | Checking the latest YSI version.. |
[12:47:40] | |
[12:47:40] =======================================
[12:47:40]
[12:47:40] Loaded 3 vehicles from: vehicles/trains.txt
[12:47:40] Loaded 3 vehicles from: vehicles/pilots.txt
[12:47:40] Loaded 15 vehicles from: vehicles/lv_law.txt
[12:47:40] Loaded 39 vehicles from: vehicles/lv_airport.txt
[12:47:40] Loaded 255 vehicles from: vehicles/lv_gen.txt
[12:47:40] Loaded 38 vehicles from: vehicles/sf_law.txt
[12:47:40] Loaded 35 vehicles from: vehicles/sf_airport.txt
[12:47:41] Loaded 353 vehicles from: vehicles/sf_gen.txt
[12:47:41] Loaded 24 vehicles from: vehicles/ls_law.txt
[12:47:41] Loaded 37 vehicles from: vehicles/ls_airport.txt
[12:47:41] Loaded 98 vehicles from: vehicles/ls_gen_inner.txt
[12:47:41] Loaded 389 vehicles from: vehicles/ls_gen_outer.txt
[12:47:41] Loaded 71 vehicles from: vehicles/whetstone.txt
[12:47:41] Loaded 168 vehicles from: vehicles/bone.txt
[12:47:41] Loaded 61 vehicles from: vehicles/flint.txt
[12:47:41] Loaded 96 vehicles from: vehicles/tierra.txt
[12:47:41] Loaded 96 vehicles from: vehicles/red_county.txt
[12:47:41]
----------------------------------
[12:47:41] SFGW Cops&Robbers Initialized.
[12:47:41] ----------------------------------

[12:47:41] Number of vehicle models: 173

The includes/plugins are ALL updated to last version.I'm working on another gamemode that uses the SAME plugins and includes and it works,but this no,so i think there is a problem here.

Thanks for help.
Reply
#2

I'm thinking it's something to do with your zone updating.
Reply
#3

Quote:
Originally Posted by 2KY
Посмотреть сообщение
I'm thinking it's something to do with your zone updating.
What's wrong with that?It's just shows a GameTextForPlayer at bottom for every zone the player go.
Reply
#4

Show us your custom functions.
Reply
#5

Quote:
Originally Posted by Mean
Посмотреть сообщение
Show us your custom functions.
Like?I use some of custom functions.Please be more specific.
Reply
#6

pawn Код:
if(!zoneupdate) zoneupdate = SetTimer("update_zones",1000,4);
Is the only thing I could see causing problems.
Reply
#7

So what can i do?I can't remove zone system because they're connected with the robbing system.
Reply
#8

Show update_zones.
Reply
#9

Quote:
Originally Posted by MP2
Посмотреть сообщение
Show update_zones.
Forward:

pawn Код:
forward update_zones();
Public:

pawn Код:
public update_zones() {
 new line1[10];
 new line2[10];

 for(new i=0; i<MAX_PLAYERS; i++) {
  if(IsPlayerConnected(i) && zoneupdates[i] == 1) {
   if(IsPlayerInZone(i,player_zone[i])) {  }
   else {

    new player_zone_before;
    player_zone_before = player_zone[i];
    player_zone[i] = -1;


    for(new j=0; j<sizeof(zones);j++) {
     if(IsPlayerInZone(i,j) && player_zone[i] == -1) {

      if(player_zone_before == -1) GameTextForPlayer(i,zones[j][zone_name],1500,1);
      else  if(strcmp(zones[j][zone_name],zones[player_zone_before][zone_name],true) != 0) GameTextForPlayer(i,zones[j][zone_name],1500,1);

      player_zone[i] = j;
      format(line1,10,"p%dzone",i);
      format(line2,10,"%d",j);


     }
    }



    if(player_zone[i] == -1) player_zone[i] = player_zone_before;
   }


  }
 }

}
Reply
#10

Your SetTimer syntax is wrong
https://sampwiki.blast.hk/wiki/SetTimer

Plus your indentation is awfully hard to read.

Correct the SetTimer syntax, if that doesn't fix it debug it with prints.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)