21.11.2011, 00:16
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?
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?