SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 27/12/2010, 05:39 PM   #1
The_Gangstas
Huge Clucker
 
Join Date: Nov 2010
Posts: 482
Reputation: 0
Default command debugging/bugging/halting(not crashing) the server.

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 Code:
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;
}
__________________
The_Gangstas is offline  
Old 27/12/2010, 05:46 PM   #2
iggy1
High-roller
 
iggy1's Avatar
 
Join Date: Mar 2009
Location: One past the end.
Posts: 2,421
Reputation: 273
Default Re: command debugging/bugging/halting(not crashing) the server.

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.
iggy1 is offline  
Old 27/12/2010, 05:55 PM   #3
The_Gangstas
Huge Clucker
 
Join Date: Nov 2010
Posts: 482
Reputation: 0
Default Re: command debugging/bugging/halting(not crashing) the server.

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

also

pawn Code:
ReturnVehicleID(vName[])//by Ryder
{
    Loop(x, 211)
    {
        if(strfind(aVehicleNames[x], vName, true) != -1)
        return x + 400;
    }
    return -1;
}
__________________
The_Gangstas is offline  
Old 27/12/2010, 08:21 PM   #4
MadeMan
High-roller
 
MadeMan's Avatar
 
Join Date: Jun 2007
Posts: 3,488
Reputation: 256
Default Re: command debugging/bugging/halting(not crashing) the server.

Show IsValidVehicle function.
MadeMan is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
weapon anticheat bugging the server The_Gangstas Help Archive 2 24/12/2010 05:53 AM
command crashing server Hornet600 Help Archive 3 13/12/2010 08:45 PM
Debugging Help Tim_Ethen Help Archive 1 08/10/2010 10:48 PM
Command sometimes crashing server Robbin237 Help Archive 1 28/04/2009 11:04 AM
Compiled 100% success and Server is crashing when using this command! silvan Help Archive 5 12/04/2009 08:19 AM


All times are GMT. The time now is 11:51 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.