14.11.2014, 17:00
(
Last edited by Kwarde; 14/11/2014 at 06:46 PM.
Reason: Changed team IDs from 1-6 to 0-5, since ID 0 is valid in SetPlayerTeam()
)
Quote:
Omg i forgot that part :O
But i remember once i used without it and it still worked.. |
Also, you should add IDs after the TEAM_{teamname} defines. When you compile the script, the pre-compiler (that happens before the script actually gets compiled), will replace all the defines (it was called placeholders I think? Not sure!) with the #define data. For example:
pawn Code:
//Actual script;
#include <a_samp>
#define HELLO_WORLD "Hello world!"
main()
{
print(HELLO_WORLD);
return 1;
}
//Pre-compiled script:
#include <a_samp> //Actually, all the data of a_samp will be in one script.. but I'm not copying that all -atleast, I think it does, I read it once I think. Not sure!! -- It would make sense though-
main()
{
print("Hello world!"); //This got replaced with the HELLO_WORLD define data.
return 1;
}
pawn Code:
//Actual script:
#include <a_samp>
#define TEAM_ALFA
#define TEAM_BRAVO
#define TEAM_CHARLIE
#define TEAM_DELTA
#define TEAM_ECHO
#define TEAM_FOXTROT
main()
{
printf("TEAM_ALFA is %d", TEAM_ALFA);
printf("TEAM_BRAVO is %d", TEAM_BRAVO);
printf("TEAM_CHARLIE is %d", TEAM_CHARLIE);
printf("TEAM_DELTA is %d", TEAM_DELTA);
printf("TEAM_ECHO is %d", TEAM_ECHO);
printf("TEAM_FOXTROT is %d", TEAM_FOXTROT);
return 1;
}
//Pre-compiled script:
#include <a_samp>
main()
{
printf("TEAM_ALFA is %d", );
printf("TEAM_BRAVO is %d", );
printf("TEAM_CHARLIE is %d", );
printf("TEAM_DELTA is %d", );
printf("TEAM_ECHO is %d", );
printf("TEAM_FOXTROT is %d", );
return 1;
}
pawn Code:
#include <a_samp>
#define TEAM_ALFA 0
#define TEAM_BRAVO 1
#define TEAM_CHARLIE 2
#define TEAM_DELTA 3
#define TEAM_ECHO 4
#define TEAM_FOXTROT 5
main()
{
printf("TEAM_ALFA is %d", TEAM_ALFA);
printf("TEAM_BRAVO is %d", TEAM_BRAVO);
printf("TEAM_CHARLIE is %d", TEAM_CHARLIE);
printf("TEAM_DELTA is %d", TEAM_DELTA);
printf("TEAM_ECHO is %d", TEAM_ECHO);
printf("TEAM_FOXTROT is %d", TEAM_FOXTROT);
return 1;
}
This post is not meant to be mean, but it's only fully intended so your PAWN knowledge gets extended, so you have a better understanding of what you're doing, and so that you can improve (or please, re-write!) your tutorial.
p.s.
AddPlayerClass doesn't add teams. It only adds an option in the class selection with spawn data, weapon data and skin data. You can, however, used AddPlayerClassEx and also add data on what team they should be.
*