SA-MP Forums Archive
Help - Array Index! - 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: Help - Array Index! (/showthread.php?tid=630790)



Help - Array Index! - Kiko12135 - 18.03.2017

So when i use the command /tablicki i get 15 letters, but i whant to get only 5x
Anyone have solution to fix this problem, i think is in the array index!
+Rep for every help!

PHP код:
enum einfo 

MyVehTablicki[5]
}; 
new 
MyVehicle[MAX_MYVEHS][einfo]; 
PHP код:
new RandTablickiBukvi[5]; 
new 
RandTablickiBroj[3]; 
PHP код:
CMD:tablicki(playerid,params[])
{
 if(
PlayerInfo[playerid][pAdmin] >= 1337)
    {
        
RandomTablickiBukvi(RandTablickiBukvi);
        
RandomTablickiBroj(RandTablickiBroj);
        new 
str[144];
        new 
vehicleid GetPlayerVehicleID(playerid);
        
MyVehicle[ConvertVehIDtoDYID(vehicleid)][MyVehTablicki][0] = RandTablickiBukvi[0];
        
MyVehicle[ConvertVehIDtoDYID(vehicleid)][MyVehTablicki][1] = RandTablickiBukvi[1];
        
MyVehicle[ConvertVehIDtoDYID(vehicleid)][MyVehTablicki][2] = RandTablickiBukvi[2];
        
MyVehicle[ConvertVehIDtoDYID(vehicleid)][MyVehTablicki][3] = RandTablickiBukvi[3];
        
MyVehicle[ConvertVehIDtoDYID(vehicleid)][MyVehTablicki][4] = RandTablickiBukvi[4];
        if(!
IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleSeat(playerid) != 0) return SCM(playerid,COLOR_GRAD1,"{FF00FF}Ne ste vozac!");
        
format(strsizeof (str),"{FF0000}| Vaseto vozilo: {FFFFFF}%i {FF0000}| Nova Tablicka: {FF0000}%s%s%s%s%s |",vehicleid,MyVehicle[ConvertVehIDtoDYID(vehicleid)][MyVehTablicki][0],MyVehicle[ConvertVehIDtoDYID(vehicleid)][MyVehTablicki][1],MyVehicle[ConvertVehIDtoDYID(vehicleid)][MyVehTablicki][2],MyVehicle[ConvertVehIDtoDYID(vehicleid)][MyVehTablicki][3],MyVehicle[ConvertVehIDtoDYID(vehicleid)][MyVehTablicki][4]);
        
SCM(playerid,COLOR_GRAD1,str);
        
ZacuvajCarOwnerShip(ConvertVehIDtoDYID(vehicleid));
    }
    else
    {
     
SendClientMessage(playeridCOLOR_GRAD1"{FF4040}[RL-RP]>>[GRESKA]:{FFFFFF} {FFFFFF}Nemozete da ja koristite ovaa komanda.");
     }
    return 
1;




Re: Help - Array Index! - Hunud - 18.03.2017

Reduce new str[144];


Re: Help - Array Index! - Kiko12135 - 18.03.2017

Quote:
Originally Posted by Hunud
Посмотреть сообщение
Reduce new str[144];
How much can i get it?