About the TextDraw System when near to target.
#1

Hello!

I created the PickupIcon (1239) and I want that, When I stand on it, It shows the textdraw like that:



So How can I set this type of TextDraw on my pickup icon?
Reply
#2

Use the callback called OnPlayerPickupPickup in this manner: https://sampwiki.blast.hk/wiki/OnPlayerPickUpPickup. Once the player enters the pickup, instead of giving him money as it does on that link, instead, use https://sampwiki.blast.hk/wiki/GameTextForPlayer.
Reply
#3

Код:
new infoicon;
Код:
infoicon = CreatePickup(1239, 1, 2316.6211, -12.5674, 26.7422, -1);
Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
		if(pickupid == infoicon)
		{
		GameTextForPlayer(playerid, "~h~~b~ Type /Enter", 3000, 3);
		return 0;
		}
	return 1;
}
Maybe this will help you.
Reply
#4

So I did like that as you said Sir and also I created pickup on OnGamemodeinit but Not Working. Proves:

pawn Код:
new pickup1;
pawn Код:
public OnGameModeInit()
{
        pickup1 = CreatePickup (1239,23,1726.9243,-1636.8926,20.2241,-1);
        return 1;
}
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == pickup1)
    {
       
        GameTextforPlayer(playerid, "TYPE /ENTER", 5000, 2);
         }
         return 1;
}
But It is still not working.
Reply
#5

return 0 under GameTextForPlayer. Plus, did you create the global variable for pickup1

I.e this at the top of the script:

pawn Код:
new pickup1;
Reply
#6

Everything is "OK". I think this Textdraw is not availabing because I am receiving 1 Warning.

pawn Код:
E:\SCRIPT\gamemodes\Gamemode.pwn(198) : warning 204: symbol is assigned a value that is never used: "pickup1"
Line 198 is:

pawn Код:
pickup1 = CreatePickup (1239,23,1726.9243,-1636.8926,20.2241,-1);
Reply
#7

That's a bit strange... basically it's saying that you have one "pickup1 = X", but the term "pickup1" is never used anywhere.

Where did you put new pickup1;?
Reply
#8

Its a gametext

https://sampwiki.blast.hk/wiki/GameTextForPlayer

Then use

https://sampwiki.blast.hk/wiki/OnPlayerPickUpPickup

to show the gametext

EDIT: Not updated page.
Reply
#9

Listing All Includes, Defines etc and see the number of new pickup1;

pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#include <zcmd>
#include <YSI\y_ini>
#include <sscanf2>
#include <foreach>
#include <core>
#include <dini>

#define MY_DEF                          if (IsPlayerConnected(playerid))
#define targetid
//#include <help>

#define dregister 2011
#define dlogin 2012
#define UserPath "Users/%s.ini"
new pickup1;
Reply
#10

Try this instead for OnPlayerPickupPickup:

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == pickup1)
    {
         GameTextForPlayer(playerid, "TYPE /ENTER", 5000, 2); // f was lowercase before in GameTextForPlayer
         return 0;
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)