Textdraw help
#1

Hello.
Well im having some problems with Textdraw its my first time that im trying to make something for robbery but i cant if someone might help me would be awsome
The Script
PHP код:
public OnFilterScriptInit()
{
        
Textdraw0 TextDrawCreate(153.000000149.000000".");
        
TextDrawBackgroundColor(Textdraw0255);
        
TextDrawFont(Textdraw01);
        
TextDrawLetterSize(Textdraw00.49000015.999998);
        
TextDrawColor(Textdraw0, -1);
        
TextDrawSetOutline(Textdraw01);
        
TextDrawSetProportional(Textdraw01);
        
TextDrawUseBox(Textdraw01);
        
TextDrawBoxColor(Textdraw0255);
        
TextDrawTextSize(Textdraw0481.0000000.000000);
        
Textdraw1 TextDrawCreate(212.000000155.000000"Robbers Names");
        
TextDrawBackgroundColor(Textdraw1255);
        
TextDrawFont(Textdraw11);
        
TextDrawLetterSize(Textdraw10.5000001.000000);
        
TextDrawColor(Textdraw116711935);
        
TextDrawSetOutline(Textdraw10);
        
TextDrawSetProportional(Textdraw11);
        
TextDrawSetShadow(Textdraw11);
        
Textdraw2 TextDrawCreate(156.000000168.000000"%s",RPName(playerid));
        
TextDrawBackgroundColor(Textdraw2255);
        
TextDrawFont(Textdraw21);
        
TextDrawLetterSize(Textdraw20.4000001.100000);
        
TextDrawColor(Textdraw216777215);
        
TextDrawSetOutline(Textdraw20);
        
TextDrawSetProportional(Textdraw21);
        
TextDrawSetShadow(Textdraw21);
        
Textdraw3 TextDrawCreate(155.000000183.000000"Robbing Time");
        
TextDrawBackgroundColor(Textdraw3255);
        
TextDrawFont(Textdraw31);
        
TextDrawLetterSize(Textdraw30.4399991.000000);
        
TextDrawColor(Textdraw3, -16711681);
        
TextDrawSetOutline(Textdraw30);
        
TextDrawSetProportional(Textdraw31);
        
TextDrawSetShadow(Textdraw31);
        
Textdraw4 TextDrawCreate(154.000000196.000000"%02d sec",120-GetPVarInt(playerid"robbingtime"));
        
TextDrawBackgroundColor(Textdraw4255);
        
TextDrawFont(Textdraw41);
        
TextDrawLetterSize(Textdraw40.2399991.799999);
        
TextDrawColor(Textdraw4, -65281);
        
TextDrawSetOutline(Textdraw40);
        
TextDrawSetProportional(Textdraw41);
        
TextDrawSetShadow(Textdraw41);
        
Textdraw5 TextDrawCreate(153.000000213.000000"%s",RPName(playerid));
        
TextDrawBackgroundColor(Textdraw5255);
        
TextDrawFont(Textdraw51);
        
TextDrawLetterSize(Textdraw50.3199991.700000);
        
TextDrawColor(Textdraw565535);
        
TextDrawSetOutline(Textdraw50);
        
TextDrawSetProportional(Textdraw51);
        
TextDrawSetShadow(Textdraw51);
        return 
1;

PHP код:
public OnFilterScriptExit()
{
        
TextDrawHideForAll(Textdraw0);
        
TextDrawDestroy(Textdraw0);
        
TextDrawHideForAll(Textdraw1);
        
TextDrawDestroy(Textdraw1);
        
TextDrawHideForAll(Textdraw2);
        
TextDrawDestroy(Textdraw2);
        
TextDrawHideForAll(Textdraw3);
        
TextDrawDestroy(Textdraw3);
        
TextDrawHideForAll(Textdraw4);
        
TextDrawDestroy(Textdraw4);
        
TextDrawHideForAll(Textdraw5);
        
TextDrawDestroy(Textdraw5);
        return 
1;

PHP код:
forward HideTextdraws(playerid);
public 
HideTextdraws(playerid)
{
        
TextDrawHideForPlayer(playeridTextdraw0);
        
TextDrawHideForPlayer(playeridTextdraw1);
        
TextDrawHideForPlayer(playeridTextdraw2);
        
TextDrawHideForPlayer(playeridTextdraw3);
        
TextDrawHideForPlayer(playeridTextdraw4);
        
TextDrawHideForPlayer(playeridTextdraw5);

PHP код:
NearMessage(playerid,"========================================================",COLOR_RED);
        
format(message,sizeof(message),"* %s is robbing %s. Do not exit for 2 minutes, else the robbery fails! *",PlayerName(playerid), NoUnderscore(biz[tmpid][biztext]));
        
NearMessage(playerid,message,COLOR_WHITE);
        
NearMessage(playerid,"========================================================",COLOR_RED);
        
TextDrawShowForPlayer(playeridTextdraw0);
        
TextDrawShowForPlayer(playeridTextdraw1);
        
TextDrawShowForPlayer(playeridTextdraw2);
        
TextDrawShowForPlayer(playeridTextdraw3);
        
TextDrawShowForPlayer(playeridTextdraw4);
        
TextDrawShowForPlayer(playeridTextdraw5); 
Problems
PHP код:
C:\Users\ardit_000\Desktop\Mafia(12238) : error 017undefined symbol "playerid"
C:\Users\ardit_000\Desktop\Mafia(12256) : error 017undefined symbol "playerid"
C:\Users\ardit_000\Desktop\Mafia(12265) : error 017undefined symbol "playerid"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
3 Errors

PHP код:
Line 1 )   Textdraw2 TextDrawCreate(156.000000168.000000"%s",RPName(playerid));
Line 2 Textdraw4 TextDrawCreate(154.000000196.000000"%02d sec",120-GetPVarInt(playerid"robbingtime"));
Line 3 Textdraw5 TextDrawCreate(153.000000213.000000"%s",RPName(playerid)); 
Reply
#2

There's multiple calls such as RPName(playerid) in OnFilterscriptInit. You don't have playerid there.
Reply
#3

You can help me out with that bro ? i tried to remove them i get those errors

Quote:

C:\Users\ardit_000\Desktop\Mafia(1223 : error 076: syntax error in the expression, or invalid function call
C:\Users\ardit_000\Desktop\Mafia(12256) : error 035: argument type mismatch (argument 1)
C:\Users\ardit_000\Desktop\Mafia(12265) : error 076: syntax error in the expression, or invalid function call
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.

Reply
#4

bump
Reply
#5

first you shouldn't use RPName(playerid) in textdrawcreate remove it and %s
if you want to set it string like:

you can put it every where you want like onplayerconnect or onplayerspawn
PHP код:
new string[128];
format(string,sizeof(string),"%s",RPName(playerid));
TextDrawSetString(Textdraw2string); 
Reply
#6

would you help me out with Players name cuz RPname is my only way that i show the player names any idea ?
Reply
#7

PHP код:
public OnFilterScriptInit()
{
    
Textdraw0 TextDrawCreate(153.000000149.000000".");
    
TextDrawBackgroundColor(Textdraw0255);
    
TextDrawFont(Textdraw01);
    
TextDrawLetterSize(Textdraw00.49000015.999998);
    
TextDrawColor(Textdraw0, -1);
    
TextDrawSetOutline(Textdraw01);
    
TextDrawSetProportional(Textdraw01);
    
TextDrawUseBox(Textdraw01);
    
TextDrawBoxColor(Textdraw0255);
    
TextDrawTextSize(Textdraw0481.0000000.000000);
    
Textdraw1 TextDrawCreate(212.000000155.000000"Robber's Name");
    
TextDrawBackgroundColor(Textdraw1255);
    
TextDrawFont(Textdraw11);
    
TextDrawLetterSize(Textdraw10.5000001.000000);
    
TextDrawColor(Textdraw116711935);
    
TextDrawSetOutline(Textdraw10);
    
TextDrawSetProportional(Textdraw11);
    
TextDrawSetShadow(Textdraw11);
    
Textdraw2 TextDrawCreate(156.000000168.000000"_");
    
TextDrawBackgroundColor(Textdraw2255);
    
TextDrawFont(Textdraw21);
    
TextDrawLetterSize(Textdraw20.4000001.100000);
    
TextDrawColor(Textdraw216777215);
    
TextDrawSetOutline(Textdraw20);
    
TextDrawSetProportional(Textdraw21);
    
TextDrawSetShadow(Textdraw21);
    
Textdraw3 TextDrawCreate(155.000000183.000000"Robbing Time");
    
TextDrawBackgroundColor(Textdraw3255);
    
TextDrawFont(Textdraw31);
    
TextDrawLetterSize(Textdraw30.4399991.000000);
    
TextDrawColor(Textdraw3, -16711681);
    
TextDrawSetOutline(Textdraw30);
    
TextDrawSetProportional(Textdraw31);
    
TextDrawSetShadow(Textdraw31);
    
Textdraw4 TextDrawCreate(154.000000196.000000"_");
    
TextDrawBackgroundColor(Textdraw4255);
    
TextDrawFont(Textdraw41);
    
TextDrawLetterSize(Textdraw40.2399991.799999);
    
TextDrawColor(Textdraw4, -65281);
    
TextDrawSetOutline(Textdraw40);
    
TextDrawSetProportional(Textdraw41);
    
TextDrawSetShadow(Textdraw41);
    
Textdraw5 TextDrawCreate(153.000000213.000000"_");
    
TextDrawBackgroundColor(Textdraw5255);
    
TextDrawFont(Textdraw51);
    
TextDrawLetterSize(Textdraw50.3199991.700000);
    
TextDrawColor(Textdraw565535);
    
TextDrawSetOutline(Textdraw50);
    
TextDrawSetProportional(Textdraw51);
    
TextDrawSetShadow(Textdraw51);
    return 
1;
}
public 
OnFilterScriptExit()
{
    
TextDrawHideForAll(Textdraw0);
    
TextDrawDestroy(Textdraw0);
    
TextDrawHideForAll(Textdraw1);
    
TextDrawDestroy(Textdraw1);
    
TextDrawHideForAll(Textdraw2);
    
TextDrawDestroy(Textdraw2);
    
TextDrawHideForAll(Textdraw3);
    
TextDrawDestroy(Textdraw3);
    
TextDrawHideForAll(Textdraw4);
    
TextDrawDestroy(Textdraw4);
    
TextDrawHideForAll(Textdraw5);
    
TextDrawDestroy(Textdraw5);
    return 
1;
}
//place this where this code is intended to run.
    
new namestr[MAX_PLAYER_NAME];
    
NearMessage(playerid,"========================================================",COLOR_RED);
    
format(message,sizeof(message),"* %s is robbing %s. Do not exit for 2 minutes, else the robbery fails! *",PlayerName(playerid), NoUnderscore(biz[tmpid][biztext]));
    
NearMessage(playerid,message,COLOR_WHITE);
    
NearMessage(playerid,"========================================================",COLOR_RED);
    
TextDrawShowForPlayer(playeridTextdraw0);
    
TextDrawShowForPlayer(playeridTextdraw1);
    
format(namestr,sizeof(namestr),"%s",RPName(playerid));
    
TextDrawSetString(Textdraw2,namestr);
    
TextDrawShowForPlayer(playeridTextdraw2);
    
TextDrawShowForPlayer(playeridTextdraw3);
    
format(namestr,sizeof(namestr),"%02d sec",120-GetPVarInt(playerid"robbingtime"));
    
TextDrawShowForPlayer(playeridTextdraw4);
    
format(namestr,sizeof(namestr),"%s",RPName(playerid));
    
TextDrawSetString(Textdraw5,namestr);
    
TextDrawShowForPlayer(playeridTextdraw5); 
This should work, let me know if it does or not.
Reply


Forum Jump:


Users browsing this thread: