error 010: invalid function or declaration
#1

I tried to use this spectating function but error spikes while compiling
Code:

PHP код:
new Spectating[MAX_PLAYERS],GettingSpectated[MAX_PLAYERS],Spectate[MAX_PLAYERS],SpecTime[MAX_PLAYERS];
SpectatePlayer(playeridgiveplayerid)
{
    if(
IsPlayerConnected(giveplayerid)) {
        if( 
InsideTut{giveplayerid} >= ) {
            
SendClientMessage(playeridCOLOR_WHITE"NOTE: This person is in the tutorial. Please consider this before assuming that they're air-breaking.");
        }
        if(
PlayerInfo[giveplayerid][pAccountRestricted]) SendClientMessage(playeridCOLOR_WHITE"NOTE: This person has their account restricted. Please consider this before assuming that they're health hacking.");
        if(
Spectating[playerid] == 0) {
            new 
FloatpPositions[3];
            
GetPlayerPos(playeridpPositions[0], pPositions[1], pPositions[2]);
            
SetPVarFloat(playerid"SpecPosX"pPositions[0]);
            
SetPVarFloat(playerid"SpecPosY"pPositions[1]);
            
SetPVarFloat(playerid"SpecPosZ"pPositions[2]);
            
SetPVarInt(playerid"SpecInt"GetPlayerInterior(playerid));
            
SetPVarInt(playerid"SpecVW"GetPlayerVirtualWorld(playerid));
            if(
IsPlayerInAnyVehicle(giveplayerid)) {
                
TogglePlayerSpectating(playeridtrue);
                new 
carid GetPlayerVehicleIDgiveplayerid );
                
PlayerSpectateVehicleplayeridcarid );
                
SetPlayerInteriorplayeridGetPlayerInteriorgiveplayerid ) );
                
SetPlayerVirtualWorldplayeridGetPlayerVirtualWorldgiveplayerid ) );
            }
            else if(
InsidePlane[giveplayerid] != INVALID_VEHICLE_ID) {
                
TogglePlayerSpectating(playeridtrue);
                
PlayerSpectateVehicle(playeridInsidePlane[giveplayerid]);
                
SetPlayerInterior(playeridGetPlayerInterior(giveplayerid));
                
SetPlayerVirtualWorld(playeridGetPlayerVirtualWorld(giveplayerid));
            }
            else {
                for(new 
02i++) {
                    
TogglePlayerSpectating(playeridtrue);
                    
PlayerSpectatePlayerplayeridgiveplayerid );
                    
SetPlayerInteriorplayeridGetPlayerInteriorgiveplayerid ) );
                    
SetPlayerVirtualWorldplayeridGetPlayerVirtualWorldgiveplayerid ) );
                }    
            }
            
GettingSpectated[giveplayerid] = playerid;
            if(
Spectate[playerid] != giveplayeridSpecTime[playerid] = gettime();
            
Spectate[playerid] = giveplayerid;
            
Spectating[playerid] = 1;
        }
        else {
            if(
IsPlayerInAnyVehicle(giveplayerid)) {
                
TogglePlayerSpectating(playeridtrue);
                new 
carid GetPlayerVehicleIDgiveplayerid );
                
PlayerSpectateVehicleplayeridcarid );
                
SetPlayerInteriorplayeridGetPlayerInteriorgiveplayerid ) );
                
SetPlayerVirtualWorldplayeridGetPlayerVirtualWorldgiveplayerid ) );
            }
            else if(
InsidePlane[giveplayerid] != INVALID_VEHICLE_ID) {
                
TogglePlayerSpectating(playeridtrue);
                
PlayerSpectateVehicle(playeridInsidePlane[giveplayerid]);
                
SetPlayerInterior(playeridGetPlayerInterior(giveplayerid));
                
SetPlayerVirtualWorld(playeridGetPlayerVirtualWorld(giveplayerid));
            }
            else {
                for(new 
02i++) {
                    
TogglePlayerSpectating(playeridtrue);
                    
PlayerSpectatePlayerplayeridgiveplayerid );
                    
SetPlayerInteriorplayeridGetPlayerInteriorgiveplayerid ) );
                    
SetPlayerVirtualWorldplayeridGetPlayerVirtualWorldgiveplayerid ) );
                }    
            }
            
GettingSpectated[Spectate[playerid]] = INVALID_PLAYER_ID;
            
GettingSpectated[giveplayerid] = playerid;
            if(
Spectate[playerid] != giveplayerid) {
                
SpecTime[playerid] = gettime();
                
Spectate[playerid] = giveplayerid;
                
Spectating[playerid] = 1;
            }
        }
        new 
string[64];
        
format(stringsizeof(string), "You are spectating %s (ID: %d)."PlayerICName(giveplayerid), giveplayerid);
        
SendClientMessage(playeridCOLOR_WHITEstring);
    }    
    return 
1//error 010: invalid function or declaration

Error
PHP код:
error 010invalid function or declaration 
Reply
#2

Quote:
Originally Posted by ******
Посмотреть сообщение
What error?
Код:
error 010: invalid function or declaration
Reply
#3

Try replacing this line:
Код:
if( InsideTut{giveplayerid} >= 1 ) {
With this:
Код:
if( InsideTut[giveplayerid] >= 1 ) {
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)