Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <sscanf2>
- #include <zcmd>
- #define WSS_COLOR_RED 0xFF0000FF
- #define WSS_COLOR_GREEN 0x00FF00FF
- #define WSS_Dialog 0
- new WSS_Id[35];
- new WSS_Name[35][32];
- new WSS_Ammo[35];
- new WSS_Price[35];
- public OnFilterScriptInit()
- {
- new File:WSS_File;
- if(!fexist("WSS.cfg"))
- {
- WSS_File = fopen("WSS.cfg",io_write);
- fclose(WSS_File);
- }
- if(fexist("WSS.cfg"))
- {
- WSS_File = fopen("WSS.cfg",io_read);
- if(WSS_File)
- {
- new String[64];
- new A;
- while(fread(WSS_File,String))
- {
- sscanf(String,"p<|>is[32]ii",WSS_Id[A],WSS_Name[A],WSS_Ammo[A],WSS_Price[A]);
- A++;
- }
- fclose(WSS_File);
- }
- }
- return 1;
- }
- public OnDialogResponse(playerid,dialogid,response,listitem,inputtext[])
- {
- switch(dialogid)
- {
- case WSS_Dialog:
- {
- if(response)
- {
- new String[128];
- if(GetPlayerMoney(playerid) < WSS_Price[listitem])
- {
- format(String,sizeof(String),"Ban Can %i$ de mua %s.",WSS_Price[listitem],WSS_Name[listitem]);
- SendClientMessage(playerid,WSS_COLOR_RED,String);
- return 1;
- }
- GivePlayerWeapon(playerid,WSS_Id[listitem],WSS_Ammo[listitem]);
- GivePlayerMoney(playerid,-WSS_Price[listitem]);
- format(String,sizeof(String),"Ban da mua %s voi %i dan cho %i$.",WSS_Name[listitem],WSS_Ammo[listitem],WSS_Price[listitem]);
- SendClientMessage(playerid,WSS_COLOR_GREEN,String);
- }
- }
- }
- return 1;
- }
- COMMAND:wss(playerid,params[])
- {
- new String[1024];
- for(new A,B = 35; A < B; A++)
- {
- format(String,sizeof(String),"%s[%i] %s [%i$]\n",String,WSS_Ammo[A],WSS_Name[A],WSS_Price[A]);
- }
- ShowPlayerDialog(playerid,WSS_Dialog,DIALOG_STYLE_LIST,"He Thong Shop Sung",String,"Mua","Huy Bo");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement