Server Crashes due to some weird reasons
#5

I'm using BlueG's Mysql R7, I'm looking forward to convert to the new one but It will take time and all of that, So I just want to fix the bugs in the script, Then upgrade the MySQL to the newest

EDIT: By the way, That crash also happens when performing the cmd "/createplayercar"

CMD:

PHP Code:
YCMD:createplayercar(playeridparams[], help) {
    new 
model,c1,c2,lock;
    new 
playa;
    if(
help) {
        
SendClientMessage(playeridX11_WHITE"Creates a car for a player");
        return 
1;
    }
    if (!
sscanf(params"k<playerLookup_acc>dddd"playa,modelc1c2lock))
    {
        if(!
IsPlayerConnectEx(playa)) {
            
SendClientMessage(playeridX11_WHITE"Error: player not connected");
            return 
1;
        }
        new 
EAdminFlags:aflags EAdminFlags:GetPVarInt(playerid"AdminFlags");
        if(
playerid == playa) {
            if(~
aflags EAdminFlags_CanRefundSelf) {
                
SendClientMessage(playeridX11_TOMATO_2"You cannot refund yourself!");
                return 
1;
            }
        }
        new 
Float:X,Float:Y,Float:Z,Float:A;
        
GetPlayerPos(playeridXYZ);
        
GetPlayerFacingAngle(playeridA);
        if(
c1 || c1 255 || c2 || c2 255)
        {
            
SendClientMessage(playeridX11_RED2"   Color ID can't be below 0 or above 255!");
            return 
1;
        }
        if(
lock || lock 7)
        {
            
SendClientMessage(playeridX11_RED2"   The lock ID can't be below 0 or above 7!");
            return 
1;
        }
        if(!
isValidModel(model)) {
            
SendClientMessage(playeridX11_RED2"   Invalid Vehicle Model");
            return 
1;
        }
        
CreatePlayerCar(playamodelc1c2XYZAELockType:lock);
        new 
string[128];
        
format(stringsizeof(string), "* Vehicle successfully created.");
        
SendClientMessage(playeridCOLOR_LIGHTGREENstring);
        
format(stringsizeof(string), "An admin added a %s to your cars."VehiclesName[model-400]);
        
SendClientMessage(playaX11_ORANGEstring);
        if(
GetPVarInt(playerid"AdminHidden") != 2) {
            
format(stringsizeof(string), "* %s has given %s a %s",GetPlayerNameEx(playeridENameType_AccountName), GetPlayerNameEx(playaENameType_CharName),  VehiclesName[model-400]);
            
ABroadcast(X11_YELLOWstringEAdminFlags_AdminManage);
        }
    } else {
        
SendClientMessage(playeridX11_WHITE"USAGE: /createplayercar [playerid/name] [model] [colour1] [colour2] [locktype]");
        
SendClientMessage(playeridX11_WHITE"Lock types: 0 = Default, 1 = Simple, 2 = remote, 3 = remote, 4 = advanced, 5 = satelitte, 6 = titanium laser, 7 = bio");
    }
    return 
1;

CreatePlayerCar stock.

PHP Code:
CreatePlayerCar(playeridmodelc1c2Float:XFloat:YFloat:ZFloat:AngleELockType:locktypeputincar 0) {
    
query[0] = 0;//[256];
    
format(query,sizeof(query),"INSERT INTO `playercars` (`owner`,`model`,`X`,`Y`,`Z`,`Angle`,`colour1`,`colour2`,`locktype`) VALUES (%d,%d,%f,%f,%f,%f,%d,%d,%d)",GetPVarInt(playerid"CharID"),model,X,Y,Z,Angle,c1,c2,_:locktype);
    
mysql_function_query(g_mysql_handlequerytrue"onPlayerVehicleCreate""ddddffffdd",playerid,model,c1,c2,X,Y,Z,Angle,_:locktype,putincar);
    return 
0;

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)