Hello need help with spawnplayer.. -
Scrillex - 07.01.2014
SO basically it spawns where it needs to be.. but the problem is it doesn't show any mapping or something..
Even timer is not showing.. Idk why..
here is the code
pawn Код:
if(PlayerInfo[playerid][pNationality] == 0)
{
new rand = random(sizeof(whitemale));
SetPlayerSkin(playerid, whitemale[rand]);
PlayerInfo[playerid][pFrom] = 2;
PlayerInfo[playerid][pRegistred] = 1;
SetPlayerPos(playerid,-1876.8957519531, 58.365238189697, 1057.1906738281);
SetPlayerHealth(playerid, 100);
SetPlayerInterior(playerid,14);
TogglePlayerSpectating(playerid, 0);
SetTimerEx("UnfreezePlayer", 1500, 0, "i", playerid);
SpawnPlayer(playerid);
}
Idk why it spawns like in no where with CJ skin...
Maybe some one could say what is the prob.
Re: Hello need help with spawnplayer.. -
erminpr0 - 08.01.2014
Use SetSpawnInfo - SpawnPlayer
instead of SetPlayerSkin,SetPlayerPos,SetPlayerFacingAngle etc..
Re: Hello need help with spawnplayer.. -
Scrillex - 08.01.2014
Thank you for your answer and time.
Umm basically Idk how to set to random skin ..
maybe problem could be in here
Under OnPlayerSpawn
pawn Код:
if(PlayerInfo[playerid][pRegistred] == 1)
{
if (PlayerInfo[playerid][PosX] != 0 && PlayerInfo[playerid][PosY] != 0 && PlayerInfo[playerid][PosZ] != 0 && PlayerInfo[playerid][Angle] != 0 )
{
SetPlayerPos(playerid, PlayerInfo[playerid][PosX], PlayerInfo[playerid][PosY], PlayerInfo[playerid][PosZ]);
SetPlayerFacingAngle(playerid, PlayerInfo[playerid][Angle]);
SetPlayerInterior(playerid, PlayerInfo[playerid][Interior]);
SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][VirtualWorld]);
TogglePlayerSpectating(playerid, false);
SetPlayerArmour(playerid,PlayerInfo[playerid][pArmour]);
SetPlayerHealth(playerid,PlayerInfo[playerid][pHealth]);
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, PlayerInfo[playerid][SKILL_PISTOL]);
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, PlayerInfo[playerid][SKILL_PISTOL_SILENCED]);
SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, PlayerInfo[playerid][SKILL_DESERT_EAGLE]);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SHOTGUN, PlayerInfo[playerid][SKILL_SHOTGUN]);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, PlayerInfo[playerid][SKILL_SAWNOFF_SHOTGUN]);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SPAS12_SHOTGUN, PlayerInfo[playerid][SKILL_SPAS12_SHOTGUN]);
SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, PlayerInfo[playerid][SKILL_MICRO_UZI]);
SetPlayerSkillLevel(playerid, WEAPONSKILL_MP5, PlayerInfo[playerid][SKILL_MP5]);
SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, PlayerInfo[playerid][SKILL_AK47]);
SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, PlayerInfo[playerid][SKILL_M4]);
SetPlayerSkillLevel(playerid, WEAPONSKILL_SNIPERRIFLE, PlayerInfo[playerid][SKILL_SNIPERRIFLE]);
GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon1], PlayerInfo[playerid][Ammo1]);
GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon2], PlayerInfo[playerid][Ammo2]);
GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon3], PlayerInfo[playerid][Ammo3]);
GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon4], PlayerInfo[playerid][Ammo4]);
GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon5], PlayerInfo[playerid][Ammo5]);
GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon6], PlayerInfo[playerid][Ammo6]);
GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon7], PlayerInfo[playerid][Ammo7]);
GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon8], PlayerInfo[playerid][Ammo8]);
GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon9], PlayerInfo[playerid][Ammo9]);
GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon10], PlayerInfo[playerid][Ammo10]);
GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon11], PlayerInfo[playerid][Ammo11]);
GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapon12], PlayerInfo[playerid][Ammo12]);
SetPlayerSkin(playerid,PlayerInfo[playerid][pSkin]);
}
}
Re: Hello need help with spawnplayer.. -
jakejohnsonusa - 08.01.2014
Is this needed:
pawn Код:
TogglePlayerSpectating(playerid, 0);
Also, are you sure that this is giving a correct skin value:
Re: Hello need help with spawnplayer.. -
Scrillex - 08.01.2014
yeah i'm sure.. here is the code..
pawn Код:
new whitemale[] = {
1,2,3,6,20,23,26,32,33,34
};
yes it is needed because before spawning I don't want spawn textdraw to show...
Re: Hello need help with spawnplayer.. -
jakejohnsonusa - 08.01.2014
Are you SURE that the interior # is correct?
Re: Hello need help with spawnplayer.. -
Scrillex - 08.01.2014
Before that it was working.. Just idk in when it started to do kind a that thing.. I think when I added a save pos...
Re: Hello need help with spawnplayer.. -
Scrillex - 08.01.2014
Sorry for double post checked second spawn witch would be needed to be as bus stop.. it spawned me at LV basic spawn....
I think I found problem.. I had WriteString... not writeint so yeah.. that could be the issue.
Nop still the same issue...
Here is the issue as I think:
PlayerData:
pawn Код:
PositionX = 0.000000
PositionY = 0.000000
PositionZ = 0.000000
Angle = 0.000000
Interior = 14
VirtualWorld = 0
Health = 95.000000
Armor = 0.000000
ENUM:
OnPlayerDisconect
pawn Код:
INI_WriteFloat(File, "PositionX", PlayerInfo[playerid][PosX]);
INI_WriteFloat(File, "PositionY", PlayerInfo[playerid][PosY]);
INI_WriteFloat(File, "PositionZ", PlayerInfo[playerid][PosZ]);
INI_WriteFloat(File, "Angle", PlayerInfo[playerid][Angle]);
INI_WriteInt(File, "Interior", GetPlayerInterior(playerid));
INI_WriteInt(File, "VirtualWorld", GetPlayerVirtualWorld(playerid));
LOAD USER DATA
pawn Код:
INI_Float("PositionX", PlayerInfo[playerid][PosX]);
INI_Float("PositionY", PlayerInfo[playerid][PosY]);
INI_Float("PositionZ", PlayerInfo[playerid][PosZ]);
INI_Float("Angle", PlayerInfo[playerid][Angle]);
INI_Int( "Interior", PlayerInfo[playerid][Interior]);