onPlayerSpawn
#1

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
Reply
#2

give us the entire code
Reply
#3

the code works everywhere except OnPlayerSpawn. spawn in Las Venturas
Reply
#4

PHP код:
public OnPlayerSpawn(playerid)
{
    new 
fracspawn;
    
fracspawn pl[playerid][pLeader];
    
SetPlayerSkin(playeridpl[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.6641054.94);
        return 
1;
    }
    return 
1;

check for fraction (leaders) - and SPAWN in Las Venturas
Reply
#5

I write modes from NEW.PWN, inserted the spawn coordinates in OnPlayerSpawn - nothing happens, only spawn in Las Venturas
Reply
#6

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.6641054.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]
Reply
#7

with code all ok! FIXED the problem!!!! >

PHP код:
if(newstate == PLAYER_STATE_SPAWNED)
    {
        
SetPlayerSpawn(playerid);
        
SetPlayerHealth(playerid,90);
    } 
OnPlayerStateChange
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)