21.06.2009, 21:29
I created code:
http://pastebin.com/m30af9774
If the code in the GameMode - works fine.
If I use this code as the FS - is not working. (Public Functions "OnPlayerDeath" Not implemented)
What should I do?
Tell me please...
http://pastebin.com/m30af9774
pawn Код:
#include <a_samp>
#include <core>
#include <float>
new box;
new InBox[MAX_PLAYERS];
new Score[MAX_PLAYERS];
public OnGameModeInit()
{
CreateObject(7416, 2067.0131, 1062.9815, 652.9669, 0.0, 0.0, 0.0);
return 0;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/dayn", true))
{
if(InBox[playerid]==1) return SendClientMessage(playerid,0xFFFFFFFF,"XYI TEBE LOH");
if(!box || box == 1)
{
if(1 != InBox[playerid])
{
SetPlayerPos(playerid, 2046.6719, 1042.306, 654.434);
SetPlayerFacingAngle(playerid, 8.1282);
ResetPlayerWeapons(playerid);
//-------------------------------------------
new Skine[2] = { 80, 81 };
SetPlayerSkin(playerid, Skine[random(2)]);
//---------------------------------------------
box++;
InBox[playerid] = 1;
///--------------------------------------------
new string[128], playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, 24);
format(string, 256, "Player %s teleported to the ring", playername);
SendClientMessageToAll(0x33AA33AA, string);
}
}
return 1;
}
return 0;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(InBox[killerid] == 1 && InBox[playerid] == 1)
{
if(2 != Score[killerid])
{
Score[killerid]++;
new player[MAX_PLAYER_NAME], vrag[MAX_PLAYER_NAME], string[128];
GetPlayerName(killerid, player, 256);
GetPlayerName(playerid, vrag, 256);
format(string, 256, "%s vedet co c4etom: %d :%d na 'o' protiv: %s!!!", player, Score, Score, vrag);
SendClientMessageToAll(0x33AA33AA, string);
SetPlayerHealth(killerid, 100.0);
}
else if(Score[killerid] == 2)
{
Score[killerid]++;
new winer[MAX_PLAYER_NAME], proigr[MAX_PLAYER_NAME], string[128];
GetPlayerName(killerid, winer, 256);
GetPlayerName(playerid, proigr, 256);
format(string, 256, "%s Win %s , Score: %d :%d !", winer, proigr, Score, Score);
SendClientMessageToAll(0x33AA33AA, string);
SpawnPlayer(killerid);
box = 0;
for(new pita4ok = 0; pita4ok < 256; pita4ok++)
{
InBox[pita4ok] = 0;
}
for(new pita4ok = 0; pita4ok < 256; pita4ok++)
{
Score[pita4ok] = 0;
}
}
}
return 1;
}
public OnPlayerSpawn(playerid)
{
if(3 != Score[playerid] && InBox[playerid] == 1)
{
new Skine[2] = { 80, 81 };
SetPlayerSkin(playerid, Skine[random(2)]);
ResetPlayerWeapons(playerid);
SetPlayerPos(playerid, 2046.6719, 1042.306, 654.434);
}
return 1;
}
If I use this code as the FS - is not working. (Public Functions "OnPlayerDeath" Not implemented)
What should I do?
Tell me please...