Max_Players -
Sleek420 - 21.11.2011
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?
Re: Max_Players -
Calgon - 21.11.2011
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.
Re: Max_Players -
antonio112 - 21.11.2011
Either:
or use:
pawn Код:
#undef MAX_PLAYERS
#define MAX_PLAYERS 500
under your includes
Re: Max_Players -
=WoR=G4M3Ov3r - 21.11.2011
Quote:
Originally Posted by antonio112
Either:
or use:
pawn Код:
#undef MAX_PLAYERS #define MAX_PLAYERS 500
under your includes
|
PHP код:
include <a_samp>
**
Re: Max_Players - Sinc - 21.11.2011
I'm assuming you have undefined MAX_PLAYERS and it's constant.
Quote:
Originally Posted by Calgon
Have you included a_samp?
|
If he haven't, he would have received more errors about callbacks and functions.
Re: Max_Players -
Sleek420 - 21.11.2011
Oh wow, all i had to do was place the new tga[MAX_PLAYERS];
Under the samp include, im a dumbass, thanks guys!