14.08.2010, 00:10
I am using this http://forum.sa-mp.com/showthread.ph...t=House+System
And I am adding it to my GM but the commands are fucked up, I was hoping someone could unfuck them...
And I am adding it to my GM but the commands are fucked up, I was hoping someone could unfuck them...
pawn Код:
if (strcmp("/vbuy", cmdtext) == 0)
{
for(new i; i<MAX_CARS; i++)
{
if(IsPlayerInAnyVehicle(playerid))
{
new file[256];
format(file,sizeof(file),"cars/%s.uma",CarInfo[i][CarName]);
new vehicle;
vehicle = GetPlayerVehicleID(playerid);
if(vehicle != CarCreate[i]) return SendClientMessage(playerid,RED,"This car is not for sale!");
new Pname[24]; GetPlayerName(playerid, Pname, 24);
if(GetPlayerMoney(playerid) < CarInfo[i][CarCost]) return SendClientMessage(playerid, 0xF60000AA, "You don't have enough money to buy this Car!");
if(CarInfo[i][Owned] == 1) return SendClientMessage(playerid, 0xF60000AA, "This Car is already owned!");
dini_Set1(file,"Owner",Pname);
dini_IntSet1(file,"Owned",1);
GivePlayerMoney(playerid,- CarInfo[i][CarCost]);
GameTextForPlayer(playerid, "~r~Car Purchased!", 2000, 3);
CarInfo[i][Owned] = 1;
format(CarInfo[i][CarOwner], 24, "%s", Pname);
return 1;
}
else if(!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, RED, "You must be in a car!");
}
}
return 1;
}
if (strcmp("/vsell", cmdtext) == 0)
{
for(new i; i<MAX_CARS; i++)
{
if(IsPlayerInAnyVehicle(playerid))
{
new Pname[24]; GetPlayerName(playerid, Pname, 24);
if(CarInfo[i][CarOwner] != strval(Pname)) return SendClientMessage(playerid,RED,"WARNING: You dont own this vehicle!");
//if(strcmp(Pname, CarInfo[i][CarOwner]) != 0) return SendClientMessage(playerid, 0xF60000AA, "You don't own this Car!");
GivePlayerMoney(playerid, CarInfo[i][CarCost]);
GameTextForPlayer(playerid, "~g~Car Sold!", 2000, 3);
CarInfo[i][Owned] = 0;
CarInfo[i][CarOwner] = EOS;
dini_Unset1("Cars.ini", Pname);
return 1;
}
else if(!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, RED, "You are not in a vehicle!");
}
}