OnPlayerSpawn question - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: OnPlayerSpawn question (
/showthread.php?tid=84330)
OnPlayerSpawn question -
*BueNoOo* - 30.06.2009
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 !
Re: OnPlayerSpawn question -
[HiC]TheKiller - 30.06.2009
FIXING!
Re: OnPlayerSpawn question -
Ignas1337 - 30.06.2009
umm.. job? maybe Job[MAX_PLAYERS] ?
Re: OnPlayerSpawn question -
*BueNoOo* - 30.06.2009
Thanks TheKiller but I get a lot of errors...Actually 26 errors
Re: OnPlayerSpawn question -
Ignas1337 - 30.06.2009
26 errors mean you missed a } or { i dun remember now. 26 errors = max errors at one time.
Re: OnPlayerSpawn question -
Grim_ - 30.06.2009
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
Re: OnPlayerSpawn question -
*BueNoOo* - 30.06.2009
Could somebody give me a working code for that please ? I would love to have it
Thanks in advance !
Re: OnPlayerSpawn question -
Grim_ - 30.06.2009
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.
Re: OnPlayerSpawn question -
*BueNoOo* - 30.06.2009
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 !
Re: OnPlayerSpawn question -
Grim_ - 30.06.2009
Try putting parenthesis " " around WORKER.