Help - Array Index!
#1

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;

Reply
#2

Reduce new str[144];
Reply
#3

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


Forum Jump:


Users browsing this thread: 2 Guest(s)