SA-MP Forums Archive
Arms Dealer job - 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: Arms Dealer job (/showthread.php?tid=423093)



Arms Dealer job - NinjahZ - 16.03.2013

Who knows the arms dealer job with /getmats?the one that doesnt require a car and also any other good job scripts?
I need the /getmats command also the /getmats location in willowfield I need scripted,if anyone can do this,I will me most thankful


Re: Arms Dealer job - erminpr0 - 17.03.2013

Didn't understand you well,
is this you want?

pawn Код:
new Materials[MAX_PLAYERS];
YCMD:getmats(playerid, params[], help)
{
    #pragma unused help
    if(!IsAnArmDealer(playerid)) return SendClientMessage(playerid, 0xFFFFFFAA, "ERROR: You are not allowed!");
    // You should change it, put variable instead of this check.
    else if(isnull(params)) return SendClientMessage(playerid, 0xFFFFFFAA, "USAGE: /getmats [ammount]");
    else if(params < 1 || params > 10) return SendClientMessage(playerid, 0xFFFFFFAA, "ERROR: Ammount of materials can't go over 10 or below 1!");
    else if(Materials[playerid] + params > 10) return SendClientMessage(playerid, 0xFFFFFFAA, "You can't hold it!");
    else if(!IsPlayerInRangeOfPoint(playerid, 4.0, X, Y, Z); // Your co-ords
    return SendClientMessage(playerid, 0xFFFFFFAA, "ERROR: You are not near mats selling place!");
    else if(GetPlayerMoney(playerid) < (params * 10))
    return SendClientMessage(playerid, 0xFFFFFFAA, "ERROR: You don't have enough money!");
    GivePlayerMoney(playerid, - (params * 10));
    Materials[playerid] += params;
    new myString[128];
    format(myString, sizeof(myString), "SUCCES: You have bought %d crates of materials for $ %d", params, params*10);
    SendClientMessage(playerid, 0xFFFFFFAA, myString);
    return true;
}



Re: Arms Dealer job - Jstylezzz - 17.03.2013

Search, use ****** and the forum search function, I'm sure you'll find something you like.