23.12.2011, 20:27
So I am currently testing the map system of my script. Every float variable (for spawns etc.) is getting loaded out of text files, and that is working perfectly. But I got a problem with the function: SetSpawnInfo.
(Note: The loading of the variables works fine)
This is how the actual code looks like:
@: OnPlayerSpawn
When I use the code like this (@ OnPlayerSpawn) I don't get spawned at the wished location (I get spawned at point 0). Everything else works fine (I get weapons + my skin is the right one).
But:
If I use the same code under OnPlayerRequestClass I do get spawned at the wished location. This option gives me some other problems though:
- Warning messages appear that make the client sooner or later crash
- It doesn't pass the skin IDs I've chosen with AddPlayerClass
- I spawn without any weapons
I've read on the Wiki that you can use the function at OnPlayerSpawn but also at OnPlayerRequestClass, so I honestly don't really understand this.
Thanks in advance.
(Note: The loading of the variables works fine)
This is how the actual code looks like:
@: OnPlayerSpawn
pawn Код:
switch(gTeam[playerid])
{
case TEAM_1:
{
SetSpawnInfo(playerid, TEAM_1 , -1 , s_spawnx, s_spawny , s_spawnz, s_spawna, -1, -1, -1, -1, -1, -1);
}
...
But:
If I use the same code under OnPlayerRequestClass I do get spawned at the wished location. This option gives me some other problems though:
- Warning messages appear that make the client sooner or later crash
- It doesn't pass the skin IDs I've chosen with AddPlayerClass
- I spawn without any weapons
I've read on the Wiki that you can use the function at OnPlayerSpawn but also at OnPlayerRequestClass, so I honestly don't really understand this.
Thanks in advance.