GPS System
#7

I make this for u and i hope it work

Put this to the top of your script
PHP код:
new Text:ZoneText[MAX_PLAYERS];
forward zOnetExt(playerid);
forward zOnehIde(playerid); 
Go to your OnGameModeInit (or OnFilterScriptInit if a filterscript)
PHP код:
SetTimer("zOnetExt",255,true); 
And put this every where you want
PHP код:
public zOnetExt(playerid)
{
    
format(string,sizeof(string),"%s %s",zones[j],[zone_name]);
    
TextDrawSetString(ZoneText[playerid],string)
    return 
1;

then change this
PHP код:
public update_zones() {
    new
        
line1[10],
        
line2[10],
        
string[128];
    for(new 
i=0i<MAX_PLAYERSi++) {
        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=0j<sizeof(zones);j++) {
                    if(
IsPlayerInZone(i,j) && player_zone[i] == -1) {
                        if(
player_zone_before == -1TextDrawShowForPlayer(i,ZoneText[i]),SetTimerEx("zOnehIde",6000,false,"i",playerid));
                        else if(
strcmp(zones[j][zone_name],zones[player_zone_before][zone_name],true) != 0TextDrawShowForPlayer(i,ZoneText[i]), SetTimerEx("zOnehIde",6000,false,"i",playerid);
                        
player_zone[i] = j;
                        
format(line1,10,"p%dzone",i);
                        
format(line2,10,"%d",j);
                    }
                }
                if(
player_zone[i] == -1player_zone[i] = player_zone_before;
            }
        }
    }

And put this under public zOnetExt(playerid);
PHP код:
public zOnehIde(playerid)
{
    
TextDrawHideForPlayer(playerid,ZoneText[i]);
    return 
1;

oh i'm almost forgot back to the OnPlayerConnect and put this
PHP код:
    ZoneText[playerid] = TextDrawCreate(412.000061405.439941"-");
    
TextDrawLetterSize(ZoneText[playerid], 1.0180002.615465);
    
TextDrawAlignment(ZoneText[playerid], 1);
    
TextDrawColor(ZoneText[playerid], -1378294017);
    
TextDrawSetShadow(ZoneText[playerid], 0);
    
TextDrawSetOutline(ZoneText[playerid], 1);
    
TextDrawBackgroundColor(ZoneText[playerid], 51);
    
TextDrawFont(ZoneText[playerid], 0);
    
TextDrawSetProportional(ZoneText[playerid], 1); 
Enjoy
Reply


Messages In This Thread
GPS System - by JEkvall95 - 11.10.2012, 05:52
Re: GPS System - by BlueGames - 11.10.2012, 06:16
Re: GPS System - by denNorske - 11.10.2012, 06:24
Re: GPS System - by JEkvall95 - 11.10.2012, 13:42
Re: GPS System - by JEkvall95 - 11.10.2012, 13:50
Re: GPS System - by JEkvall95 - 25.07.2013, 19:15
Re: GPS System - by JusstinRoller - 26.07.2013, 01:03
Re: GPS System - by JEkvall95 - 02.08.2013, 14:25

Forum Jump:


Users browsing this thread: 1 Guest(s)