SA-MP Forums Archive
Small help with a stock - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Small help with a stock (/showthread.php?tid=195696)



Small help with a stock - Hornet600 - 03.12.2010

I made this stock
pawn Код:
stock VehicleNameID(vehicleid)
{
    new carname[50];
    if(GetVehicleModel(vehicleid) == 560) { carname = "landstalker"; }
    return vehicleid;
}
This is suppose to return the car name into this
pawn Код:
new vehname = VehicleNameID(carkey1);
pawn Код:
format(string, sizeof(string), " 1є : (%s) | KEY: (%d)",vehname,carkey1);
It displayers the int carkey1 but the vehnam is not showing the name of the vehicle

What i did wrong in this code?


Re: Small help with a stock - WillyP - 03.12.2010

pawn Код:
format(string, sizeof(string), " 1є : (%s) | KEY: (%d)",carname,carkey1);



Re: Small help with a stock - Hornet600 - 03.12.2010

it worked im making tests i tryed make something similiar with this code
pawn Код:
new carname1[50];
            new carname2[50];
            new carname3[50];
            carname1 = vehicleinfo[carkey1][VehicleName];
            carname2 = vehicleinfo[carkey2][VehicleName];
            carname3 = vehicleinfo[carkey3][VehicleName];
            if(playerinfo[playerid][vkey1] != 0)
            {
                format(string, sizeof(string), " 1є : (%s) | KEY: (%d)",carname1,carkey1);
                SendClientMessage(playerid, COLOR_GREEN, string);
            }
But it is not working now


Re: Small help with a stock - Hornet600 - 03.12.2010

It is querying alright and loading because the rest of the script works very good. What is wrong with it?

EDIT: At my field VehicleName in phpmyadmin it shows the name of the cars so its something wrong with my code


Re: Small help with a stock - Hornet600 - 03.12.2010

Yes but i want it to load from my vehicleinfo[vehicleid][VehicleName] at vehicle with i use carkey1 = playerinfo[playerid][vkey1] for example and it is working alright until i made this /v list wich is not reading the VehicleName for some reason lol