Posts: 1,534
Threads: 179
Joined: Apr 2009
Do i have to add [playerid] or [i] at the textdraw code to show it for the player? because i use a custom money system with textdraw, here is the code
pawn Код:
forward GeldTimer(playerid);
public GeldTimer(playerid)
{
new string[48];
format(string, sizeof(string), "$%d", PlayerInfo[playerid][pCash]);
TextDrawSetString(geldanzeige, string);
return 1;
}
but i think it will be like this, if a player connects, then everyone sees his money value
pawn Код:
geldanzeige = TextDrawCreate(498.000000, 79.000000, "$15000000");
TextDrawBackgroundColor(geldanzeige, 255);
TextDrawFont(geldanzeige, 2);
TextDrawLetterSize(geldanzeige, 0.470000, 1.899999);
TextDrawColor(geldanzeige, -1);
TextDrawSetOutline(geldanzeige, 0);
TextDrawSetProportional(geldanzeige, 1);
TextDrawSetShadow(geldanzeige, 1);
TextDrawUseBox(geldanzeige, 1);
TextDrawBoxColor(geldanzeige, 255);
TextDrawTextSize(geldanzeige, 607.000000, 199.000000);
i tried to add [playerid] everywhere after geldanzeige but i get errors
Posts: 1,534
Threads: 179
Joined: Apr 2009
pawn Код:
C:\Users\Stefanche16\Desktop\sunsetcity_roleplay\gamemodes\sunsetcity.pwn(14197) : error 028: invalid subscript (not an array or too many subscripts): "geldanzeige"
C:\Users\Stefanche16\Desktop\sunsetcity_roleplay\gamemodes\sunsetcity.pwn(14197) : warning 215: expression has no effect
C:\Users\Stefanche16\Desktop\sunsetcity_roleplay\gamemodes\sunsetcity.pwn(14197) : error 001: expected token: ";", but found "]"
C:\Users\Stefanche16\Desktop\sunsetcity_roleplay\gamemodes\sunsetcity.pwn(14197) : error 029: invalid expression, assumed zero
C:\Users\Stefanche16\Desktop\sunsetcity_roleplay\gamemodes\sunsetcity.pwn(14197) : fatal error 107: too many error messages on one line
at this line
pawn Код:
TextDrawSetString(geldanzeige[playerid], string);
I get these errors, but if i remove [playerid] i don't get them, but i think if i remove [playerid] it will be messed up
Posts: 1,534
Threads: 179
Joined: Apr 2009
Quote:
Originally Posted by Abreezy
pawn Код:
TextDrawBackgroundColor(geldanzeige, 255); TextDrawFont(geldanzeige, 2); TextDrawLetterSize(geldanzeige, 0.470000, 1.899999); TextDrawColor(geldanzeige, -1); TextDrawSetOutline(geldanzeige, 0); TextDrawSetProportional(geldanzeige, 1); TextDrawSetShadow(geldanzeige, 1); TextDrawUseBox(geldanzeige, 1); TextDrawBoxColor(geldanzeige, 255); TextDrawTextSize(geldanzeige, 607.000000, 199.000000);
add the playerid on all of those.
|
I did, but still get errors
suhrab_mujeeb
Unregistered
You have to create a textdraw for every connecting player. So that goes under OnPlayerConnect..
+ the textdraw names need to be indexed for all the textdraw ids.
Edit:
pawn Код:
new Text:geldanzeige[MAX_PLAYERS];// top of script
// Under OnPlayerConnect..
geldanzeige[playerid] = TextDrawCreate(498.000000, 79.000000, "$15000000");
* * TextDrawBackgroundColor(geldanzeige[playerid], 255);
* * TextDrawFont((geldanzeige[playerid], 2);
* * TextDrawLetterSize(geldanzeige[playerid] 0.470000, 1.899999);
* * TextDrawColor(geldanzeige[playerid], -1);
* * TextDrawSetOutline(geldanzeige[playerid], 0);
* * TextDrawSetProportional(geldanzeige[playerid], 1);
* * TextDrawSetShadow(geldanzeige[playerid], 1);
* * TextDrawUseBox(geldanzeige[playerid], 1);
* * TextDrawBoxColor(geldanzeige[playerid], 255);
* * TextDrawTextSize(geldanzeige[playerid], 607.000000, 199.000000);
Sorry on my iphone..
Posts: 1,534
Threads: 179
Joined: Apr 2009