Car dealership system - Need help
#1

Hi!
I need a little help with my car dealership system.
If a player buys a car, I want t he car to spawn, not only write it to mysql, but to make the car spawn, I have to get it to select only the car, the player buyed and spawn that one, but I don't know, how to do it.

The code:
pawn Код:
CMD:sultan(playerid, params[])
{
    new string[555], omanikunimi[MAX_PLAYER_NAME];
    if(PlayerInfo[playerid][AutoV6ti] == 255)
    {
        GetPlayerName(playerid, omanikunimi, sizeof(omanikunimi));
        format(string, 555, "INSERT INTO `autod` (autoid, myygis, omanik, v2rv1, v2rv2, pargitudX, pargitudY, pargitudZ, parkimisangle, model, poesmyygis) VALUES ('5', '0', '%s', '1', '1', '-785.3877', '2753.9294', '45.2800', '235.9695', '411', '0')", omanikunimi);
        mysql_query(string);
    }
    else
    {
        SendClientMessage(playerid, punane, "U've already got a car!");
    }
    return 1;
}

((Translated frome Estonian ))
Reply
#2

pawn Код:
CMD:sultan(playerid, params[])
{
    new string[555], omanikunimi[MAX_PLAYER_NAME],Float:x, Float:y, Float:z;
    if(PlayerInfo[playerid][AutoV6ti] == 255)
    {
        GetPlayerName(playerid, omanikunimi, sizeof(omanikunimi));
        format(string, 555, "INSERT INTO `autod` (autoid, myygis, omanik, v2rv1, v2rv2, pargitudX, pargitudY, pargitudZ, parkimisangle, model, poesmyygis) VALUES ('5', '0', '%s', '1', '1', '-785.3877', '2753.9294', '45.2800', '235.9695', '411', '0')", omanikunimi);
        mysql_query(string);
        GetPlayerPos(playerid, x, y, z);
        CreateVehicle(560,x, y, z, 0, 1, 1, -1);
    }
    else
    {
        SendClientMessage(playerid, punane, "U've already got a car!");
    }
    return 1;
}
Reply
#3

Aam... The car has to be created with the MySQL info.

autoid - carid
myygis- on sale
omanik - owner
v2rv1 - color1
v2rv2 - color2
pargitudXYZ - parkedXYZ (It should spawn at the parking position)
parkimisangle - parkangle (The angle, it should spawn with)
model - model
poesmyygys - carshopsale
Reply
#4

Anyone?
Reply
#5

Bump1
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)