Max_Players
#1

Hi, The last time i scripted a server it was probably around 1-2 years ago, So i have noticed that samp has changed a bit and i am trying to make it so when you teleport you show up in the same place after you die, heres what i have.


new tga[MAX_PLAYERS];

And under OnPlayerSpawn

if (tga[playerid] == 1)
{
GivePlayerWeapon(playerid,22,60);
GivePlayerWeapon(playerid,29,200);
SendClientMessage(playerid,yellow,"--------[Hitman Battlegrounds]--------");
SendClientMessage(playerid,white,"|| Checkout /help ||");
SendClientMessage(playerid,yellow,"--------------------------------------");
SetPlayerHealth(playerid,9);
SetPlayerPos(playerid,1408.7151,-1475.3160,125.3672);
}
else
{
SetPlayerHealth(playerid,150);
ResetPlayerWeapons(playerid);
}
return 1;
}


Then heres when you teleport.

if (strcmp("/TGrounds", cmdtext, true, 10) == 0)
{
tga[playerid] = 1;
GivePlayerWeapon(playerid,22,60);
GivePlayerWeapon(playerid,29,200);
SendClientMessage(playerid,yellow,"--------[Hitman Battlegrounds]--------");
SendClientMessage(playerid,white,"|| Checkout /help ||");
SendClientMessage(playerid,yellow,"--------------------------------------");
SetPlayerHealth(playerid,9);
SetPlayerPos(playerid,1408.7151,-1475.3160,125.3672);
return 1;
}


Then when i compile i get.

C:\Users\Sleek\Desktop\GTASanAndreas\gamemodes\hmb g.pwn(32) : error 017: undefined symbol "MAX_PLAYERS"
C:\Users\Sleek\Desktop\GTASanAndreas\gamemodes\hmb g.pwn(32) : error 009: invalid array size (negative, zero or out of bounds)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.


WTF?
Reply
#2

Quote:

it was probably around 1-2 years ago

Have you included a_samp? In older versions, you had to include every single *_samp include, that's no longer required - just include a_samp.
Reply
#3

Either:
pawn Код:
#include <a.samp>
or use:
pawn Код:
#undef MAX_PLAYERS
#define MAX_PLAYERS 500

under your includes
Reply
#4

Quote:
Originally Posted by antonio112
Посмотреть сообщение
Either:
pawn Код:
#include <a.samp>
or use:
pawn Код:
#undef MAX_PLAYERS
#define MAX_PLAYERS 500

under your includes
PHP код:
include <a_samp
**
Reply
#5

I'm assuming you have undefined MAX_PLAYERS and it's constant.

pawn Код:
#define MAX_PLAYERS 500

Quote:
Originally Posted by Calgon
Посмотреть сообщение
Have you included a_samp?
If he haven't, he would have received more errors about callbacks and functions.
Reply
#6

Oh wow, all i had to do was place the new tga[MAX_PLAYERS];

Under the samp include, im a dumbass, thanks guys!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)