OnPlayerSpawn is not called -
Saddin - 04.03.2017
Here is my OnPlayerSpawn:
Код:
public OnPlayerSpawn(playerid)
{
new PlayerName[MAX_PLAYER_NAME],
string[40];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "%s has spawned successfully.", PlayerName);
SendClientMessageToAll(0xFFFFFFFF, string);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1);
SetPlayerColor(playerid, -1);
SetPlayerHealth(playerid, 100.0);
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
SetCameraBehindPlayer(playerid);
StopAudioStreamForPlayer(playerid);
return 1;
}
It doesnt work, i spawn successfuly but it wont work... I dont get the message and it wont change my skin/color, any of this.
Re: OnPlayerSpawn is not called -
Unrea1 - 04.03.2017
Add more value for string, exactly 50.
24 (Name player) + 26 (Letters) = 50.
Re: OnPlayerSpawn is not called -
Saddin - 04.03.2017
Quote:
Originally Posted by Fynn.
Add more value for string, exactly 50.
24 (Name player) + 26 (Letters) = 50.
|
that is not the problem, it wont execute any of the instructions
Re: OnPlayerSpawn is not called -
Yuri8 - 04.03.2017
Use the functions at OnPlayerConnect, only the message is ok.
Re: OnPlayerSpawn is not called -
Saddin - 04.03.2017
Quote:
Originally Posted by Yuri8
Use the functions at OnPlayerConnect, only the message is ok.
|
i need to set health, skin, weaponskill, stop audio stream every time when player spawn, that will not solve anything..
Re: OnPlayerSpawn is not called -
Toroi - 04.03.2017
Swap the order of these things, like this:
Код:
public OnPlayerSpawn(playerid)
{
SetPlayerColor(playerid, -1);
SetPlayerHealth(playerid, 100.0);
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
SetCameraBehindPlayer(playerid);
StopAudioStreamForPlayer(playerid);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1);
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1);
new PlayerName[MAX_PLAYER_NAME],string[51];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "%s has spawned successfully.", PlayerName);
SendClientMessageToAll(0xFFFFFFFF, string);
return 1;
}
Re: OnPlayerSpawn is not called -
Saddin - 04.03.2017
not working...
Re: OnPlayerSpawn is not called -
SyS - 04.03.2017
Do you have any runtime error ? Check server log and also run server with crash detect
Re: OnPlayerSpawn is not called -
Saddin - 04.03.2017
Quote:
Originally Posted by Sreyas
Do you have any runtime error ? Check server log and also run server with crash detect
|
i checked server.cfg for crashdetector and i noticed i didn't put .so extension on any plugin i added, thanks for that, helped me, really stupid thing..
now i checked the log and i got 1 runtime error:
[16:30:52] [debug] Run time error 20: "Invalid index parameter (bad entry point)"
Re: OnPlayerSpawn is not called -
NaS - 04.03.2017
Quote:
Originally Posted by Saddin
i checked server.cfg for crashdetector and i noticed i didn't put .so extension on any plugin i added, thanks for that, helped me, really stupid thing..
now i checked the log and i got 1 runtime error:
[16:30:52] [debug] Run time error 20: "Invalid index parameter (bad entry point)"
|
No AddPlayerClass in OnGameModeInit?
Re: OnPlayerSpawn is not called -
Saddin - 04.03.2017
Quote:
Originally Posted by NaS
No AddPlayerClass in OnGameModeInit?
|
no because i dont want to use those player classes, im making rp kind of script
Re: OnPlayerSpawn is not called -
SyS - 04.03.2017
Add main(){} to your gm
Re: OnPlayerSpawn is not called -
Saddin - 04.03.2017
Quote:
Originally Posted by Sreyas
Add main(){} to your gm
|
i have that already
Re: OnPlayerSpawn is not called -
NaS - 04.03.2017
Quote:
Originally Posted by Saddin
no because i dont want to use those player classes, im making rp kind of script
|
You need to add classes (1 at least to be exact), there is no way around that!
What you mean is probably UsePlayerPedAnims (which affects the movement style of all skins)?
Re: OnPlayerSpawn is not called -
Toroi - 04.03.2017
Quote:
Originally Posted by NaS
You need to add classes (1 at least to be exact), there is no way around that!
What you mean is probably UsePlayerPedAnims (which affects the movement style of all skins)?
|
You are not forced to add any class if you want, it's not needed at all for everything else to work.
Re: OnPlayerSpawn is not called -
Saddin - 04.03.2017
Quote:
Originally Posted by NaS
You need to add classes (1 at least to be exact), there is no way around that!
What you mean is probably UsePlayerPedAnims (which affects the movement style of all skins)?
|
I dont mean that, i know gamemodes that dont have AddPlayerClass and still works, but i dont know whats wrong with this...