17.10.2013, 20:59
How do you work with a script that has that many lines it must be really messy. I can only imagine how many times this must appear
Now all you need to do is replace those 4 lines with CheckAdmin(playerid);
Scripts this large need to be done separated into includes with hooking I can only imagine how stupidly large some callbacks must be with a dozen systems it's no wonder your having problems.
In response to your question check this out
This will fail with.....
input(11) : error 6: must be assigned to an array
Error: The compiler failed. (no error code)
This will compile
This will compile
You can test these here
http://slice-vps.nl:7070/
pawn Код:
if(!PlayerInfo[playerid][pAdmin])
{
return SendClientMessage(playerid, -1, "You are not an admin.");
}
How about
#define CheckAdmin(%0) !if(!PlayerInfo[%0][pAdmin]) return SendClientMessage(%0, -1, "You are not an admin.");
Scripts this large need to be done separated into includes with hooking I can only imagine how stupidly large some callbacks must be with a dozen systems it's no wonder your having problems.
In response to your question check this out
pawn Код:
#include <a_samp>
enum test {
testname[MAX_PLAYER_NAME],
}
new name[MAX_PLAYERS][test];
main() {
new tmp;
tmp = "TestName";
name[0][testname] = tmp;
print(name[0][testname]);
}
input(11) : error 6: must be assigned to an array
Error: The compiler failed. (no error code)
This will compile
pawn Код:
#include <a_samp>
enum test {
testname[MAX_PLAYER_NAME],
}
new name[MAX_PLAYERS][test];
main() {
new tmp[MAX_PLAYER_NAME];
tmp = "TestName";
name[0][testname] = tmp;
print(name[0][testname]);
}
pawn Код:
#include <a_samp>
enum test {
testname[MAX_PLAYER_NAME],
}
new name[MAX_PLAYERS][test];
main() {
new tmp[MAX_PLAYER_NAME];
tmp = "TestName";
format(name[0][testname], MAX_PLAYER_NAME, "%s", tmp);
print(name[0][testname]);
}
http://slice-vps.nl:7070/