Money van system Error
#1

when i type /loadmoney and /unloadmoney system says : Unknown command
i will glad if someone fixed it for me
Код:
COMMAND:loadmoney(playerid, params[])
{
    new carid = GetPlayerVehicleID(playerid);
    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER || IsPlayerInVehicle(playerid, 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),"%s.txt",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) tax=(tmpcash*dini_Int(nomefile,"taxrate")/100);
				tmpcash=tmpcash-tax;
				compscar[carid]=compscar[carid]+tmpcash;
				dini_IntSet(nomefile,"bizcash",0);
				SendClientMSG(playerid, COLOR_HELPEROOC, "..: [MONEYVAN] $%d from the business %s has been loaded into the van. (-$%d taxes)", compscar[carid], NoUnderscore(biz[i][biztext]), tax);

				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);

				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;
}
and

Код:
COMMAND:unloadmoney(playerid, params[])
{
    new carid = GetPlayerVehicleID(playerid);
    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER || IsPlayerInVehicle(playerid, 428))
        return SendClientError(playerid, "You are not driving the moneyvan!");

	if(!compscar[carid])
	    return SendClientError(playerid, "There is no money in the van!");

	for(new i; i < sizeof(biz); i++)
	{
	    new f = i;
	    if(IsPlayerInRangeOfPoint(playerid, 5.0, biz[f][bizenter_x],biz[f][bizenter_y],biz[f][bizenter_z]) && biz[f][biztype] == 1)
	    {
	        PlayerInfo[playerid][bank] += compscar[carid];
	        SendClientMSG(playerid, COLOR_YELLOW, "$%d has been put into your bank account [Old Balance: $%d | New Balance: $%d]", compscar[carid],PlayerInfo[playerid][bank]-compscar[carid],PlayerInfo[playerid][bank]);

	        format(iStr,sizeof(iStr),"[BIZ] %s deposited $%d from security van",PlayerName(playerid),compscar[carid]);
			AppendTo(moneylog,iStr);
			format(iStr, sizeof(iStr), "7.: [UNLOADMONEY] :. %s has unloaded $%d to the bank. Old Balance: $%d | New Balance: $%d", PlayerName(playerid), compscar[carid], PlayerInfo[playerid][bank]-compscar[carid], PlayerInfo[playerid][bank]);
			iEcho(iStr);

			compscar[carid]=0;
		}
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)