How to fix ?
#1

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

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.
Reply
#3

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

Reply
#4

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

Reply
#5

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

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

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;

Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)