SA-MP Forums Archive
Errors with a cmd - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Errors with a cmd (/showthread.php?tid=619124)



Errors with a cmd - Uberanwar - 14.10.2016

Fixed


Re: Errors with a cmd - Uberanwar - 14.10.2016

Okay what the hell, those **** symbols are not supposed to be there....


Re: Errors with a cmd - Mencent - 14.10.2016

Quote:
Originally Posted by Uberanwar
Посмотреть сообщение
Okay what the hell, those **** symbols are not supposed to be there....
When you use Microsoft Edge it's the problem of this browser. I had the same problem and now I use ****** Chrome.

Small Notice: You must use AttachDynamicObjectToVehicle because you use the streamer. The same for IsValidObject => IsValidDynamicObject

Change this and maybe the problem will be gone. I think not but I will look where the problem can be.

- EDIT:
Maybe try this:
PHP код:
CMD:flash(playerid,params[])
{
    if(
pInfo[playerid][FactionTier] > && IsLEOfficer(playerid))return SendClientMessage(playerid,RED,"ERROR:{FFFFFF} You must be a Law Enforcement Officer and obove Tier 2.");
    new 
veh GetPlayerVehicleID(playerid);
    if(!
GetVehicleModel(veh))return SendClientMessage(playerid,RED,"ERROR:{FFFFFF} You are not in a vehicle.");
    if(
GetPlayerState(playerid) != PLAYER_STATE_DRIVER)return SendClientMessage(playerid,RED,"ERROR: {FFFFFF} You are not the driver.");
    if(
IsValidDynamicObject(flash[veh]) || IsValidDynamicObject(flash2[veh]))
    {
        
SendClientMessage(playerid,GetPlayerColor(playerid),"LEO:{FFFFFF} Lights switched off, deactivating CODE 2.");
        
DestroyObject(flash[veh]);
        
DestroyObject(flash2[veh]);
        return 
1;
    }
    switch(
GetVehicleModel(veh))
    {
        case 
596:
        {
            
flash[veh] = CreateDynamicObject(186460.00.00.00.00.00.0);
            
flash2[veh] = CreateDynamicObject(186460.00.00.00.00.00.0);
            
AttachDynamicObjectToVehicle(flash[veh], veh0.599999,-0.375000,0.899999,0.000000,0.000000,0.000000);
            
AttachDynamicObjectToVehicle(flash2[veh], veh, -0.599999,-0.375000,0.899999,0.000000,0.000000,0.000000);
        }
        case 
597:
        {
            
flash[veh] = CreateDynamicObject(186460.00.00.00.00.00.0);
            
flash2[veh] = CreateDynamicObject(186460.00.00.00.00.00.0);
               
AttachDynamicObjectToVehicle(flash[veh], veh0.599999,-0.375000,0.899999,0.000000,0.000000,0.000000);
            
AttachDynamicObjectToVehicle(flash2[veh], veh, -0.599999,-0.375000,0.899999,0.000000,0.000000,0.000000);
        }
        case 
598:
        {
            
flash[veh] = CreateDynamicObject(186460.00.00.00.00.00.0);
            
flash2[veh] = CreateDynamicObject(186460.00.00.00.00.00.0);
            
AttachDynamicObjectToVehicle(flash[vid], veh0.524999, -0.3000000.8999990.0000000.0000000.000000);
            
AttachDynamicObjectToVehicle(flash2[vid], veh, -0.524999, -0.3000000.8999990.0000000.0000000.000000);
        }
        case 
599:
        {
            
flash[veh] = CreateDynamicObject(186460.00.00.00.00.00.0);
            
flash2[veh] = CreateDynamicObject(186460.00.00.00.00.00.0);
            
AttachDynamicObjectToVehicle(flash[veh], veh0.524999,0.000000,1.125000,0.000000,0.000000,0.000000);
            
AttachDynamicObjectToVehicle(flash2[veh], veh, -0.524999,0.000000,1.125000,0.000000,0.000000,0.000000);
        }
        case 
541:
        {
            
flash[veh] = CreateDynamicObject(186460.00.00.00.00.00.0);
            
AttachDynamicObjectToVehicle(flash[veh], veh0.375000,0.524999,0.375000,0.000000,0.000000,0.000000);
        }
        case 
426:
        {
            
flash[veh] = CreateDynamicObject(186460.00.00.00.00.00.0);
            
AttachDynamicObjectToVehicle(flash[veh], veh0.524999,0.749999,0.375000,0.000000,0.000000,0.000000);
        }
        case 
560:
        {
            
flash[veh] = CreateDynamicObject(186460.00.00.00.00.00.0);
            
AttachDynamicObjectToVehicle(flash[veh], veh0.225000,0.750000,0.449999,0.000000,0.000000,0.000000);
        }
        case 
490:
        {
            
flash[veh] = CreateDynamicObject(186460.00.00.00.00.00.0);
            
AttachDynamicObjectToVehicle(flash[veh], veh0.000000,1.125000,0.599999,0.000000,0.000000,0.000000);
        }
        default:
        {
            return 
SendClientMessage(playeridRED"ERROR: {FFFFFF}You are not in a compatible vehicle.");
        }
    }
    
SendClientMessage(playeridGetPlayerColor(playerid), "LEO: {FFFFFF}Lights swithed on, activating CODE 2.");
    return 
true;




Re: Errors with a cmd - Uberanwar - 15.10.2016

Quote:
Originally Posted by Mencent
Посмотреть сообщение
When you use Microsoft Edge it's the problem of this browser. I had the same problem and now I use ****** Chrome.

Small Notice: You must use AttachDynamicObjectToVehicle because you use the streamer. The same for IsValidObject => IsValidDynamicObject

Change this and maybe the problem will be gone. I think not but I will look where the problem can be.

- EDIT:
Maybe try this:
PHP код:
CMD:flash(playerid,params[])
{
    if(
pInfo[playerid][FactionTier] > && IsLEOfficer(playerid))return SendClientMessage(playerid,RED,"ERROR:{FFFFFF} You must be a Law Enforcement Officer and obove Tier 2.");
    new 
veh GetPlayerVehicleID(playerid);
    if(!
GetVehicleModel(veh))return SendClientMessage(playerid,RED,"ERROR:{FFFFFF} You are not in a vehicle.");
    if(
GetPlayerState(playerid) != PLAYER_STATE_DRIVER)return SendClientMessage(playerid,RED,"ERROR: {FFFFFF} You are not the driver.");
    if(
IsValidDynamicObject(flash[veh]) || IsValidDynamicObject(flash2[veh]))
    {
        
SendClientMessage(playerid,GetPlayerColor(playerid),"LEO:{FFFFFF} Lights switched off, deactivating CODE 2.");
        
DestroyObject(flash[veh]);
        
DestroyObject(flash2[veh]);
        return 
1;
    }
    switch(
GetVehicleModel(veh))
    {
        case 
596:
        {
            
flash[veh] = CreateDynamicObject(186460.00.00.00.00.00.0);
            
flash2[veh] = CreateDynamicObject(186460.00.00.00.00.00.0);
            
AttachDynamicObjectToVehicle(flash[veh], veh0.599999,-0.375000,0.899999,0.000000,0.000000,0.000000);
            
AttachDynamicObjectToVehicle(flash2[veh], veh, -0.599999,-0.375000,0.899999,0.000000,0.000000,0.000000);
        }
        case 
597:
        {
            
flash[veh] = CreateDynamicObject(186460.00.00.00.00.00.0);
            
flash2[veh] = CreateDynamicObject(186460.00.00.00.00.00.0);
               
AttachDynamicObjectToVehicle(flash[veh], veh0.599999,-0.375000,0.899999,0.000000,0.000000,0.000000);
            
AttachDynamicObjectToVehicle(flash2[veh], veh, -0.599999,-0.375000,0.899999,0.000000,0.000000,0.000000);
        }
        case 
598:
        {
            
flash[veh] = CreateDynamicObject(186460.00.00.00.00.00.0);
            
flash2[veh] = CreateDynamicObject(186460.00.00.00.00.00.0);
            
AttachDynamicObjectToVehicle(flash[vid], veh0.524999, -0.3000000.8999990.0000000.0000000.000000);
            
AttachDynamicObjectToVehicle(flash2[vid], veh, -0.524999, -0.3000000.8999990.0000000.0000000.000000);
        }
        case 
599:
        {
            
flash[veh] = CreateDynamicObject(186460.00.00.00.00.00.0);
            
flash2[veh] = CreateDynamicObject(186460.00.00.00.00.00.0);
            
AttachDynamicObjectToVehicle(flash[veh], veh0.524999,0.000000,1.125000,0.000000,0.000000,0.000000);
            
AttachDynamicObjectToVehicle(flash2[veh], veh, -0.524999,0.000000,1.125000,0.000000,0.000000,0.000000);
        }
        case 
541:
        {
            
flash[veh] = CreateDynamicObject(186460.00.00.00.00.00.0);
            
AttachDynamicObjectToVehicle(flash[veh], veh0.375000,0.524999,0.375000,0.000000,0.000000,0.000000);
        }
        case 
426:
        {
            
flash[veh] = CreateDynamicObject(186460.00.00.00.00.00.0);
            
AttachDynamicObjectToVehicle(flash[veh], veh0.524999,0.749999,0.375000,0.000000,0.000000,0.000000);
        }
        case 
560:
        {
            
flash[veh] = CreateDynamicObject(186460.00.00.00.00.00.0);
            
AttachDynamicObjectToVehicle(flash[veh], veh0.225000,0.750000,0.449999,0.000000,0.000000,0.000000);
        }
        case 
490:
        {
            
flash[veh] = CreateDynamicObject(186460.00.00.00.00.00.0);
            
AttachDynamicObjectToVehicle(flash[veh], veh0.000000,1.125000,0.599999,0.000000,0.000000,0.000000);
        }
        default:
        {
            return 
SendClientMessage(playeridRED"ERROR: {FFFFFF}You are not in a compatible vehicle.");
        }
    }
    
SendClientMessage(playeridGetPlayerColor(playerid), "LEO: {FFFFFF}Lights swithed on, activating CODE 2.");
    return 
true;

Greatly appreciated, thank you! Here's a rep