OnPlayerSpawn question
#1

Hey ! I got some question about teams. I want so when a players spawns as a Worker it saves in a file and everytime he loggs in he automatically spawns as a Worker. How Can i do it ? I guess something has to be saved in a file...

This bit of code has been taken out of SFTDM mode.
pawn Код:
public OnPlayerSpawn(playerid)

{
    if(gTeam[playerid] == TEAM_WORKER) {
    SetPlayerColor(playerid,TEAM_WORKER_COLOR);
// here the code to save in player stats that he has picked the Worker team

}
Hope you guys can help me with this !
Reply
#2

FIXING!
Reply
#3

umm.. job? maybe Job[MAX_PLAYERS] ?
Reply
#4

Thanks TheKiller but I get a lot of errors...Actually 26 errors
Reply
#5

26 errors mean you missed a } or { i dun remember now. 26 errors = max errors at one time.
Reply
#6

Quote:
Originally Posted by Thanatos
26 errors mean you missed a } or { i dun remember now. 26 errors = max errors at one time.
Or it could mean there are just 26 errors with teh code posted
Reply
#7

Could somebody give me a working code for that please ? I would love to have it Thanks in advance !
Reply
#8

Search for "dudb". It allows you to save things into a file, and read them easily. It alos has a tutorial on saving position. Just change it a little to the WORKERS team.
Reply
#9

Well I fixed TheKiller's code and I am now left with these 3 errors :

pawn Код:
error 033: array must be indexed (variable "dini_Get")
error 033: array must be indexed (variable "-unknown-")
error 033: array must be indexed (variable "-unknown-")
How can I index "dini_Get" ? And how do I fix the rest of the errors ? Thanks !
Reply
#10

Try putting parenthesis " " around WORKER.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)