12.05.2010, 14:54
Quote:
I saw a sultan so entered it. It was a components 'truck' somehow. /load and /sellcomp worked. /load said i had 0 components left and /sellcomp said i had to go back to get more components. /buycomp just didn't work. It didn't say anything. /bestsale only said 'You do not have this device' http://i44.tinypic.com/fz3pr8.png http://i41.tinypic.com/2qx820k.png |
pawn Код:
if(strcmp(cmd, "/load", true) == 0)
{
new tmpcar = GetPlayerVehicleID(playerid);
if(tmpcar < 78 || tmpcar > 81)
{
GameTextForPlayer(playerid, "~r~You are not in a delivery truck", 5000, 1);
return 1;
}
format(string, sizeof(string), "Components: %d/%d", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
}
if(strcmp(cmd, "/buycomp", true) == 0)
{
new tmpcar = GetPlayerVehicleID(playerid);
new compcost = 9000;
if(PlayerToPoint(60.0, playerid, 2787.8,-2436.3,13.7))
{
if(IsATruck(tmpcar))
{
if(PlayerHaul[tmpcar][pLoad] < PlayerHaul[tmpcar][pCapasity])
{
new amount = PlayerHaul[tmpcar][pCapasity]-PlayerHaul[tmpcar][pLoad];
new cost = amount*compcost;
if(GetPlayerMoney(playerid) >= cost)
{
PlayerHaul[tmpcar][pLoad] = PlayerHaul[tmpcar][pCapasity];
format(string, sizeof(string), "Components: %d/%d", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "You Bought %d Components For $%d", amount,cost);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
GivePlayerMoney(playerid,-cost);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
return 1;
}
else
{
format(string, sizeof(string), "You cant afford %d Components at $%d", amount,cost);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
}
else
{
format(string, sizeof(string), "Components: %d/%d", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
}
else
{
SendClientMessage(playerid, TEAM_GROVE_COLOR, "This Vehicle Does Not Deliver Components");
return 1;
}
}
}
if(strcmp(cmd, "/sellcomp", true) == 0)
{
new tmpcar = GetPlayerVehicleID(playerid);
new cashmade;
if(!IsATruck(tmpcar))
{
GameTextForPlayer(playerid, "~r~You are not in a delivery truck", 5000, 1);
return 1;
}
if(PlayerHaul[tmpcar][pLoad] == 0)
{
GameTextForPlayer(playerid, "~r~Truck is empty, return to the stock house", 5000, 1);
format(string, sizeof(string), "Components: %d/%d", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
for(new i = 0; i < sizeof(BizzInfo); i++)
{
if (PlayerToPoint(10, playerid,BizzInfo[i][bEntrancex], BizzInfo[i][bEntrancey], BizzInfo[i][bEntrancez]))
{
//printf("Found House :%d",i);
for(new l = PlayerHaul[tmpcar][pLoad]; l > 0; l--)
{
if(BizzInfo[i][bCompCap] == BizzInfo[i][bComp])
{
GameTextForPlayer(playerid, "~r~Our stores are full", 5000, 1);
format(string, sizeof(string), "Cash Earned $%d", cashmade);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "Components: %d/%d", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "%s sold comp for $%d to %s", sendername, cashmade, BizzInfo[i][bDiscription]);
printf("%s", string);
PayLog(string);
return 1;
}
if(BizzInfo[i][bPayComp] > BizzInfo[i][bTakings])
{
GameTextForPlayer(playerid, "~r~We Cant Afford The Deal", 5000, 1);
format(string, sizeof(string), "Cash Earned $%d", cashmade);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "Components: %d/%d", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "%s sold comp for $%d to %s", sendername, cashmade, BizzInfo[i][bDiscription]);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
printf("%s", string);
PayLog(string);
return 1;
}
PlayerHaul[tmpcar][pLoad]--;
BizzInfo[i][bComp]++;
cashmade = cashmade+BizzInfo[i][bPayComp];
GivePlayerMoney(playerid,BizzInfo[i][bPayComp]);
BizzInfo[i][bTakings] = BizzInfo[i][bTakings]-BizzInfo[i][bPayComp];
if(PlayerHaul[tmpcar][pLoad] == 0 || PlayerHaul[tmpcar][pLoad] == 5)
{
PlayerInfo[playerid][pWA]++;
if(PlayerInfo[playerid][pWA] >= 20)
{
PlayerInfo[playerid][pExp]++;
PlayerInfo[playerid][pWA] = 0;
SendClientMessage(playerid, COLOR_YELLOW, "You are getting stronger Exp +1");
}
}
if(PlayerHaul[tmpcar][pLoad] == 0)
{
GameTextForPlayer(playerid, "~r~Truck is empty, return to the stock house", 5000, 1);
format(string, sizeof(string), "Cash Earned $%d", cashmade);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "Components: %d/%d", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "%s sold comp for $%d to %s", sendername, cashmade, BizzInfo[i][bDiscription]);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
printf("%s", string);
PayLog(string);
return 1;
}
}
OnPropUpdate();
return 1;
}
}
for(new i = 0; i < sizeof(SBizzInfo); i++)
{
if (PlayerToPoint(10, playerid,SBizzInfo[i][sbEntrancex], SBizzInfo[i][sbEntrancey], SBizzInfo[i][sbEntrancez]))
{
//printf("Found House :%d",i);
for(new l = PlayerHaul[tmpcar][pLoad]; l > 0; l--)
{
if(SBizzInfo[i][sbCompCap] == SBizzInfo[i][sbComp])
{
GameTextForPlayer(playerid, "~r~Our stores are full", 5000, 1);
format(string, sizeof(string), "Cash Earned $%d", cashmade);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "Components: %d/%d", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
if(SBizzInfo[i][sbPayComp] > SBizzInfo[i][sbTakings])
{
GameTextForPlayer(playerid, "~r~We Cant Afford The Deal", 5000, 1);
format(string, sizeof(string), "Cash Earned $%d", cashmade);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "Components: %d/%d", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
PlayerHaul[tmpcar][pLoad]--;
SBizzInfo[i][sbComp]++;
cashmade = cashmade+SBizzInfo[i][sbPayComp];
GivePlayerMoney(playerid,SBizzInfo[i][sbPayComp]);
format(string, sizeof(string), "%s sold comp for $%d to %s", sendername, cashmade, SBizzInfo[i][sbDiscription]);
printf("%s", string);
PayLog(string);
SBizzInfo[i][sbTakings] = SBizzInfo[i][sbTakings]-SBizzInfo[i][sbPayComp];
if(PlayerHaul[tmpcar][pLoad] == 0 || PlayerHaul[tmpcar][pLoad] == 5)
{
PlayerInfo[playerid][pWA]++;
if(PlayerInfo[playerid][pWA] >= 20)
{
PlayerInfo[playerid][pExp]++;
PlayerInfo[playerid][pWA] = 0;
SendClientMessage(playerid, COLOR_YELLOW, "You are getting stronger Exp +1");
}
}
if(PlayerHaul[tmpcar][pLoad] == 0)
{
GameTextForPlayer(playerid, "~r~Truck is empty, return to the stock house", 5000, 1);
format(string, sizeof(string), "Cash Earned $%d", cashmade);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "Components: %d/%d", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
}
OnPropUpdate();
return 1;
}
}
GameTextForPlayer(playerid, "~r~To Far From A Business", 5000, 1);
return 1;
}