Car system...
#1

I've posted twice about my car system and nobody gave a straight answer!

Don't say "Stop posting about the same topic" or something useless like that.

Give me a straight answer. How the fuck do i fix this car system?

pawn Код:
if(strcmp(cmd, "/buy", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
            new playername[MAX_PLAYER_NAME];
            GetPlayerName(playerid, playername, sizeof(playername));
            if(IsPlayerInAnyVehicle(playerid))
            {
                if(Cars[GetPlayerVehicleID(playerid)][cOwned] == 1)
                {
            SendClientMessage(playerid,c_r,"[ ! ] This car is bought !");
            return 1;
            }
                if(Cars[GetPlayerVehicleID(playerid)][cPrice] == 0)
                {
                SendClientMessage(playerid, c_r, "[ ! ] A price isn't set for this car, it is not meant to be bought!");
                return 1;
                }
                if(PlayerInfo[playerid][pCarKey] != 255 && strcmp(playername, Cars[GetPlayerVehicleID(playerid)][cOwner], true) == 0)
                {
                SendClientMessage(playerid, c_r, "[ ! ] You can only own one car, sell your original car first before buying this one!");
                return 1;
                }
                if(GetPlayerRcash(playerid) >= Cars[GetPlayerVehicleID(playerid)][cPrice])
                {
                new c;
                PlayerInfo[playerid][pCarKey] = c;
                Cars[GetPlayerVehicleID(playerid)][cOwned] = 1;
                strmid(Cars[GetPlayerVehicleID(playerid)][cOwner], playername, 0, strlen(playername), 255);
                GivePlayerRcash(playerid,-Cars[GetPlayerVehicleID(playerid)][cPrice]);
                format(string,sizeof(string),"[ ! ] You have successfully purchased this %s!",Cars[GetPlayerVehicleID(playerid)][cDescription]);
                SendClientMessage(playerid, COLOR_GREEN, string);
                SaveCars();
                OnPlayerDataSave(playerid);
                return 1;
                }
                else
                {
                SendClientMessage(playerid, c_r, "[ ! ] You don't have enough Money!");
                return 1;
                }
            }
        }
        return 1;
    }
    if(strcmp(cmd, "/sell", true) == 0)
    {
      if(IsPlayerConnected(playerid))
        {
            new playername[MAX_PLAYER_NAME];
            new car = PlayerInfo[playerid][pCarKey];
            GetPlayerName(playerid, playername, sizeof(playername));
            if(PlayerInfo[playerid][pCarKey] != 255 && strcmp(playername, Cars[PlayerInfo[playerid][pCarKey]][cOwner], true) == 0)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    if(Cars[car][cOwned] == 0)
                  {
                  SendClientMessage(playerid,c_r,"[ ! ] This car is not owned by you !");
                  return 1;
                  }
                    Cars[car][cOwned] = 0;
                    strmid(Cars[car][cOwner], "None", 0, strlen("None"), 255);
                    GivePlayerRcash(playerid,Cars[car][cPrice]);
                    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                    format(string, sizeof(string), "[ ! ] You have sold your %s for %i Rcash!",Cars[car][cDescription],Cars[car][cPrice]);
                    SendClientMessage(playerid, COLOR_GREEN, string);
                PlayerInfo[playerid][pCarKey] = 255;
                    OnPlayerDataSave(playerid);
                    SaveCars();
                    return 1;
                }
                else
                {
                  SendClientMessage(playerid,c_r,"[ ! ] You must be inside your car to sell it!");
                }
            }
            else
            {
            SendClientMessage(playerid,c_r,"[ ! ] You don't even own a car!");
            }
        }
        return 1;
    }
It always says when i buy a car its a turismo ( ID 0 ) when i need to make it for the other cars. ( Cheetah and Infernus )

So what do i do to make this work?
Reply
#2

ffs another post like this...
Reply
#3

Stop spaming, it's not surprising that no one helps you.
Read the rule about bumping.
Reply
#4

Haven't you noticed I sent pm to you days ago?
Reply
#5

Yeah i noticed your Pm it just fucked up my GM completely i couldnt load it ...
Reply
#6

Youve created 5 separate topics on this issue.

This code comes from and existing FS located here: http://forum.sa-mp.com/index.php?topic=78765.0

Ask your questions in there. Don't make another thread here about it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)