31.07.2014, 13:53
I'm trying to make kill message script for a friend. The code is below:
the problem is, I get "undefined symbol" errors at the last lines under OnPlayerSpawn.
How can I bring back the symbols defined for another callback?
PHP код:
#include <a_samp>
#include <JunkBuster>
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
public OnPlayerDeath(playerid, killerid, reason)
{
new Text:Textdraw0; //TextDraw
new Text:Textdraw1; //TextDraw
new Text:Textdraw2;//TextDraw
new name[MAX_PLAYER_NAME];
new killer[MAX_PLAYER_NAME];
new weapname[50];
new string0[128];
new string1[128];
new string2[128];
format(string0,128,"You were killed by %s. ",killer);
format(string1,128,"You killed %s.",name);
format(string2,128,"You commited suicide.");
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(killerid, killer, sizeof(killer));
GetWeaponName(GetPlayerWeapon(killerid), weapname, sizeof(weapname));
Textdraw0 = TextDrawCreate(257.333282, 143.111083, string0);
TextDrawLetterSize(Textdraw0, 0.272000, 1.284740);
TextDrawAlignment(Textdraw0, 1);
TextDrawColor(Textdraw0, -1);
TextDrawSetShadow(Textdraw0, 0);
TextDrawSetOutline(Textdraw0, 1);
TextDrawBackgroundColor(Textdraw0, 51);
TextDrawFont(Textdraw0, 1);
TextDrawSetProportional(Textdraw0, 1);
Textdraw1 = TextDrawCreate(257.333282, 143.111083, string1);
TextDrawLetterSize(Textdraw1, 0.272000, 1.284740);
TextDrawAlignment(Textdraw1, 1);
TextDrawColor(Textdraw1, -1);
TextDrawSetShadow(Textdraw1, 0);
TextDrawSetOutline(Textdraw1, 1);
TextDrawBackgroundColor(Textdraw1, 51);
TextDrawFont(Textdraw1, 1);
TextDrawSetProportional(Textdraw1, 1);
Textdraw2 = TextDrawCreate(257.333282, 143.111083, string2);
TextDrawAlignment(Textdraw2, 1);
TextDrawColor(Textdraw2, -1);
TextDrawSetShadow(Textdraw2, 0);
TextDrawSetOutline(Textdraw2, 1);
TextDrawBackgroundColor(Textdraw2, 51);
TextDrawFont(Textdraw2, 1);
TextDrawSetProportional(Textdraw2, 1);
if(killerid != INVALID_PLAYER_ID)
{TextDrawShowForPlayer(playerid, Textdraw2);}
else
{
TextDrawShowForPlayer(playerid, Textdraw0);
TextDrawShowForPlayer(killerid, Textdraw1);
}
return 1;
}
public OnPlayerSpawn(playerid)
{
TextDrawHideForPlayer(playerid, Textdraw0);//undefined symbol
TextDrawHideForPlayer(playerid, Textdraw1);//undefined symbol
TextDrawHideForPlayer(playerid, Textdraw2);//undefined symbol
}
How can I bring back the symbols defined for another callback?