then why when i loadmoney with this command it tell me you're not driving a moneyvan
Код:
COMMAND:loadmoney(playerid, params[])
{
new carid = GetPlayerVehicleID(playerid);
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER || Vehicles[carid][cartype] != 428)
return SendClientError(playerid, "You are not driving the moneyvan!");
for(new i; i < sizeof(biz); i++)
{
new f = i;
if(IsPlayerInRangeOfPoint(playerid, 7.0, biz[f][bizenter_x],biz[f][bizenter_y],biz[f][bizenter_z]) && biz[f][biztype] != 1)
{
new nomefile[ 50 ], fowner[ MAX_STRING ];
format(nomefile,sizeof(nomefile),"Businesses/%s.ini",biz[f][bizname]);
myStrcpy(fowner, dini_Get(nomefile,"owner"));
if(strcmp(PlayerName(playerid),fowner,false)==0 || PlayerInfo[playerid][power] > 10)
{
new tmpcash = dini_Int(nomefile,"bizcash"), tax;
if(tmpcash <= 0) return SendClientInfo(playerid, "You cannot load minus cash!");
new iTax = dini_Int(nomefile,"taxrate");
if(iTax)
{
new tFOUND = -1;
for(new q; q < sizeof(Gangzones); q++)
{
if(IsBusinessInArea(f, Gangzones[q][maxX], Gangzones[q][minX], Gangzones[q][maxY], Gangzones[q][minY])) tFOUND = q;
}
tax=(tmpcash*dini_Int(nomefile,"taxrate")/100);
tmpcash = tmpcash - tax;
compscar[carid] = compscar[carid] + tmpcash;
dini_IntSet(nomefile, "bizcash", 0);
if(Gangzones[tFOUND][gFACTION] != -1) // If business is inside a turf
{
SendClientMSG(playerid, COLOR_WHITE, "[MONEY-VAN] You have loaded $%s from the business %s. $%s has been taken for turf taxes.", number_format(compscar[carid]), NoUnderscore(biz[i][biztext]), number_format(tax));
format(iStr, sizeof(iStr), "# [Turf] A business has been unloaded from one of your turfs! +$%s F-Bank", number_format(tax));
SendClientMessageToTeam(Gangzones[tFOUND][gFACTION], iStr, COLOR_PLAYER_VLIGHTBLUE);
//==============================================================================
new tmpfield[ 64 ];
format(tmpfield, 64, "%sBank", teams[Gangzones[tFOUND][gFACTION]][teamname]);
new balance = dini_Int(globalstats, tmpfield);
dini_IntSet(globalstats, tmpfield, balance+tax);
}
else // If business isn't inside a turf!
{
SendClientMSG(playerid, COLOR_WHITE, "[MONEY-VAN] You have loaded $%s from the business %s. $%s has been taken for GOV taxes.", number_format(compscar[carid]), NoUnderscore(biz[i][biztext]), number_format(tax));
}
}
else
{
SendClientMSG(playerid, COLOR_WHITE, "[MONEY-VAN] You have loaded $%s from the business %s.", number_format(compscar[carid]), NoUnderscore(biz[i][biztext]));
}
if(PlayerInfo[playerid][female] == 1)
{
format(iStr,sizeof(iStr),"[BIZ] %s withdrawn $%d from her biz %s ID %d",PlayerName(playerid),compscar[carid],biz[i][bizname],i);
}
else
{
format(iStr,sizeof(iStr),"[BIZ] %s withdrawn $%d from his biz %s ID %d",PlayerName(playerid),compscar[carid],biz[i][bizname],i);
}
AppendTo(moneylog,iStr);
SetPlayerCheckpoint(playerid, 1774.2463,-1809.1384,13.5041,3);
format(iStr, sizeof(iStr), "7.: [LOADMONEY] :. %s has loaded $%d from their business.", PlayerName(playerid), compscar[carid]);
iEcho(iStr);
}
else return SendClientError(playerid, "You don't own this business!");
}
}
return 1;
}