PDA

View Full Version : I have no idea how to solve this! :(


JEkvall95
29/11/2012, 09:06 PM
Yep here is a GPS system

public update_zones() {
new
line1[10],
line2[10];

for(new i=0; i<MAX_PLAYERS; i++) {
if(IsPlayerConnected(i) && zoneupdates[i] == 1) {
if(IsPlayerInZone(i,player_zone[i])) {
}
else {
new
player_zone_before;

player_zone_before = player_zone[i];
player_zone[i] = -1;

for(new j=0; j<sizeof(zones);j++) {
if(IsPlayerInZone(i,j) && player_zone[i] == -1) {
if(player_zone_before == -1) GameTextForPlayer(i,zones[j][zone_name],1500,4);
else if(strcmp(zones[j][zone_name],zones[player_zone_before][zone_name],true) != 0) GameTextForPlayer(i,zones[j][zone_name],1500,4);

player_zone[i] = j;
format(line1,10,"p%dzone",i);
format(line2,10,"%d",j);

}
}
if(player_zone[i] == -1) player_zone[i] = player_zone_before;
}
}
}
}

IsPlayerInZone(playerid, zoneid) {
if(zoneid == -1) return 0;

new
Float:x,
Float:y,
Float:z;

GetPlayerPos(playerid,x,y,z);

if(x >= zones[zoneid][zone_minx] && x < zones[zoneid][zone_maxx]
&& y >= zones[zoneid][zone_miny] && y < zones[zoneid][zone_maxy]
&& z >= zones[zoneid][zone_minz] && z < zones[zoneid][zone_maxz]
&& z < 900.0) return 1;

return 0;
}

http://imageshack.us/a/img854/563/samp039by.png (http://imageshack.us/photo/my-images/854/samp039by.png/)

Uploaded with ImageShack.us (http://imageshack.us)

BUT How do I change the textdraw to this one?

http://imageshack.us/a/img818/3474/whereareyou.png

[D]ry[D]esert
29/11/2012, 09:53 PM
http://wiki.sa-mp.com/wiki/GameTextStyle#Text_Styles

ViniBorn
29/11/2012, 10:02 PM
TextDraw

JEkvall95
29/11/2012, 10:06 PM
Doesn't help :S

kaisersouse
29/11/2012, 10:07 PM
TextDraw

No he's right...those are GameText and not TextDraws

EDIT actually...the FIRST ss in the OPs post is a GameText, the one he wants to change it to seems to be a TextDraw

JEkvall95
30/11/2012, 04:54 PM
how to change that? :( I have no idea :/

JEkvall95
01/12/2012, 12:39 PM
someone?

maramizo
01/12/2012, 02:41 PM
On top of the script:
new PlayerText:Textdraw0;
forward update_zones();
public update_zones() {
new
line1[10],
line2[10];

for(new i=0; i<MAX_PLAYERS; i++) {
if(IsPlayerConnected(i) && zoneupdates[i] == 1) {
if(IsPlayerInZone(i,player_zone[i])) {
}
else {
new
player_zone_before;

player_zone_before = player_zone[i];
player_zone[i] = -1;

for(new j=0; j<sizeof(zones);j++) {
if(IsPlayerInZone(i,j) && player_zone[i] == -1) {
if(player_zone_before == -1)
{
CreateTDZ(i, zones[j][zone_name]);
}
else if(strcmp(zones[j][zone_name],zones[player_zone_before][zone_name],true) != 0)
{
CreateTDZ(i, zones[j][zone_name]);
}

player_zone[i] = j;
format(line1,10,"p%dzone",i);
format(line2,10,"%d",j);

}
}
if(player_zone[i] == -1) player_zone[i] = player_zone_before;
}
}
}
}
forward HidePlayerTextDraw(i);
public HidePlayerTextDraw(i)
{
PlayerTextDrawHide(i, Textdraw0);
PlayerTextDrawDestroy(i, Textdraw0);
return 1;
}
CreateTDZ(i, z)
{
new str[50];
format(str, 50, "%s", z);
Textdraw0 = CreatePlayerTextDraw(playerid,500.000000, 350.000000, str);
PlayerTextDrawAlignment(playerid,Textdraw0, 3);
PlayerTextDrawBackgroundColor(playerid,Textdraw0, 255);
PlayerTextDrawFont(playerid,Textdraw0, 0);
PlayerTextDrawLetterSize(playerid,Textdraw0, 0.879999, 2.499999);
PlayerTextDrawColor(playerid,Textdraw0, -1);
PlayerTextDrawSetOutline(playerid,Textdraw0, 0);
PlayerTextDrawSetProportional(playerid,Textdraw0, 1);
PlayerTextDrawSetShadow(playerid,Textdraw0, 1);
PlayerTextDrawSetSelectable(playerid,Textdraw0, 0);
PlayerTextDrawShow(playerid, Textdraw0);
SetTimerEx("HidePlayerTextDraw", 1500, 0, "i", playerid);
}
IsPlayerInZone(playerid, zoneid) {
if(zoneid == -1) return 0;

new
Float:x,
Float:y,
Float:z;

GetPlayerPos(playerid,x,y,z);

if(x >= zones[zoneid][zone_minx] && x < zones[zoneid][zone_maxx]
&& y >= zones[zoneid][zone_miny] && y < zones[zoneid][zone_maxy]
&& z >= zones[zoneid][zone_minz] && z < zones[zoneid][zone_maxz]
&& z < 900.0) return 1;

return 0;
}

JEkvall95
02/12/2012, 08:28 AM
It is not a fs, it is in a gamemode, I got 12 errors

C:\Users\Julius\Documents\Grand Theft Auto Servers\San Andreas\samp03e_svr_win32.zip\gamemodes\grandlarc1 9952.pwn(2364) : error 017: undefined symbol "playerid"
C:\Users\Julius\Documents\Grand Theft Auto Servers\San Andreas\samp03e_svr_win32.zip\gamemodes\grandlarc1 9952.pwn(2365) : error 017: undefined symbol "playerid"
C:\Users\Julius\Documents\Grand Theft Auto Servers\San Andreas\samp03e_svr_win32.zip\gamemodes\grandlarc1 9952.pwn(2366) : error 017: undefined symbol "playerid"
C:\Users\Julius\Documents\Grand Theft Auto Servers\San Andreas\samp03e_svr_win32.zip\gamemodes\grandlarc1 9952.pwn(2367) : error 017: undefined symbol "playerid"
C:\Users\Julius\Documents\Grand Theft Auto Servers\San Andreas\samp03e_svr_win32.zip\gamemodes\grandlarc1 9952.pwn(2368) : error 017: undefined symbol "playerid"
C:\Users\Julius\Documents\Grand Theft Auto Servers\San Andreas\samp03e_svr_win32.zip\gamemodes\grandlarc1 9952.pwn(2369) : error 017: undefined symbol "playerid"
C:\Users\Julius\Documents\Grand Theft Auto Servers\San Andreas\samp03e_svr_win32.zip\gamemodes\grandlarc1 9952.pwn(2370) : error 017: undefined symbol "playerid"
C:\Users\Julius\Documents\Grand Theft Auto Servers\San Andreas\samp03e_svr_win32.zip\gamemodes\grandlarc1 9952.pwn(2371) : error 017: undefined symbol "playerid"
C:\Users\Julius\Documents\Grand Theft Auto Servers\San Andreas\samp03e_svr_win32.zip\gamemodes\grandlarc1 9952.pwn(2372) : error 017: undefined symbol "playerid"
C:\Users\Julius\Documents\Grand Theft Auto Servers\San Andreas\samp03e_svr_win32.zip\gamemodes\grandlarc1 9952.pwn(2373) : error 017: undefined symbol "playerid"
C:\Users\Julius\Documents\Grand Theft Auto Servers\San Andreas\samp03e_svr_win32.zip\gamemodes\grandlarc1 9952.pwn(2374) : error 017: undefined symbol "playerid"
C:\Users\Julius\Documents\Grand Theft Auto Servers\San Andreas\samp03e_svr_win32.zip\gamemodes\grandlarc1 9952.pwn(2375) : error 017: undefined symbol "playerid"

maramizo
02/12/2012, 11:45 AM
forward update_zones();
public update_zones() {
new
line1[10],
line2[10];

for(new i=0; i<MAX_PLAYERS; i++) {
if(IsPlayerConnected(i) && zoneupdates[i] == 1) {
if(IsPlayerInZone(i,player_zone[i])) {
}
else {
new
player_zone_before;

player_zone_before = player_zone[i];
player_zone[i] = -1;

for(new j=0; j<sizeof(zones);j++) {
if(IsPlayerInZone(i,j) && player_zone[i] == -1) {
if(player_zone_before == -1)
{
CreateTDZ(i, zones[j][zone_name]);
}
else if(strcmp(zones[j][zone_name],zones[player_zone_before][zone_name],true) != 0)
{
CreateTDZ(i, zones[j][zone_name]);
}

player_zone[i] = j;
format(line1,10,"p%dzone",i);
format(line2,10,"%d",j);

}
}
if(player_zone[i] == -1) player_zone[i] = player_zone_before;
}
}
}
}
forward HidePlayerTextDraw(i);
public HidePlayerTextDraw(i)
{
PlayerTextDrawHide(i, Textdraw0);
PlayerTextDrawDestroy(i, Textdraw0);
return 1;
}
CreateTDZ(i, z)
{
new str[50];
format(str, 50, "%s", z);
Textdraw0 = CreatePlayerTextDraw(i,500.000000, 350.000000, str);
PlayerTextDrawAlignment(i,Textdraw0, 3);
PlayerTextDrawBackgroundColor(i,Textdraw0, 255);
PlayerTextDrawFont(i,Textdraw0, 0);
PlayerTextDrawLetterSize(i,Textdraw0, 0.879999, 2.499999);
PlayerTextDrawColor(i,Textdraw0, -1);
PlayerTextDrawSetOutline(i,Textdraw0, 0);
PlayerTextDrawSetProportional(i,Textdraw0, 1);
PlayerTextDrawSetShadow(i,Textdraw0, 1);
PlayerTextDrawSetSelectable(i,Textdraw0, 0);
PlayerTextDrawShow(i, Textdraw0);
SetTimerEx("HidePlayerTextDraw", 1500, 0, "i", i);
}
IsPlayerInZone(playerid, zoneid) {
if(zoneid == -1) return 0;

new
Float:x,
Float:y,
Float:z;

GetPlayerPos(playerid,x,y,z);

if(x >= zones[zoneid][zone_minx] && x < zones[zoneid][zone_maxx]
&& y >= zones[zoneid][zone_miny] && y < zones[zoneid][zone_maxy]
&& z >= zones[zoneid][zone_minz] && z < zones[zoneid][zone_maxz]
&& z < 900.0) return 1;

return 0;
}
Here you go.

JEkvall95
02/12/2012, 12:00 PM
It shows completely wrong

http://img812.imageshack.us/img812/2686/samp028pa.png (http://imageshack.us/photo/my-images/812/samp028pa.png/)

Uploaded with ImageShack.us (http://imageshack.us)

JEkvall95
04/12/2012, 01:52 PM
someone?

JEkvall95
04/12/2012, 06:04 PM
I dont find the right one :/

JEkvall95
05/12/2012, 08:57 PM
no one answers me? O:_o

--LooD--
05/12/2012, 09:11 PM
Use :
GameTextForPlayer(playerid, "Message", time, style); style set to 1
example
GameTextForPlayer(playerid, "Message", 2000, 1);

style (http://wiki.sa-mp.com/wiki/GameTextStyle#Text_Styles)
;)

Scenario
05/12/2012, 10:05 PM
As you have been told about five times now, it is a game-text and NOT a text-draw. For additional information on using and choosing the correct game-text, please click here (http://wiki.sa-mp.com/wiki/GameTextStyle).

JEkvall95
06/12/2012, 05:21 AM
As you have been told about five times now, it is a game-text and NOT a text-draw. For additional information on using and choosing the correct game-text, please click here (http://wiki.sa-mp.com/wiki/GameTextStyle).

it is no one of them...

JEkvall95
08/12/2012, 06:43 AM
still help

HireMe
08/12/2012, 08:34 AM
Ill check if i can find what is going wrong

ThomasCarter
08/12/2012, 08:44 AM
All You do is create the Textdraw but set the Font to 0 and position it

HireMe
08/12/2012, 08:57 AM
try the following code


forward update_zones();
public update_zones() {
new
line1[10],
line2[10];

for(new i=0; i<MAX_PLAYERS; i++) {
if(IsPlayerConnected(i) && zoneupdates[i] == 1) {
if(IsPlayerInZone(i,player_zone[i])) {
}
else {
new
player_zone_before;

player_zone_before = player_zone[i];
player_zone[i] = -1;

for(new j=0; j<sizeof(zones);j++) {
if(IsPlayerInZone(i,j) && player_zone[i] == -1) {
new zname[50];
if(player_zone_before == -1)
{
zname = zones[j][zone_name];
CreateTDZ(i, zname);
}
else if(strcmp(zones[j][zone_name],zones[player_zone_before][zone_name],true) != 0)
{
zname = zones[j][zone_name];
CreateTDZ(i, zname);
}

player_zone[i] = j;
format(line1,10,"p%dzone",i);
format(line2,10,"%d",j);

}
}
if(player_zone[i] == -1) player_zone[i] = player_zone_before;
}
}
}
}
forward HidePlayerTextDraw(i);
public HidePlayerTextDraw(i)
{
PlayerTextDrawHide(i, Textdraw0);
PlayerTextDrawDestroy(i, Textdraw0);
return 1;
}
CreateTDZ(i, zname)
{
new str[50];
format(str, 50, "%s", zname);
Textdraw0 = CreatePlayerTextDraw(i,500.000000, 350.000000, str);
PlayerTextDrawAlignment(i,Textdraw0, 3);
PlayerTextDrawBackgroundColor(i,Textdraw0, 255);
PlayerTextDrawFont(i,Textdraw0, 0);
PlayerTextDrawLetterSize(i,Textdraw0, 0.879999, 2.499999);
PlayerTextDrawColor(i,Textdraw0, -1);
PlayerTextDrawSetOutline(i,Textdraw0, 0);
PlayerTextDrawSetProportional(i,Textdraw0, 1);
PlayerTextDrawSetShadow(i,Textdraw0, 1);
PlayerTextDrawSetSelectable(i,Textdraw0, 0);
PlayerTextDrawShow(i, Textdraw0);
SetTimerEx("HidePlayerTextDraw", 1500, 0, "i", i);
}
IsPlayerInZone(playerid, zoneid) {
if(zoneid == -1) return 0;

new
Float:x,
Float:y,
Float:z;

GetPlayerPos(playerid,x,y,z);

if(x >= zones[zoneid][zone_minx] && x < zones[zoneid][zone_maxx]
&& y >= zones[zoneid][zone_miny] && y < zones[zoneid][zone_maxy]
&& z >= zones[zoneid][zone_minz] && z < zones[zoneid][zone_maxz]
&& z < 900.0) return 1;

return 0;
}

JEkvall95
08/12/2012, 10:38 AM
I got 18 errors
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5059) : error 047: array sizes do not match, or destination array is too small
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5060) : error 035: argument type mismatch (argument 2)
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5064) : error 047: array sizes do not match, or destination array is too small
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5065) : error 035: argument type mismatch (argument 2)
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5082) : error 017: undefined symbol "PlayerTextDrawHide"
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5083) : error 017: undefined symbol "PlayerTextDrawDestroy"
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5090) : error 017: undefined symbol "Textdraw0"
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5090) : error 017: undefined symbol "CreatePlayerTextDraw"
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5091) : error 017: undefined symbol "PlayerTextDrawAlignment"
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5092) : error 017: undefined symbol "PlayerTextDrawBackgroundColor"
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5093) : error 017: undefined symbol "PlayerTextDrawFont"
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5094) : error 017: undefined symbol "PlayerTextDrawLetterSize"
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5095) : error 017: undefined symbol "PlayerTextDrawColor"
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5096) : error 017: undefined symbol "PlayerTextDrawSetOutline"
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5097) : error 017: undefined symbol "PlayerTextDrawSetProportional"
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5098) : error 017: undefined symbol "PlayerTextDrawSetShadow"
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5099) : error 017: undefined symbol "PlayerTextDrawSetSelectable"
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5100) : error 017: undefined symbol "PlayerTextDrawShow"
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 11590) : warning 203: symbol is never used: "dprop_PRIVATE_hash"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


18 Errors.

HireMe
08/12/2012, 02:24 PM
how much errors do you get if you use the following include?

#include <a_players>

JEkvall95
11/12/2012, 04:54 AM
help

Firzendxiw
11/12/2012, 07:05 AM
As you have been told about five times now, it is a game-text and NOT a text-draw. For additional information on using and choosing the correct game-text, please click here (http://wiki.sa-mp.com/wiki/GameTextStyle).
You don't need a text draw, just a different game text style.

I don't think it is plausible to use GameTextStyle for this GPS as what he is trying to seek isn't actually possible with the game text style. As none of the styles available, give him the correct font and position on the screen. The only real chance is with a PlayerTextdraw. That is only my theory on it.

I got 18 errors
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5059) : error 047: array sizes do not match, or destination array is too small
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5060) : error 035: argument type mismatch (argument 2)
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5064) : error 047: array sizes do not match, or destination array is too small
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5065) : error 035: argument type mismatch (argument 2)
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5082) : error 017: undefined symbol "PlayerTextDrawHide"
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5083) : error 017: undefined symbol "PlayerTextDrawDestroy"
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5090) : error 017: undefined symbol "Textdraw0"
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5090) : error 017: undefined symbol "CreatePlayerTextDraw"
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5091) : error 017: undefined symbol "PlayerTextDrawAlignment"
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5092) : error 017: undefined symbol "PlayerTextDrawBackgroundColor"
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5093) : error 017: undefined symbol "PlayerTextDrawFont"
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5094) : error 017: undefined symbol "PlayerTextDrawLetterSize"
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5095) : error 017: undefined symbol "PlayerTextDrawColor"
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5096) : error 017: undefined symbol "PlayerTextDrawSetOutline"
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5097) : error 017: undefined symbol "PlayerTextDrawSetProportional"
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5098) : error 017: undefined symbol "PlayerTextDrawSetShadow"
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5099) : error 017: undefined symbol "PlayerTextDrawSetSelectable"
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 5100) : error 017: undefined symbol "PlayerTextDrawShow"
C:\Users\Julius\UltimateStunting\gamemodes\us.pwn( 11590) : warning 203: symbol is never used: "dprop_PRIVATE_hash"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


18 Errors.
Are you by any chance using 0.3d package to compile your script because you are showing that these specific functions are undefined. This feature (player-textdraws) was added in SA-MP 0.3e and will not work in earlier versions! (http://wiki.sa-mp.com/wiki/CreatePlayerTextDraw)


how much errors do you get if you use the following include?

#include <a_players>
Furthermore, #include <a_samp> it already includes <a_players>, so adding #include <a_players> would be pointless...wouldn't it?

Another thing is with PlayerTextdraws, you would want to create the textdraw when the player joins, then hide the textdraw until they are in a vehicle. Then when they are in the vehicle, PlayerTextDrawSetString would set the string everytime it changes. When they hop out of the vehicle, just hide it again. When the player leaves destroy the textdraw.

Firzendxiw
11/12/2012, 11:40 AM
http://wiki.sa-mp.com/wiki/GameTextStyle

Took me seconds to look up and find the answer was style 2. However, that one doesn't vanish so that's a good reason not to use it.
Another thing is that the position of it isn't correct as with what you can achieve with textdraws. But I see your point that you got me with the font style lol.

JEkvall95
13/12/2012, 07:52 AM
help

JEkvall95
16/12/2012, 10:43 AM
HELP

JEkvall95
07/01/2013, 08:36 PM
Bump! HELP

blackbhuta
08/01/2013, 04:27 AM
CreateTDZ(i, z)
{
new str[50];
format(str, 50, "%s", z);
Textdraw0 = CreatePlayerTextDraw(i,500.000000, 350.000000, str); <<< try to change the position.
PlayerTextDrawAlignment(i,Textdraw0, 3);
PlayerTextDrawBackgroundColor(i,Textdraw0, 255);
PlayerTextDrawFont(i,Textdraw0, 0);
PlayerTextDrawLetterSize(i,Textdraw0, 0.879999, 2.499999);
PlayerTextDrawColor(i,Textdraw0, -1);
PlayerTextDrawSetOutline(i,Textdraw0, 0);
PlayerTextDrawSetProportional(i,Textdraw0, 1);
PlayerTextDrawSetShadow(i,Textdraw0, 1);
PlayerTextDrawSetSelectable(i,Textdraw0, 0);
PlayerTextDrawShow(i, Textdraw0);
SetTimerEx("HidePlayerTextDraw", 1500, 0, "i", i);
}

Check this http://bsndesign.webs.com/tde.htm