Textdraw don't appear.
#1

Hello,
PHP код:
#include <a_samp>
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
    print(
"\n--------------------------------------");
    print(
" Blank Filterscript by your name here");
    print(
"--------------------------------------\n");
    return 
1;
}
public 
OnFilterScriptExit()
{
    return 
1;
}
#else
new Text:Textdraw0;
new 
Text:Textdraw1;
main()
{
    print(
"\n----------------------------------");
    print(
" Blank Gamemode by your name here");
    print(
"----------------------------------\n");
}
#endif
public OnGameModeInit()
{
    
// Don't use these lines if it's a filterscript
    
SetGameModeText("Blank Script");
    
AddPlayerClass(01958.37831343.157215.3746269.1425000000);
    
SetTimer("paycheck",10000,true);
    
SetTimer("paycheckshow",5000,true);
    return 
1;
}
public 
OnGameModeExit()
{
    return 
1;
}
public 
OnPlayerRequestClass(playeridclassid)
{
    
SetPlayerPos(playerid1958.37831343.157215.3746);
    
SetPlayerCameraPos(playerid1958.37831343.157215.3746);
    
SetPlayerCameraLookAt(playerid1958.37831343.157215.3746);
    return 
1;
}
public 
paycheckshow(playerid)
{
    
TextDrawHideForPlayer(playerid,Textdraw0);
    
TextDrawHideForPlayer(playerid,Textdraw1);
}
public 
paycheck(playerid)
{
    
Textdraw0 TextDrawCreate(493.000000302.000000"PayCheck");
    
TextDrawBackgroundColor(Textdraw0255);
    
TextDrawFont(Textdraw03);
    
TextDrawLetterSize(Textdraw00.8299993.799999);
    
TextDrawColor(Textdraw016711935);
    
TextDrawSetOutline(Textdraw00);
    
TextDrawSetProportional(Textdraw01);
    
TextDrawSetShadow(Textdraw04);
    
TextDrawShowForPlayer(playerid,Textdraw0);
    
Textdraw1 TextDrawCreate(575.000000337.000000"$500");
    
TextDrawBackgroundColor(Textdraw1255);
    
TextDrawFont(Textdraw11);
    
TextDrawLetterSize(Textdraw10.5000003.299998);
    
TextDrawColor(Textdraw116711935);
    
TextDrawSetOutline(Textdraw10);
    
TextDrawSetProportional(Textdraw11);
    
TextDrawSetShadow(Textdraw14);
    
TextDrawShowForPlayer(playerid,Textdraw1);
    
GivePlayerMoney(playerid,500);

Okay this is a textdraw,I don't know why is this not working,I want the both textdraws to appear after a 10sec and only show for 5 sec,but when I go ig,nothing happened,please fix that for me.Or just tell what is wrong.
ThAnKs!
Reply
#2

Add TextDrawShowForPlayer(playerid, Textdraw0); and TextDrawShowForPlayer(playerid, Textdraw1);
To on OnPlayerRequestClass.
Reply
#3

Not helping
Reply
#4

change
TextDrawShowForPlayer(playerid,Textdraw0);
to
TextDrawShowForPlayer(playerid,Text:Textdraw0);
and
TextDrawShowForPlayer(playerid,Textdraw1);
to
TextDrawShowForPlayer(playerid,Text:Textdraw1);
Reply
#5

Still not working.Please help.Please again look into the codes and please fix that for me.
Reply
#6

pawn Код:
#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else
new Text:Textdraw0;
new Text:Textdraw1;
forward paycheck(playerid);
forward paycheckshow(playerid);
main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    Textdraw0 = TextDrawCreate(493.000000, 302.000000, "PayCheck");
    TextDrawBackgroundColor(Textdraw0, 255);
    TextDrawFont(Textdraw0, 3);
    TextDrawLetterSize(Textdraw0, 0.829999, 3.799999);
    TextDrawColor(Textdraw0, 16711935);
    TextDrawSetOutline(Textdraw0, 0);
    TextDrawSetProportional(Textdraw0, 1);
    TextDrawSetShadow(Textdraw0, 4);
    Textdraw1 = TextDrawCreate(575.000000, 337.000000, "$500");
    TextDrawBackgroundColor(Textdraw1, 255);
    TextDrawFont(Textdraw1, 1);
    TextDrawLetterSize(Textdraw1, 0.500000, 3.299998);
    TextDrawColor(Textdraw1, 16711935);
    TextDrawSetOutline(Textdraw1, 0);
    TextDrawSetProportional(Textdraw1, 1);
    TextDrawSetShadow(Textdraw1, 4);
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    SetTimer("paycheck",10000,false);
    return 1;
}

public paycheckshow(playerid)
{
    TextDrawHideForPlayer(playerid,Text:Textdraw0);
    TextDrawHideForPlayer(playerid,Text:Textdraw1);
}
public paycheck(playerid)
{
    TextDrawShowForPlayer(playerid,Text:Textdraw0);
    TextDrawShowForPlayer(playerid,Text:Textdraw1);
    GivePlayerMoney(playerid,500);
    SetTimer("paycheckshow",5000,false);
}
Reply
#7

not working.
Reply
#8

Quote:
Originally Posted by TaLhA XIV
Посмотреть сообщение
not working.
What problems are you having with it? I just went ingame and the textdraw shows fine for me.
Reply
#9

The textdraw does not show.I kept waiting but...no response.
Reply
#10

paycheck(playerid)
SetTimer("paycheck",10000,false);

this mistake, i made it very much when i started scripting.
If you only SetTimer, the timer does not know for which playerid to call the paycheck

delete the timer in OnPlayerSpawn, and add this:
pawn Код:
SetTimerEx("paycheck",10000,false,"i",playerid);
this will call the function, with the players id

btw, same goes for all public functions, called with a timer, which requires a playerid or something else
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)