SA-MP Forums Archive
How to fix ? - 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: How to fix ? (/showthread.php?tid=593161)



How to fix ? - Commands - 02.11.2015

PHP код:
public OnPlayerSpawn(playerid);
{   {
    if(
Dead[playerid] == 1);
        
SetPlayerHealth(playerid100);
        
SetPlayerArmour(playerid100);
        
ResetPlayerWeapons(playerid);
        
GivePlayerWeapon(playerid26990);
    
GivePlayerWeapon(playerid28990);
    
GivePlayerWeapon(playerid24990);
    
GivePlayerWeapon(playerid34990);
    
SetPlayerInterior(playerid1);
    
SetPlayerPos(playerid1412.639892, -1.7875101000.924377);
    
SetPlayerVirtualWorld(playerid1);
    
Dead[playerid] == 0;
    }
    return 
1;

Errors :
Код:
C:\Users\Administrator\Documents\C5 School\School 2.pwn(118) : error 055: start of function body without function header
C:\Users\Administrator\Documents\C5 School\School 2.pwn(119) : error 010: invalid function or declaration
C:\Users\Administrator\Documents\C5 School\School 2.pwn(121) : error 021: symbol already defined: "SetPlayerHealth"
C:\Users\Administrator\Documents\C5 School\School 2.pwn(133) : error 010: invalid function or declaration
How to fix ?


Re: How to fix ? - Karan007 - 02.11.2015

PHP код:
public OnPlayerSpawn(playerid); 
{   
    if(
Dead[playerid] == 1); 
     {
        
SetPlayerHealth(playerid100); 
        
SetPlayerArmour(playerid100); 
        
ResetPlayerWeapons(playerid); 
        
GivePlayerWeapon(playerid26990); 
    
GivePlayerWeapon(playerid28990); 
    
GivePlayerWeapon(playerid24990); 
    
GivePlayerWeapon(playerid34990); 
    
SetPlayerInterior(playerid1); 
    
SetPlayerPos(playerid1412.639892, -1.7875101000.924377); 
    
SetPlayerVirtualWorld(playerid1); 
    
Dead[playerid] == 0
    } 
    return 
1

Try this one.


Re: How to fix ? - Commands - 02.11.2015

IF i try that, errors :
Quote:

C:\Users\Administrator\Documents\C5 School\School2.pwn(11 : error 055: start of function body without function header
C:\Users\Administrator\Documents\C5 School\School2.pwn(119) : error 010: invalid function or declaration
C:\Users\Administrator\Documents\C5 School\School2.pwn(133) : error 010: invalid function or declaration




Re: How to fix ? - Maximun - 02.11.2015

PHP код:
public OnPlayerSpawn(playerid); 
{  
    if(
Dead[playerid] == 1)
    {
        
SetPlayerHealth(playerid100); 
        
SetPlayerArmour(playerid100); 
        
ResetPlayerWeapons(playerid); 
        
GivePlayerWeapon(playerid26990); 
        
GivePlayerWeapon(playerid28990); 
        
GivePlayerWeapon(playerid24990); 
        
GivePlayerWeapon(playerid34990); 
        
SetPlayerInterior(playerid1); 
        
SetPlayerPos(playerid1412.639892, -1.7875101000.924377); 
        
SetPlayerVirtualWorld(playerid1); 
        
Dead[playerid] = 0
    } 
    return 
1




Re: How to fix ? - PrO.GameR - 02.11.2015

public OnPlayerSpawn(playerid); <<
Since when do you make a function like that ?
public OnPlayerSpawn(playerid)


Re: How to fix ? - iZN - 02.11.2015

You can't use a semicolon to end the statement which is being continued by braces { } or the statement itself hasn't ended. Semicolons are also not used in pre-processors.


Re: How to fix ? - AbyssMorgan - 02.11.2015

I recommend to buy a book xD
PHP код:
public OnPlayerSpawn(playerid){
    if(
Dead[playerid] == 1){
        
SetPlayerHealth(playerid100);
        
SetPlayerArmour(playerid100);
        
ResetPlayerWeapons(playerid);
        
GivePlayerWeapon(playerid26990);
        
GivePlayerWeapon(playerid28990);
        
GivePlayerWeapon(playerid24990);
        
GivePlayerWeapon(playerid34990);
        
SetPlayerInterior(playerid1);
        
SetPlayerPos(playerid1412.639892, -1.7875101000.924377);
        
SetPlayerVirtualWorld(playerid1);
        
Dead[playerid] = 0;
    }
    return 
1;