All pastes #813414 Raw Edit

buy car system

public text v1 · immutable
·published 2007-12-12 14:50 UTC
rendered paste body
new vv[MAX_VEHICLES];
new ag[MAX_PLAYERS];
new vp[MAX_PLAYERS];

	if (strcmp("/buyc", cmdtext, true) == 0)
{
new vid;
vid= GetPlayerVehicleID(playerid);
if(ag[playerid]==1)
{
SendClientMessage(playerid,COLOR_YELLOW,"you already have a car");
}

if(ag[playerid]==0)
{
if(vv[vid]==1)
{
        SendClientMessage(playerid,COLOR_YELLOW,"this car has already been bought");
 }
if(vv[vid]==0)
{
new money;
money = GetPlayerMoney(playerid);
if(money >= 100)
{
 vv[vid]=1;
 SendClientMessage(playerid,COLOR_YELLOW,"concgratz you have bought car");
 ag[playerid]=1;
 vp[playerid] = vid;
}
else{
 SendClientMessage(playerid,COLOR_YELLOW,"this car costs 100$ you do not have enough money");
      }
    }
  }
return 1;
	}
	if (strcmp("/sellc", cmdtext, true) == 0)
{
/*i don't know how i should start i wan't the player to be able that he can sell his car while he even isn't in his car or in an other car*/
return 1;
}