command debugging/bugging/halting(not crashing) the server.
#1

this command is somewhat, weird. when i type /v bus, it crashes the server,ym friend types /v bus, it doesnt crahs whenhe types it, crashs when i do and my other friend does. tested many times.
friend reported today, he typed /v fbi, then the server went bugged

- By Bugged I Completely Mean, The Server Makes Ppl Can't Connect. There Game Stops At Connected. Joining The Game.

And the players that were in the server - they get bugged , they cant type or anything

pawn Код:
CMD:v(playerid,params[])
{
    if(PlayerInfo[playerid][AdminLevel] >= 0 || IsPlayerAdmin(playerid))
    {
        new vname[25];
        if(sscanf(params,"s[25]",vname)) return SendClientMessage(playerid,RED,"Usage: /v [Vehiclename]");
        if(aveh[playerid] != 0) DestroyVehicle(aveh[playerid]);
        new Float:X,Float:Y,Float:Z,Float:ROT;
        GetPlayerPos(playerid,X,Y,Z);
        GetPlayerFacingAngle(playerid,ROT);
        if(IsNumeric(vname))
        {
            if(!IsValidVehicle(strval(vname))) return SendClientMessage(playerid,RED,"Error:Invalid Vehicleid");
            aveh[playerid] = CreateVehicle(strval(vname),X,Y,Z,ROT,-1,-1,60);
            SetVehicleHealth(aveh[playerid],997);
        }
        else
        {
            if(!IsValidVehicle(ReturnVehicleID(vname))) return SendClientMessage(playerid,RED,"Error:Invalid Name");
            aveh[playerid] = CreateVehicle(ReturnVehicleID(vname),X,Y,Z,ROT,-1,-1,60);
            SetVehicleHealth(aveh[playerid],997);
        }
        PutPlayerInVehicle(playerid, aveh[playerid], 0);
        AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
        LinkVehicleToInterior(aveh[playerid], GetPlayerInterior(playerid));
        SetVehicleVirtualWorld(aveh[playerid], GetPlayerVirtualWorld(playerid));
    }
    return 1;
}
Reply
#2

Maybe its because you have two consecutive else's. (and only one if)
eg, you cant have if >> else >> else. The correct format would be if >> else if >> else.
Reply
#3

i just added that last else if, ingore that sorry lol.

also

pawn Код:
ReturnVehicleID(vName[])//by Ryder
{
    Loop(x, 211)
    {
        if(strfind(aVehicleNames[x], vName, true) != -1)
        return x + 400;
    }
    return -1;
}
Reply
#4

Show IsValidVehicle function.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)