SA-MP Forums Archive
help me pls - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: help me pls (/showthread.php?tid=634397)



help me pls - steamdeity - 18.05.2017

This is a car parts order. And the number to break. For example, I put the number 99999999 into my input box, and I received a great deal of money instead of a deduction in the character. I do not know how to solve the problem.

PHP код:
CMD:buycomp(playeridparams[])
{
    new 
amount;
    if (
PlayerData[playerid][pJob] != JOB_MECHANIC)
        return 
ErrorMsg(playerid"§Т№ўН§¤ШідБидґйгЄй¤УКСи§№Хй");
    if(!
IsPlayerInRangeOfPoint(playerid5.02424.9688,-2459.3313,13.6250))
    {
        
Waypoint_Set(playerid"Solarin Industries"2424.9688,-2459.3313,13.6250);
        
ErrorMsg(playerid"¤ШідБидґйНВЩи·ХиГйТ№ўТВЄФй№КиЗ№ аГТгЛйа¤ГЧиН§ЛБТВдЗйг№бј№·ХибЕйЗ");
        return 
1;
    }
    else
    {
        new 
vehicleid GetPlayerVehicleID(playerid);
        if (
GetVehicleModel(vehicleid) != 525)
            return 
ErrorMsg(playerid"¤ШідБидґйНВЩиє№ Towtruck");
        if (
sscanf(params"d"amount))
            return 
SyntaxMsg(playerid"/buycomp [amount]");
        if(
PlayerData[playerid][pMoney] <  amount*250)
            return 
ErrorMsg(playerid"¤ШіБХа§Ф№дБиѕН·ХиЁР«ЧйН");
        new 
extrapay 0price 250;
        if(
PlayerData[playerid][pJobEmployed] > 0) { extrapay PlayerData[playerid][pJobEmployed] < 10 ? (PlayerData[playerid][pJobEmployed]) : 50; }
        
price -= extrapay;
        
        
GiveMoney(playerid, -amount*price"buy comp");
        
CoreVehicles[vehicleid][vehComponent] += amount*25;
        
ServerMsg(playerid"¤Ші«ЧйНЄФй№КиЗ№ %d ЄФй№г№ГТ¤Т %s"amountFormatNumber(amount*price));
    }
    return 
1;




Re: help me pls - zedshadowzw - 18.05.2017

Put a negative on the GiveMoney. and It will deduct the player's money