System Car Personal
#1

hello .happy holiday.
so. when type /v buy for yo buy a ner personal car : i said this ! you have already 3 cars lacking none.i use this command :

Quote:

if(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/vehicle", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new x_nr[64];
x_nr = strtok(cmdtext, idx);
if(!strlen(x_nr))
{
SendClientMessage(playerid, COLOR_WHITE, "HINT: (/v)ehicle [name]");
SendClientMessage(playerid, COLOR_WHITE, "Available names: park, lock(1-3), color, model, locate(1-3), tow(1-3)");
return 1;
}
else if(strcmp(x_nr,"buy",true) == 0)
{
if(IsAnOwnableCar(idcar))
{
if(PlayerInfo[playerid][pPcarkey] != -1 && PlayerInfo[playerid][pPcarkey2] != -1 &&
PlayerInfo[playerid][pPcarkey3] != -1)
{
new tmp_str[128];
format(tmp_str,sizeof(tmp_str),"Vehicles: %d %d %d",PlayerInfo[playerid][pPcarkey],PlayerInfo[playerid][pPcarkey2],PlayerInfo[playerid][pPcarkey3]);
SendClientMessage(playerid,-1,tmp_str);
SendClientMessage(playerid, COLOR_GREY, " Ai deja 3 masini!!");
return 1;
}
if(CarInfo[idcar][cOwned]==1)
{
SendClientMessage(playerid, COLOR_GREY, "Someone already owns this car");
return 1;
}
if(GetPlayerMoney(playerid) >= CarInfo[idcar][cValue])
{
if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = idcar; }
else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = idcar; }
else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = idcar; }
else { return 1; }
CarInfo[idcar][cOwned] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
strmid(CarInfo[idcar][cOwner], sendername, 0, strlen(sendername), 999);
GivePlayerMoney(playerid,-CarInfo[idcar][cValue]);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);
SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");
TogglePlayerControllable(playerid, 1);
OnPropUpdate(); SavePlayerData(playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You don't have enough cash with you ! ");
return 1;
}
}
}

translate!
Ai deja 3 masini!! -you have already 3 cars


Sorry for my bad bad english ..
Reply
#2

please help
Reply
#3

pls help sorry for 3x post
Reply
#4

Try to change this
if(PlayerInfo[playerid][pPcarkey] != -1 && PlayerInfo[playerid][pPcarkey2] != -1 &&
PlayerInfo[playerid][pPcarkey3] != -1)
{




To this:
if(PlayerInfo[playerid][pPcarkey] != -1 || PlayerInfo[playerid][pPcarkey2] != -1 ||
PlayerInfo[playerid][pPcarkey3] != -1)
{

-1 symbols no car right?
and try to do what i said.
Reply
#5

idem
Reply
#6

helpppppp
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)