Posts: 791
Threads: 20
Joined: Sep 2013
Reputation:
0
static
string[2048];
that's a lot, don't you think? and why did you do static?
just do
new string[200]; is fair enough.
Posts: 3,324
Threads: 96
Joined: Sep 2013
Quote:
Originally Posted by Eth
static
string[2048];
that's a lot, don't you think? and why did you do static?
just do
new string[200]; is fair enough.
|
Yes, that is very large and should be made smaller. Yes it is static and it CAN BE STATIC. It's static to that function, so it makes sense if you know what it means. Plus you're already trying to clear it ("[0] = 0") so it's fine.
Quote:
Originally Posted by -CaRRoT
Is that the only ZCMD command you're using? I doubt this would solve it but I remember having the same issue and I had to switch from using CMD: to COMMAND:, give it a shot.
|
"COMMAND" and "CMD" are synonymous in ZCMD. In fact, they are just both just predefined macros to the same shit. So no that's not the problem.
@OP: Put some 'print's all over (EVERYWHERE). See where they get printed and where they don't.
Posts: 3,324
Threads: 96
Joined: Sep 2013
Well obviously, you can't put a print there. It's outside of the block so by the time the block is being executed 'i' is no longer defined.
pawn Код:
stock Taxi_ShowCalls(playerid)
{
static
string[2048];
string[0] = 0;
printf("string = %s", string);
foreach (new i : Player) {
if (GetPVarInt(i, "TaxiRequest"))
{
format(string, sizeof(string), "%s%d: %s (%s)", string, i, GetPlayerNameEx(i, ENameType_RPName_NoMask), GetPlayerLocation(i));
print("appending");
}
}
if (!strlen(string))
{
SendClientMessage(playerid, COLOR_LIGHTRED, "There are no taxi calls to accept.");
print("if")
}
else SendClientMessage(playerid, COLOR_LIGHTRED, string), print("else");
print("end");
return 1;
}