SA-MP Forums Archive
Problem Whit Spam Auto - 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: Problem Whit Spam Auto (/showthread.php?tid=613450)



Problem Whit Spam Auto - AlexPalermitano97 - 27.07.2016

My vehicle system works like this:

The admin Create your car

PHP код:

CMD
:createveh(playeridparams[])
{
    new 
Float:x,Float:y,Float:z,Float:a;
    new 
modello,prezzocolore1,colore2,id;
    
GetPlayerPos(playeridx,y,z);
    
GetPlayerFacingAngle(playerida);
    if(
sscanf(params,"iiii",modello,prezzo,colore1,colore2)) return SCM(playeridCOMANDO_USARE"USARE: /creaveicolo <modello> <prezzo> <colore 1> <colore 2>");
    if(
modello 400 || modello 603) return SCM(playeridCOMANDO_USARE"ATTENZIONE: Inserisci un modello tra 400 e 603");
    if(
colore1 || colore1 186) return SCM(playeridCOMANDO_USARE"ATTENZIONE: Inserisci un colore tra 0 e 186");
    if(
colore2 || colore2 186) return SCM(playeridCOMANDO_USARE"ATTENZIONE: Inserisci un colore tra 0 e 186");
    if(
prezzo 1) return SCM(playeridCOMANDO_USARE"ATTENZIONE: Non puoi inserire un prezzo inferiore a 1$");
    for(new 
2;sizeof(VeicoloInfo);v++)//Loops through all the businesses
    
{
        if(
VeicoloInfo[v][vTipo] == 0)//Checks if the price of a business is 0.
        
{
            
id v;
            break;
//It stops looping if it is.
        
}
    }
    
CreateVehicle(modello,x,y,z,a,0,0,-1);
    
VeicoloInfo[id][vModello] = modello;
    
VeicoloInfo[id][vPrezzo] = prezzo;
    
VeicoloInfo[id][vTipo] = 1;
    
VeicoloInfo[id][vSpawnX] = x;
    
VeicoloInfo[id][vSpawnY] = z;
    
VeicoloInfo[id][vSpawnZ] = y;
    
VeicoloInfo[id][vSpawnA] = a;
    
VeicoloInfo[id][vArma1] = 0;
    
VeicoloInfo[id][vMunizioni1] = 0;
    
VeicoloInfo[id][vArma2] = 0;
    
VeicoloInfo[id][vMunizioni2] = 0;
    
VeicoloInfo[id][vVita] = 1000;
    
VeicoloInfo[id][vBenzina] = 100;
    
VeicoloInfo[id][vColore1] = colore1;
    
VeicoloInfo[id][vColore2] = colore2;
    
SetVehicleHealth(idVeicoloInfo[id][vVita]);
    
Salvaveh(id);
    return 
1;

The player buys the car and the park .

PHP код:

CMD
:buyvehicle(playeridparams[])
{
    if(
VeicoloInfo[GetPlayerVehicleID(playerid)][vTipo] == 1)
    {
        new 
id GetPlayerVehicleID(playerid);
        if(
id == -|| id == 0) return SCM(playeridCOMANDO_USARE"Non sei in un veicolo in vendita");
        if(
PlayerInfo[playerid][pAuto] > 0) return SCM(playeridROSSO"Hai giа un auto");
        if(
PlayerInfo[playerid][pCash] < VeicoloInfo[id][vPrezzo]) return SCM(playeridROSSO"Spiacenti, non hai abbastanza soldi.");
        
PlayerInfo[playerid][pAuto] = id;
        
PlayerInfo[playerid][pCash] -= VeicoloInfo[id][vPrezzo];
        
GivePlayerMoney(playerid, -VeicoloInfo[id][vPrezzo]);
        
VeicoloInfo[id][vProprieta] = 1;
        
VeicoloInfo[id][vProprietario] = RemoveUnderScore(playerid);
        
VeicoloInfo[id][vTipo] = 4;
        
SCM(playeridCOLOR_YELLOW"Hai acquistato il tuo veicolo,ricordati di parcheggiarlo (/parheggia) subito.");
        
Salvaveh(id);
        
Salvataggio(playerid);
    }
    return 
1;
}
CMD:parkveh(playeridparams[])
{
    if(
VeicoloInfo[GetPlayerVehicleID(playerid)][vTipo] == 4)
    {
        
/*
        new id = VeicoloInfo[GetPlayerVehicleID(playerid)][vProprieta];
        if(id != PlayerInfo[playerid][pAuto]) return SCM(playerid, COMANDO_USARE, "Non sei nel tuo veicolo");
        */
        
new id GetPlayerVehicleID(playerid);
        new 
id2 PlayerInfo[playerid][pAuto];
        if(
id != PlayerInfo[playerid][pAuto]) return SCM(playeridCOMANDO_USARE"Non sei nel tuo veicolo");
        if(
PlayerInfo[playerid][pAuto] == 0) return SCM(playeridROSSO"Non hai un veicolo di proprietа");
        new 
Float:x,Float:y,Float:z,Float:a;
        
GetPlayerPos(playeridxyz);
        
GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
        
VeicoloInfo[id2][vSpawnX] = x;
        
VeicoloInfo[id2][vSpawnY] = y;
        
VeicoloInfo[id2][vSpawnZ] = z;
        
VeicoloInfo[id2][vSpawnA] = a;
        
DestroyVehicle(id2);
        
CreateVehicle(VeicoloInfo[id2][vModello],VeicoloInfo[id2][vSpawnX],VeicoloInfo[id2][vSpawnY],VeicoloInfo[id2][vSpawnZ],VeicoloInfo[id2][vSpawnA],VeicoloInfo[id2][vColore1],VeicoloInfo[id2][vColore2],-1);
        
SCM(playeridROSSO"Hai parcheggiato qua il tuo veicolo");
        
Salvaveh(id);
        
Salvataggio(playerid);
    }
    return 
1;

If I restart the GM does not sprout the machines in the position where you save it if I put precise positions I check ..
If I put my hand coordinates all goes well , but if I put the coordinates from the vehicle files the car can not see , I do not us going even with the / goto but if I / getveh the car is .

This is a loadveh

PHP код:

public LoadVeh_data(vehicleid,name[],value[])
{
    
INI_Int("Proprieta",VeicoloInfo[vehicleid][vProprieta]);
    
INI_String("Proprietario",VeicoloInfo[vehicleid][vProprietario], 24);
    
INI_Int("Prezzo",VeicoloInfo[vehicleid][vPrezzo]);
    
INI_Int("Modello",VeicoloInfo[vehicleid][vModello]);
      
INI_Int("Tipo",VeicoloInfo[vehicleid][vTipo]);
    
INI_Float("SpawnA",VeicoloInfo[vehicleid][vSpawnA]);
    
INI_Float("SpawnX",VeicoloInfo[vehicleid][vSpawnX]);
    
INI_Float("SpawnY",VeicoloInfo[vehicleid][vSpawnY]);
    
INI_Float("SpawnZ",VeicoloInfo[vehicleid][vSpawnZ]);
    
INI_Int("Vita",VeicoloInfo[vehicleid][vVita]);
    
INI_Int("Arma1",VeicoloInfo[vehicleid][vArma1]);
    
INI_Int("Munizioni1",VeicoloInfo[vehicleid][vMunizioni1]);
    
INI_Int("Arma2",VeicoloInfo[vehicleid][vArma2]);
    
INI_Int("Munizioni2",VeicoloInfo[vehicleid][vMunizioni2]);
    
INI_Int("Benzina",VeicoloInfo[vehicleid][vBenzina]);
    
INI_Int("Colore1",VeicoloInfo[vehicleid][vColore1]);
    
INI_Int("Colore2",VeicoloInfo[vehicleid][vColore2]);
    return 
1;

So he does see:

PHP код:

CreateVehicle
(VeicoloInfo[idx5][vModello], 1534,-1612,13176VeicoloInfo[idx5][vColore2],VeicoloInfo[idx5][vColore2],-1); 
So he doesn't see
PHP код:
CreateVehicle(VeicoloInfo[idx5][vModello],VeicoloInfo[idx5][vSpawnX],VeicoloInfo[idx5][vSpawnY],VeicoloInfo[idx5][vSpawnZ],VeicoloInfo[idx5][vSpawnAVeicoloInfo[idx5][vColore2],VeicoloInfo[idx5][vColore2],-1); 
HELP ME,PLEASE


Re: Problem Whit Spam Auto - AlexPalermitano97 - 28.07.2016

Up!!


Re: Problem Whit Spam Auto - AlexPalermitano97 - 28.07.2016

UPPP