SA-MP Forums Archive
About the TextDraw System when near to target. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: About the TextDraw System when near to target. (/showthread.php?tid=465743)



About the TextDraw System when near to target. - MAFIAWARS - 23.09.2013

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?


Re: About the TextDraw System when near to target. - DanishHaq - 23.09.2013

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.


Re: About the TextDraw System when near to target. - iWaYz - 23.09.2013

Код:
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.


Re: About the TextDraw System when near to target. - MAFIAWARS - 23.09.2013

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.


Re: About the TextDraw System when near to target. - DanishHaq - 23.09.2013

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;



Re: About the TextDraw System when near to target. - MAFIAWARS - 23.09.2013

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);



Re: About the TextDraw System when near to target. - DanishHaq - 23.09.2013

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;?


Re: About the TextDraw System when near to target. - ReVo_ - 23.09.2013

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.


Re: About the TextDraw System when near to target. - MAFIAWARS - 23.09.2013

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;



Re: About the TextDraw System when near to target. - DanishHaq - 23.09.2013

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;
}