onPlayerSpawn - 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)
+--- Thread: onPlayerSpawn (
/showthread.php?tid=651099)
onPlayerSpawn -
EvgeniyHostel1992 - 13.03.2018
Hellow! the Player spawn in Las Venturas
PHP код:
OnPlayerSpawn
new gr = pl[playerid][pMember];
setpos(playerid,fl[gr][fSpawnx],fl[gr][fSpawny],fl[
gr][fSpawnz]);
setint(playerid,fl[gr][fInt]);
setworld(playerid,fl[gr][fWorld]);
the code works in CMD=)
loads and saves MYSQL -okey!
but the code does not work in public OnPlayerSpawn
(((( spawn in las venturas
Re: onPlayerSpawn -
PepsiCola23 - 13.03.2018
give us the entire code
Re: onPlayerSpawn -
EvgeniyHostel1992 - 13.03.2018
the code works everywhere except OnPlayerSpawn. spawn in Las Venturas
Re: onPlayerSpawn -
EvgeniyHostel1992 - 14.03.2018
PHP код:
public OnPlayerSpawn(playerid)
{
new fracspawn;
fracspawn = pl[playerid][pLeader];
SetPlayerSkin(playerid, pl[playerid][pChar]);
SetPlayerScore(playerid,pl[playerid][pLevel]);
InitLockDoors(playerid);
TextDrawHideForPlayer(playerid,SpeedShow[playerid]);
TextDrawHideForPlayer(playerid,Benzin[playerid]);
if(fracspawn >0)
{
setpos(playerid,fl[fracspawn][fSpawnx],fl[fracspawn][fSpawny],fl[fracspawn][fSpawnz]);
setint(playerid,fl[fracspawn][fInt]);
setworld(playerid,fl[fracspawn][fWorld]);
GivePlayerWeapon(playerid,fl[fracspawn][fGun1],fl[fracspawn][fAmmo1]);
}
else
{
setint(playerid,4);
setworld(playerid,0);
setpos(playerid,-1435.75, -652.664, 1054.94);
return 1;
}
return 1;
}
check for fraction (leaders) - and SPAWN in Las Venturas
Re: onPlayerSpawn -
EvgeniyHostel1992 - 14.03.2018
I write modes from NEW.PWN, inserted the spawn coordinates in OnPlayerSpawn - nothing happens, only spawn in Las Venturas
Re: onPlayerSpawn -
Maximun - 14.03.2018
You're not even clearly and you wait for us to solve your problem, you just repeat 'spawn in las venturas' in all your posts. Having a problem with 'OnPlayerSpawn' ? It always makes you at Las Venturas ?
Try to explain us what's your issue with this one code ?
PHP код:
if(fracspawn >0) //If player is a leader, so he must spawn in Las Venturas ?
{
setpos(playerid,fl[fracspawn][fSpawnx],fl[fracspawn][fSpawny],fl[fracspawn][fSpawnz]);
setint(playerid,fl[fracspawn][fInt]);
setworld(playerid,fl[fracspawn][fWorld]);
GivePlayerWeapon(playerid,fl[fracspawn][fGun1],fl[fracspawn][fAmmo1]);
}
else
{
setint(playerid,4);
setworld(playerid,0);
setpos(playerid,-1435.75, -652.664, 1054.94);
return 1;
}
Also, we need some informations about that, is theses float loaded from Mysql ?
Код:
fl[fracspawn][fSpawnx],fl[fracspawn][fSpawny],fl[fracspawn][fSpawnz]
Re: onPlayerSpawn -
EvgeniyHostel1992 - 14.03.2018
with code all ok! FIXED the problem!!!! >
PHP код:
if(newstate == PLAYER_STATE_SPAWNED)
{
SetPlayerSpawn(playerid);
SetPlayerHealth(playerid,90);
}
OnPlayerStateChange