/exit command bugged
#1

Help me sir !! My /exit is bugged in house !!!

Code :

CMD:exit(playerid, params[])
{
if(GetPVarInt(playerid, "PBM") > 0) {
SendClientMessage(playerid, COLOR_WHITE, "You can't do this while being in a arena!");
return 1;
}
if(PlayerInfo[playerid][pJailed] > 0)
{
SendClientMessage(playerid, COLOR_WHITE, "You can't do this right now.");
return 1;
}
if(RobbingBank[playerid])
{
SendClientMessage(playerid, COLOR_WHITE, " You cannot /exit during robbery");
return 1;
}
new string[128];

for(new i = 0; i < sizeof(DDoorsInfo); i++) {
if(IsPlayerInRangeOfPoint(playerid,3,DDoorsInfo[i][ddInteriorX], DDoorsInfo[i][ddInteriorY], DDoorsInfo[i][ddInteriorZ]) && PlayerInfo[playerid][pVW] == DDoorsInfo[i][ddInteriorVW])
{
if(PlayerInfo[playerid][pMask] == 1) { format(string, sizeof(string), "* Stranger has exited the building %s.",DDoorsInfo[i][ddDescription]); }
else { format(string, sizeof(string), "* %s has exited the building %s.", GetPlayerNameEx(playerid), DDoorsInfo[i][ddDescription]); }
ProxDetector(25.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);

SetPlayerInterior(playerid,DDoorsInfo[i][ddExteriorInt]);
PlayerInfo[playerid][pInt] = DDoorsInfo[i][ddExteriorInt];
SetPlayerVirtualWorld(playerid, DDoorsInfo[i][ddExteriorVW]);
PlayerInfo[playerid][pVW] = DDoorsInfo[i][ddExteriorVW];
if(DDoorsInfo[i][ddCustomExterior]) {

LoadObjectsForPlayer(playerid);
}
if(DDoorsInfo[i][ddVehicleAble] > 0 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
SetVehiclePos(GetPlayerVehicleID(playerid), DDoorsInfo[i][ddExteriorX],DDoorsInfo[i][ddExteriorY],DDoorsInfo[i][ddExteriorZ]);
SetVehicleZAngle(GetPlayerVehicleID(playerid), DDoorsInfo[i][ddExteriorA]);
SetVehicleVirtualWorld(GetPlayerVehicleID(playerid ), DDoorsInfo[i][ddExteriorVW]);
LinkVehicleToInterior(GetPlayerVehicleID(playerid) , DDoorsInfo[i][ddExteriorInt]);
}
else {
SetPlayerPos(playerid,DDoorsInfo[i][ddExteriorX],DDoorsInfo[i][ddExteriorY],DDoorsInfo[i][ddExteriorZ]);
SetPlayerFacingAngle(playerid, DDoorsInfo[i][ddExteriorA]);
SetCameraBehindPlayer(playerid);
}
return Streamer_UpdateEx(playerid, DDoorsInfo[i][ddInteriorX],DDoorsInfo[i][ddInteriorY],DDoorsInfo[i][ddInteriorZ]);
}
}
for(new i = 0; i < sizeof(HouseInfo); i++) {
if(IsPlayerInRangeOfPoint(playerid,3,HouseInfo[i][hInteriorX], HouseInfo[i][hInteriorY], HouseInfo[i][hInteriorZ]) && PlayerInfo[playerid][pVW] == i+6000)
{
if(PlayerInfo[playerid][pMask] == 1) { format(string,sizeof(string), "* Stranger exited the house."); }
else { format(string, sizeof(string), "* %s has exited the house.", GetPlayerNameEx(playerid)); }
ProxDetector(25.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
if(HouseInfo[i][hCustomExterior])
{
LoadObjectsForPlayer(playerid);
}
SetPlayerPos(playerid,HouseInfo[i][hExteriorX],HouseInfo[i][hExteriorY],HouseInfo[i][hExteriorZ]);
SetPlayerFacingAngle(playerid, HouseInfo[i][hExteriorA]);
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid, 0);
PlayerInfo[playerid][pVW] = 0;
return Streamer_UpdateEx(playerid, HouseInfo[i][hExteriorX],HouseInfo[i][hExteriorY],HouseInfo[i][hExteriorZ]);
}
}
Reply
#2

Not sure if this solves your problem but it was missing a closing brace on the CMD function, i had to indent the code you provided. Also could you provide more information on the bug, i have not yet read your code.

here it is in a cleaned up form if anyone else wants to contribute.

PHP код:
CMD:exit(playeridparams[])
{
    if(
GetPVarInt(playerid"PBM") > 0
    {
        
SendClientMessage(playeridCOLOR_WHITE"You can't do this while being in a arena!");
        return 
1;
    }
    
    if(
PlayerInfo[playerid][pJailed] > 0)
    {
        
SendClientMessage(playeridCOLOR_WHITE"You can't do this right now.");
        return 
1;
    }
    
    if(
RobbingBank[playerid])
    {
        
SendClientMessage(playeridCOLOR_WHITE" You cannot /exit during robbery");
        return 
1;
    }
    
    new 
string[128];
    for(new 
0sizeof(DDoorsInfo); i++) 
    {
        if(
IsPlayerInRangeOfPoint(playerid,3,DDoorsInfo[i][ddInteriorX], DDoorsInfo[i][ddInteriorY], DDoorsInfo[i][ddInteriorZ]) && PlayerInfo[playerid][pVW] == DDoorsInfo[i][ddInteriorVW])
        {
            if(
PlayerInfo[playerid][pMask] == 1
            { 
                
format(stringsizeof(string), "* Stranger has exited the building %s.",DDoorsInfo[i][ddDescription]); 
            }
            else 
            { 
                
format(stringsizeof(string), "* %s has exited the building %s."GetPlayerNameEx(playerid), DDoorsInfo[i][ddDescription]); 
            }
            
            
ProxDetector(25.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
            
SetPlayerInterior(playerid,DDoorsInfo[i][ddExteriorInt]);
            
PlayerInfo[playerid][pInt] = DDoorsInfo[i][ddExteriorInt];
            
SetPlayerVirtualWorld(playeridDDoorsInfo[i][ddExteriorVW]);
            
PlayerInfo[playerid][pVW] = DDoorsInfo[i][ddExteriorVW];
            
            if(
DDoorsInfo[i][ddCustomExterior]) 
            {
                
LoadObjectsForPlayer(playerid);
            }
            
            if(
DDoorsInfo[i][ddVehicleAble] > && GetPlayerState(playerid) == PLAYER_STATE_DRIVER
            {
                
SetVehiclePos(GetPlayerVehicleID(playerid), DDoorsInfo[i][ddExteriorX],DDoorsInfo[i][ddExteriorY],DDoorsInfo[i][ddExteriorZ]);
                
SetVehicleZAngle(GetPlayerVehicleID(playerid), DDoorsInfo[i][ddExteriorA]);
                
SetVehicleVirtualWorld(GetPlayerVehicleID(playerid ), DDoorsInfo[i][ddExteriorVW]);
                
LinkVehicleToInterior(GetPlayerVehicleID(playerid) , DDoorsInfo[i][ddExteriorInt]);
            }
            else 
            {
                
SetPlayerPos(playerid,DDoorsInfo[i][ddExteriorX],DDoorsInfo[i][ddExteriorY],DDoorsInfo[i][ddExteriorZ]);
                
SetPlayerFacingAngle(playeridDDoorsInfo[i][ddExteriorA]);
                
SetCameraBehindPlayer(playerid);
            }
            return 
Streamer_UpdateEx(playeridDDoorsInfo[i][ddInteriorX],DDoorsInfo[i][ddInteriorY],DDoorsInfo[i][ddInteriorZ]);
        }
    }
    
    for(new 
0sizeof(HouseInfo); i++) 
    {
        if(
IsPlayerInRangeOfPoint(playerid,3,HouseInfo[i][hInteriorX], HouseInfo[i][hInteriorY], HouseInfo[i][hInteriorZ]) && PlayerInfo[playerid][pVW] == i+6000)
        {
            if(
PlayerInfo[playerid][pMask] == 1
            { 
                
format(string,sizeof(string), "* Stranger exited the house."); 
            }
            else 
            { 
                
format(stringsizeof(string), "* %s has exited the house."GetPlayerNameEx(playerid)); 
            }
            
            
ProxDetector(25.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
            
SetPlayerInterior(playerid,0);
            
PlayerInfo[playerid][pInt] = 0;
            
            if(
HouseInfo[i][hCustomExterior])
            {
                
LoadObjectsForPlayer(playerid);
            }
            
            
SetPlayerPos(playerid,HouseInfo[i][hExteriorX],HouseInfo[i][hExteriorY],HouseInfo[i][hExteriorZ]);
            
SetPlayerFacingAngle(playeridHouseInfo[i][hExteriorA]);
            
SetCameraBehindPlayer(playerid);
            
SetPlayerVirtualWorld(playerid0);
            
PlayerInfo[playerid][pVW] = 0;
            
            return 
Streamer_UpdateEx(playeridHouseInfo[i][hExteriorX],HouseInfo[i][hExteriorY],HouseInfo[i][hExteriorZ]);
        }
    }
}
//missing closing brace 
Reply
#3

What is missing closing brace sir
Reply
#4

Closing brace is '}'
Reply
#5

It's show here sir

Code:
C:\Documents and Settings\rjemms49\Desktop\DSRP\gamemodes\DSRP.PWN( 48321) : error 017: undefined symbol "COLOR_PURPL"
C:\Documents and Settings\rjemms49\Desktop\DSRP\gamemodes\DSRP.PWN( 48321) : error 017: undefined symbol "E"
C:\Documents and Settings\rjemms49\Desktop\DSRP\gamemodes\DSRP.PWN( 48321) : error 029: invalid expression, assumed zero
C:\Documents and Settings\rjemms49\Desktop\DSRP\gamemodes\DSRP.PWN( 48321) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#6

Where is line (48321) ?
Reply
#7

The cause of error is COLOR_PURPL E in this line :
Quote:

ProxDetector(25.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);

Just remove the space that is present before E in order to compile script without the error you are getting.
Reply
#8

Nothing is wrong with the code.

Head into <server files> - <server.cfg> and remove <gl_property> from the fliterscript settings.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)