a little error in my kill message script.
#4

pawn Код:
new Text:Textdraw0; //TextDraw
new Text:Textdraw1; //TextDraw
new Text:Textdraw2;//TextDraw
That, goes outside all callbacks. If you declare something inside a callback like you did with the variables above, then other callbacks can't access it directly. It would look like this if you change it:
pawn Код:
#include <a_samp>
#include <JunkBuster>
//====== GLOBAL VARIABLES HERE ======== //
    new Text:Textdraw0; //TextDraw
    new Text:Textdraw1; //TextDraw
    new Text:Textdraw2;//TextDraw
//
#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 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
}
If you need more clarification, feel free to ask
Reply


Messages In This Thread
a little error in my kill message script. - by HeLiOn_PrImE - 31.07.2014, 13:53
Re: a little error in my kill message script. - by biker122 - 31.07.2014, 13:57
Re: a little error in my kill message script. - by HeLiOn_PrImE - 31.07.2014, 14:11
Re: a little error in my kill message script. - by Jstylezzz - 31.07.2014, 14:16
Re: a little error in my kill message script. - by HeLiOn_PrImE - 31.07.2014, 15:03

Forum Jump:


Users browsing this thread: 1 Guest(s)