Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Weapon Dealers
- Made by Jelly23
- */
- #define FILTERSCRIPT
- /*Includes*/
- #include <a_samp>
- #include <izcmd>
- #include <a_mysql>
- #include <foreach>
- /*Dialogs*/
- #define DIALOG_WEAPONS (0)
- #define DIALOG_RCON (1)
- #define DIALOG_CRTCR (2)
- #define DIALOG_CRTGO (3)
- #define DIALOG_CRTET (4)
- #define DIALOG_CRTED (5)
- #define DIALOG_CRTEY (6)
- #define DIALOG_CRTEZ (7)
- #define DIALOG_CRTEP (8)
- /*MySQL*/
- #define MYSQL_HOST "localhost"
- #define MYSQL_USER "root"
- #define MYSQL_DATABASE "your database here"
- #define MYSQL_PASSWORD ""
- /*Configuration*/
- #define MAX_DEALERS 500
- /*Enumerator*/
- enum WeapDealers
- {
- ActorID,
- Text3D:Label,
- Weapon1,
- Weapon2,
- Weapon3,
- Weapon4,
- Weapon5,
- Weapon6,
- Weapon7,
- Weapon8,
- Weapon9,
- Weapon10,
- Cost1,
- Cost2,
- Cost3,
- Cost4,
- Cost5,
- Cost6,
- Cost7,
- Cost8,
- Cost9,
- Cost10,
- Ammo1,
- Ammo2,
- Ammo3,
- Ammo4,
- Ammo5,
- Ammo6,
- Ammo7,
- Ammo8,
- Ammo9,
- Ammo10,
- dSkin,
- Float:dAngle,
- Float:dX,
- Float:dY,
- Float:dZ,
- dWorld
- };
- enum playerInfo
- {
- CurrentDealer,
- CurrentItem[10],
- CurrentAmmo[10],
- CurrentCost[10]
- }
- /*Iterator*/
- new Iterator:DealerLoop<MAX_DEALERS>;
- /*Array(s) & Others*/
- new dInfo[MAX_DEALERS][WeapDealers],
- pInfo[MAX_PLAYERS][playerInfo],
- mysql;
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Weapon Dealers - Made by Jelly23");
- print("--------------------------------------\n");
- mysql_log(LOG_ERROR | LOG_WARNING | LOG_DEBUG);
- mysql = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_DATABASE, MYSQL_PASSWORD);
- if(mysql_errno(mysql) != 0)
- {
- print("Could not connect to the database!");
- SendRconCommand("hostname MYSQL| ERROR");
- }
- else
- {
- printf("Connected to database: %s", MYSQL_DATABASE);
- }
- if(!mysql_tquery(mysql, "SELECT * FROM `dealers`", "LoadDealers", ""))
- {
- printf("[MySQL | ERROR]: Couldn't load the information");
- }
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print(" Weapon Dealers - Made by Jelly23");
- print("----------------------------------\n");
- }
- #endif
- /*Callbacks*/
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_WEAPONS)
- {
- if(response)
- {
- if(GetPlayerMoney(playerid) < pInfo[playerid][CurrentCost][listitem]) return SendClientMessage(playerid,-1,"{FF0000}[!]{FFFFFF} You haven't enough money.");
- GivePlayerWeapon(playerid,pInfo[playerid][CurrentItem][listitem],pInfo[playerid][CurrentAmmo][listitem]);
- GivePlayerMoney(playerid,-pInfo[playerid][CurrentCost][listitem]);
- }
- }
- if(dialogid == DIALOG_RCON)
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- foreach(new i: DealerLoop)
- {
- RemoveDealer(i);
- }
- SendClientMessageToAll(-1,"{FFFF00}[!] {FFFFFF} All weapon dealers were removed by an admin.");
- }
- case 1:
- {
- new count = -1;
- foreach(new i: DealerLoop)
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.5, dInfo[i][dX], dInfo[i][dY], dInfo[i][dZ]))
- {
- count = i;
- }
- }
- if(count == -1) return SendClientMessage(playerid,-1,"{FFFF00}[!] {FFFFFF}You are not next to any weapon dealer");
- RemoveDealer(count);
- }
- case 2:
- {
- new count = -1;
- foreach(new i: DealerLoop)
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.5, dInfo[i][dX], dInfo[i][dY], dInfo[i][dZ]))
- {
- count = i;
- }
- }
- if(count == -1) return SendClientMessage(playerid,-1,"{FFFF00}[!] {FFFFFF}You are not next to any weapon crate");
- dInfo[count][Weapon1] = dInfo[count][Weapon2] = dInfo[count][Weapon3] = dInfo[count][Weapon4] = dInfo[count][Weapon5] = dInfo[count][Weapon6] =
- dInfo[count][Weapon7] = dInfo[count][Weapon8] = dInfo[count][Weapon9] = dInfo[count][Weapon10] = -1;
- UpdateDealers(pInfo[playerid][CurrentDealer],0);
- }
- case 3:
- {
- ShowPlayerDialog(playerid,DIALOG_CRTCR, DIALOG_STYLE_INPUT, "Weapon Dealers Menu »{FFFFFF} Create Dealer", "Enter the skin id below:", "Create", "Cancel");
- }
- case 4:
- {
- ShowPlayerDialog(playerid,DIALOG_CRTGO, DIALOG_STYLE_INPUT, "Weapon Dealers Menu »{FFFFFF} Goto Dealer", "Enter the dealer id below:", "Go", "Cancel");
- }
- case 5:
- {
- ShowPlayerDialog(playerid,DIALOG_CRTET, DIALOG_STYLE_INPUT, "Weapon Dealers Menu »{FFFFFF} Edit Dealer", "Enter the dealer id below:", "Edit", "Cancel");
- }
- }
- }
- }
- if(dialogid == DIALOG_CRTCR)
- {
- if(response)
- {
- new Float:X,Float:Y,Float:Z,Float:F;
- GetPlayerPos(playerid,X,Y,Z);
- GetPlayerFacingAngle(playerid,F);
- CreateDealer(strval(inputtext), X, Y, Z, F, GetPlayerVirtualWorld(playerid));
- SetPlayerPos(playerid,X+2,Y,Z+1);
- }
- }
- if(dialogid == DIALOG_CRTGO)
- {
- if(response)
- {
- if (!Iter_Contains(DealerLoop, strval(inputtext))) return SendClientMessage(playerid,-1,"{FFFF00}[!] {FFFFFF} There is no such dealer id.");
- SetPlayerPos(playerid,dInfo[strval(inputtext)][dX]+2,dInfo[strval(inputtext)][dY],dInfo[strval(inputtext)][dZ]+1);
- }
- }
- if(dialogid == DIALOG_CRTET)
- {
- if(response)
- {
- if (!Iter_Contains(DealerLoop, strval(inputtext))) return SendClientMessage(playerid,-1,"{FFFF00}[!] {FFFFFF} There is no such dealer id.");
- pInfo[playerid][CurrentDealer] = strval(inputtext);
- ShowPlayerDialog(playerid,DIALOG_CRTED, DIALOG_STYLE_INPUT, "Weapon Dealers Menu »{FFFFFF} Edit Dealer", "Enter the weapon slot id below\nWeapon Slots are between: 1-10", "Edit", "Cancel");
- }
- }
- if(dialogid == DIALOG_CRTED)
- {
- if(response)
- {
- if( 1 < strval(inputtext) > 10) return SendClientMessage(playerid,-1,"{FFFF00}[!]{FFFFFF}Invalid slot id");
- pInfo[playerid][CurrentItem][0] = strval(inputtext);
- ShowPlayerDialog(playerid,DIALOG_CRTEY, DIALOG_STYLE_INPUT, "Weapon Dealers Menu »{FFFFFF} Edit Dealer", "Enter the weapon id below\nTo erase a weapon use '-1' as weapon id", "Edit", "Cancel");
- }
- }
- if(dialogid == DIALOG_CRTEY)
- {
- if(response)
- {
- switch(pInfo[playerid][CurrentItem][0])
- {
- case 1: dInfo[pInfo[playerid][CurrentDealer]][Weapon1] = strval(inputtext);
- case 2: dInfo[pInfo[playerid][CurrentDealer]][Weapon2] = strval(inputtext);
- case 3: dInfo[pInfo[playerid][CurrentDealer]][Weapon3] = strval(inputtext);
- case 4: dInfo[pInfo[playerid][CurrentDealer]][Weapon4] = strval(inputtext);
- case 5: dInfo[pInfo[playerid][CurrentDealer]][Weapon5] = strval(inputtext);
- case 6: dInfo[pInfo[playerid][CurrentDealer]][Weapon6] = strval(inputtext);
- case 7: dInfo[pInfo[playerid][CurrentDealer]][Weapon7] = strval(inputtext);
- case 8: dInfo[pInfo[playerid][CurrentDealer]][Weapon8] = strval(inputtext);
- case 9: dInfo[pInfo[playerid][CurrentDealer]][Weapon9] = strval(inputtext);
- case 10: dInfo[pInfo[playerid][CurrentDealer]][Weapon10] = strval(inputtext);
- }
- UpdateDealers(pInfo[playerid][CurrentDealer],0);
- if(strval(inputtext) == -1) return SendClientMessage(playerid,-1,"{FFFF00}[!]{FFFFFF} Weapon removed");
- ShowPlayerDialog(playerid,DIALOG_CRTEZ, DIALOG_STYLE_INPUT, "Weapon Dealers Menu »{FFFFFF} Edit Dealer", "Enter the ammo amount\n9999 Is the max amount of ammo.", "Edit", "Cancel");
- }
- }
- if(dialogid == DIALOG_CRTEZ)
- {
- if(response)
- {
- switch(pInfo[playerid][CurrentItem][0])
- {
- case 1: dInfo[pInfo[playerid][CurrentDealer]][Ammo1] = strval(inputtext);
- case 2: dInfo[pInfo[playerid][CurrentDealer]][Ammo2] = strval(inputtext);
- case 3: dInfo[pInfo[playerid][CurrentDealer]][Ammo3] = strval(inputtext);
- case 4: dInfo[pInfo[playerid][CurrentDealer]][Ammo4] = strval(inputtext);
- case 5: dInfo[pInfo[playerid][CurrentDealer]][Ammo5] = strval(inputtext);
- case 6: dInfo[pInfo[playerid][CurrentDealer]][Ammo6] = strval(inputtext);
- case 7: dInfo[pInfo[playerid][CurrentDealer]][Ammo7] = strval(inputtext);
- case 8: dInfo[pInfo[playerid][CurrentDealer]][Ammo8] = strval(inputtext);
- case 9: dInfo[pInfo[playerid][CurrentDealer]][Ammo9] = strval(inputtext);
- case 10: dInfo[pInfo[playerid][CurrentDealer]][Ammo10] = strval(inputtext);
- }
- UpdateDealers(pInfo[playerid][CurrentDealer],1);
- ShowPlayerDialog(playerid,DIALOG_CRTEP, DIALOG_STYLE_INPUT, "Weapon Dealers Menu »{FFFFFF} Edit Dealer", "Enter the weapon cost\nPut anything as the weapon cost.", "Edit", "Cancel");
- }
- }
- if(dialogid == DIALOG_CRTEP)
- {
- if(response)
- {
- switch(pInfo[playerid][CurrentItem][0])
- {
- case 1: dInfo[pInfo[playerid][CurrentDealer]][Cost1] = strval(inputtext);
- case 2: dInfo[pInfo[playerid][CurrentDealer]][Cost2] = strval(inputtext);
- case 3: dInfo[pInfo[playerid][CurrentDealer]][Cost3] = strval(inputtext);
- case 4: dInfo[pInfo[playerid][CurrentDealer]][Cost4] = strval(inputtext);
- case 5: dInfo[pInfo[playerid][CurrentDealer]][Cost5] = strval(inputtext);
- case 6: dInfo[pInfo[playerid][CurrentDealer]][Cost6] = strval(inputtext);
- case 7: dInfo[pInfo[playerid][CurrentDealer]][Cost7] = strval(inputtext);
- case 8: dInfo[pInfo[playerid][CurrentDealer]][Cost8] = strval(inputtext);
- case 9: dInfo[pInfo[playerid][CurrentDealer]][Cost9] = strval(inputtext);
- case 10: dInfo[pInfo[playerid][CurrentDealer]][Cost10] = strval(inputtext);
- }
- UpdateDealers(pInfo[playerid][CurrentDealer],2);
- SendClientMessage(playerid,-1,"{FF0000}[!]{FFFFFF} Weapon slot succesfuly edited.");
- }
- }
- return 1;
- }
- forward LoadDealers();
- public LoadDealers()
- {
- new t,string[55];
- for(new i = 0; i < cache_get_row_count(); i++)
- {
- t = cache_get_field_content_int(i,"ID");
- Iter_Add(DealerLoop,t);
- dInfo[t][dSkin] = cache_get_field_content_int(i,"dSkin");
- dInfo[t][dX] = cache_get_field_content_float(i, "dX");
- dInfo[t][dY] = cache_get_field_content_float(i, "dY");
- dInfo[t][dZ] = cache_get_field_content_float(i, "dZ");
- dInfo[t][dAngle] = cache_get_field_content_float(i, "dAngle");
- format(string,sizeof(string),"{FF0000}Weapon Dealer (%i)\n\n{FFFFFF}Use {00FF00}/weaps",t);
- dInfo[t][ActorID] = CreateActor(dInfo[t][dSkin], dInfo[t][dX], dInfo[t][dY], dInfo[t][dZ], dInfo[t][dAngle]);
- dInfo[t][Label] = Create3DTextLabel(string, -1,dInfo[t][dX],dInfo[t][dY],dInfo[t][dZ]+0.4, 5.0,0, 0);
- dInfo[t][Weapon1] = cache_get_field_content_int(i,"Weapon1");
- dInfo[t][Weapon2] = cache_get_field_content_int(i,"Weapon2");
- dInfo[t][Weapon3] = cache_get_field_content_int(i,"Weapon3");
- dInfo[t][Weapon4] = cache_get_field_content_int(i,"Weapon4");
- dInfo[t][Weapon5] = cache_get_field_content_int(i,"Weapon5");
- dInfo[t][Weapon6] = cache_get_field_content_int(i,"Weapon6");
- dInfo[t][Weapon7] = cache_get_field_content_int(i,"Weapon7");
- dInfo[t][Weapon8] = cache_get_field_content_int(i,"Weapon8");
- dInfo[t][Weapon9] = cache_get_field_content_int(i,"Weapon9");
- dInfo[t][Weapon10] = cache_get_field_content_int(i,"Weapon10");
- dInfo[t][Cost1] = cache_get_field_content_int(i,"Cost1");
- dInfo[t][Cost2] = cache_get_field_content_int(i,"Cost2");
- dInfo[t][Cost3] = cache_get_field_content_int(i,"Cost3");
- dInfo[t][Cost4] = cache_get_field_content_int(i,"Cost4");
- dInfo[t][Cost5] = cache_get_field_content_int(i,"Cost5");
- dInfo[t][Cost6] = cache_get_field_content_int(i,"Cost6");
- dInfo[t][Cost7] = cache_get_field_content_int(i,"Cost7");
- dInfo[t][Cost8] = cache_get_field_content_int(i,"Cost8");
- dInfo[t][Cost9] = cache_get_field_content_int(i,"Cost9");
- dInfo[t][Cost10] = cache_get_field_content_int(i,"Cost10");
- dInfo[t][Ammo1] = cache_get_field_content_int(i,"Ammo1");
- dInfo[t][Ammo2] = cache_get_field_content_int(i,"Ammo2");
- dInfo[t][Ammo3] = cache_get_field_content_int(i,"Ammo3");
- dInfo[t][Ammo4] = cache_get_field_content_int(i,"Ammo4");
- dInfo[t][Ammo5] = cache_get_field_content_int(i,"Ammo5");
- dInfo[t][Ammo6] = cache_get_field_content_int(i,"Ammo6");
- dInfo[t][Ammo7] = cache_get_field_content_int(i,"Ammo7");
- dInfo[t][Ammo8] = cache_get_field_content_int(i,"Ammo8");
- dInfo[t][Ammo9] = cache_get_field_content_int(i,"Ammo9");
- dInfo[t][Ammo10] = cache_get_field_content_int(i,"Ammo10");
- }
- printf("\n=======================================\n");
- printf(" Weapon Dealers loaded!\n");
- printf(" A total of %d dealers out of %d loaded\n", cache_get_row_count(), MAX_DEALERS);
- printf("\n=======================================\n");
- }
- /*Functions*/
- CreateDealer(Skin, Float:X, Float:Y, Float:Z, Float:Angle, World)
- {
- new FreeID = Iter_Free(DealerLoop),string[55],query[621];
- format(string,sizeof(string),"{FF0000}Weapon Dealer (%i)\n\nUse {00FF00}/weaps",FreeID);
- Iter_Add(DealerLoop, FreeID);
- dInfo[FreeID][dAngle] = Angle;
- dInfo[FreeID][dWorld] = World;
- dInfo[FreeID][dSkin] = Skin;
- dInfo[FreeID][dX] = X,dInfo[FreeID][dY] = Y,dInfo[FreeID][dZ] = Z;
- dInfo[FreeID][Weapon1] = dInfo[FreeID][Weapon2] = dInfo[FreeID][Weapon3] = dInfo[FreeID][Weapon4] = dInfo[FreeID][Weapon5] =
- dInfo[FreeID][Weapon6] = dInfo[FreeID][Weapon7] = dInfo[FreeID][Weapon8] = dInfo[FreeID][Weapon9] = dInfo[FreeID][Weapon10] = -1;
- dInfo[FreeID][ActorID] = CreateActor(Skin, X, Y, Z, Angle);
- SetActorVirtualWorld(dInfo[FreeID][ActorID], World);
- dInfo[FreeID][Label] = Create3DTextLabel(string, -1,dInfo[FreeID][dX],dInfo[FreeID][dY],dInfo[FreeID][dZ]+0.4, 5.0,0, 0);
- mysql_format(mysql, query, sizeof(query), "INSERT INTO `dealers` (`ID`, `dSkin`, `dX`, `dY`, `dZ`, `dAngle`, `Weapon1`, `Weapon2` , `Weapon3`, `Weapon4`, `Weapon5`, `Weapon6`, `Weapon7`, `Weapon8`, `Weapon9`, `Weapon10`) VALUES ('%i', '%i', '%f', '%f', \
- '%f', '%f', '%i', '%i', '%i','%i', '%i', '%i', '%i', '%i', '%i', '%i')",
- FreeID,dInfo[FreeID][dSkin],dInfo[FreeID][dX],dInfo[FreeID][dY],dInfo[FreeID][dZ],dInfo[FreeID][dAngle],dInfo[FreeID][Weapon1],dInfo[FreeID][Weapon2],dInfo[FreeID][Weapon3],dInfo[FreeID][Weapon4],dInfo[FreeID][Weapon5],dInfo[FreeID][Weapon6],dInfo[FreeID][Weapon7],dInfo[FreeID][Weapon8],dInfo[FreeID][Weapon9],dInfo[FreeID][Weapon10]);
- mysql_tquery(mysql, query, "","");
- }
- RemoveDealer(dealerid)
- {
- new query[43];
- Iter_Remove(DealerLoop, dealerid);
- DestroyActor(dInfo[dealerid][ActorID]);
- Delete3DTextLabel(dInfo[dealerid][Label]);
- dInfo[dealerid][Weapon1] = dInfo[dealerid][Weapon2] = dInfo[dealerid][Weapon3] = dInfo[dealerid][Weapon4] = dInfo[dealerid][Weapon5] =
- dInfo[dealerid][Weapon6] = dInfo[dealerid][Weapon7] = dInfo[dealerid][Weapon8] = dInfo[dealerid][Weapon9] = dInfo[dealerid][Weapon10] = -1;
- mysql_format(mysql,query,sizeof(query),"DELETE FROM `dealers` WHERE `ID` ='%i'",dealerid);
- mysql_tquery(mysql,query,"","");
- }
- UpdateDealers(i,updateid)
- {
- new query[352];
- switch(updateid)
- {
- case 0:
- {
- mysql_format(mysql, query, sizeof(query), "UPDATE `dealers` SET `Weapon1` ='%i' , `Weapon2` ='%i' , `Weapon3` ='%i' , `Weapon4` ='%i', `Weapon5` = '%i', `Weapon6` ='%i', `Weapon7` ='%i', `Weapon8` ='%i', `Weapon9` ='%i', `Weapon10` ='%i' WHERE `ID` = '%i'",
- dInfo[i][Weapon1],dInfo[i][Weapon2],dInfo[i][Weapon3],dInfo[i][Weapon4],dInfo[i][Weapon5],dInfo[i][Weapon6],dInfo[i][Weapon7],dInfo[i][Weapon8],dInfo[i][Weapon9],dInfo[i][Weapon10],i);
- mysql_tquery(mysql,query,"","");
- }
- case 1:
- {
- mysql_format(mysql, query, sizeof(query), "UPDATE `dealers` SET `Ammo1` ='%i' , `Ammo2` ='%i' , `Ammo3` ='%i' , `Ammo4` ='%i', `Ammo5` = '%i', `Ammo6` ='%i', `Ammo7` ='%i', `Ammo8` ='%i', `Ammo9` ='%i', `Ammo10` ='%i' WHERE `ID` = '%i'",
- dInfo[i][Ammo1],dInfo[i][Ammo2],dInfo[i][Ammo3],dInfo[i][Ammo4],dInfo[i][Ammo5],dInfo[i][Ammo6],dInfo[i][Ammo7],dInfo[i][Ammo8],dInfo[i][Ammo9],dInfo[i][Ammo10],i);
- mysql_tquery(mysql,query,"","");
- }
- case 2:
- {
- mysql_format(mysql, query, sizeof(query), "UPDATE `dealers` SET `Cost1` ='%i' , `Cost2` ='%i' , `Cost3` ='%i' , `Cost4` ='%i', `Cost5` = '%i', `Cost6` ='%i', `Cost7` ='%i', `Cost8` ='%i', `Cost9` ='%i', `Cost10` ='%i' WHERE `ID` = '%i'",
- dInfo[i][Cost1],dInfo[i][Cost2],dInfo[i][Cost3],dInfo[i][Cost4],dInfo[i][Cost5],dInfo[i][Cost6],dInfo[i][Cost7],dInfo[i][Cost8],dInfo[i][Cost9],dInfo[i][Cost10],i);
- mysql_tquery(mysql,query,"","");
- }
- }
- }
- ShowWeaps(playerid,dealerid)
- {
- new i[1043],z,x,y;
- format(i,sizeof(i),"Weapon\tPrice\tAmmo\n");
- for(new p = 2; p < 12; p++)
- {
- if(dInfo[dealerid][WeapDealers:p] != -1)
- {
- z = p+10;
- x = p+20;
- pInfo[playerid][CurrentCost][y] = dInfo[dealerid][WeapDealers:z];
- pInfo[playerid][CurrentAmmo][y] = dInfo[dealerid][WeapDealers:x];
- pInfo[playerid][CurrentItem][y] = dInfo[dealerid][WeapDealers:p];
- format(i,sizeof(i),"%s{FFFFFF}%s\t{00FF00}$%i\t{FFFFFF}%i\n",i,GetWeaponNameEx(dInfo[dealerid][WeapDealers:p]),dInfo[dealerid][WeapDealers:z],dInfo[dealerid][WeapDealers:x]);
- y++;
- }
- }
- if(y == 0) return SendClientMessage(playerid,-1,"{FFFF00}[!]{FFFFFF}This weapon dealer has no weapons.");
- ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_TABLIST_HEADERS, "Buy Weapon",i,"Select","Cancel");
- return 1;
- }
- GetWeaponNameEx(weaponid)
- {
- new weaponna[32];
- switch(weaponid)
- {
- case 18: weaponna = "Molotov Cocktail";
- case 44: weaponna = "Night Vision Goggles";
- case 45: weaponna = "Thermal Goggles";
- default: GetWeaponName(weaponid, weaponna, sizeof(weaponna));
- }
- return weaponna;
- }
- /*Commands*/
- CMD:weaps(playerid)
- {
- new count;
- foreach(new i: DealerLoop)
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.5, dInfo[i][dX], dInfo[i][dY], dInfo[i][dZ]))
- {
- pInfo[playerid][CurrentDealer] = i;
- count++;
- }
- }
- if(count == 0) return SendClientMessage(playerid,-1,"{FFFF00}[!] {FFFFFF}You are not next to any weapon dealer.");
- ShowWeaps(playerid,pInfo[playerid][CurrentDealer]);
- return 1;
- }
- CMD:dmenu(playerid)
- {
- if(IsPlayerAdmin(playerid))
- {
- new count,string[134];
- foreach(new c: DealerLoop)
- {
- count++;
- }
- format(string,sizeof(string),"%s» Destroy all dealers {FF0000}(%i)\n{FFFFFF}» Destroy closest dealer\n» Reset closest dealer\n» Create dealer\n» Goto dealer\n» Edit dealer",string,count);
- ShowPlayerDialog(playerid, DIALOG_RCON, DIALOG_STYLE_LIST, "Weapon Dealers Menu",string, "Select", "Cancel");
- }
- return 1;
- }
- CMD:test(playerid)
- {
- if(IsPlayerAdmin(playerid))
- {
- GivePlayerMoney(playerid,10000);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment