public OnPlayerUseItem( playerid, item[] ){if( MOTOZ[ playerid ] == MAX_PLAYERS + 1 ){ format( pInfo[ playerid ][ UsedItem ], 128, item ); if( pInfo[ playerid ][ ClickedPlayer ] != playerid ) { ShowPlayerDialog( playerid, GIVE_DIALOG, DIALOG_STYLE_MSGBOX, \"{00d5ff}Tárgy Átadás\", \"{00d5ff}Át szeretnéd adni a tárgyat?\", \"Igen\", \"Nem\" );}else{ ShowPlayerDialog( playerid, DROP_DIALOG, DIALOG_STYLE_MSGBOX, \"{00d5ff}Tárgy Eldobás\", \"{00d5ff}El szeretnéd dobni a tárgyat?\", \"Igen\", \"Nem\" );}}else{ format( pInfo[ MOTOZ[ playerid ] ][ UsedItem ], 128, item ), ShowPlayerDialog( playerid, LOST_DIALOG, DIALOG_STYLE_MSGBOX, \"{00d5ff}Tárgy Elvétele\", \"{00d5ff}El szeretnéd venni a tárgyat?\", \"Igen\", \"Nem\" );}return 0;}
if( dialogid == GIVE_DIALOG ){ if( response ) { SendClientMessage( playerid, ZOLD, \"(( Sikeresen átadtad a tárgyat! ))\" ), cmd_me( playerid, \"átad valamit.\" ), cmd_me( pInfo[ playerid ][ ClickedPlayer ], \"elvesz valamit.\" ); RemoveItem( playerid, pInfo[ playerid ][ UsedItem ], 1 ), GiveItem( pInfo[ playerid ][ ClickedPlayer ], pInfo[ playerid ][ UsedItem ], 1 ); }}if( dialogid == DROP_DIALOG ){ if( response ) { SendClientMessage( playerid, ZOLD, \"(( Sikeresen eldobtad a tárgyat! ))\" ), cmd_me( playerid, \"eldob valamit.\" ); RemoveItem( playerid, pInfo[ playerid ][ UsedItem ], 1 );}}if( dialogid == LOST_DIALOG ){ if( ! response ) return MOTOZ[ playerid ] = MAX_PLAYERS + 1; if( response ) { new STRING[ 128 ]; RemoveItem( MOTOZ[ playerid ], pInfo[ MOTOZ[ playerid ] ][ UsedItem ], GetItemAmount( MOTOZ[ playerid ], pInfo[ MOTOZ[ playerid ] ][ UsedItem ] ) ); format( STRING, sizeof( STRING ), \"(( %s elvette tõled a %s(o/e)t! ))\", PlayerName( playerid ), pInfo[ MOTOZ[ playerid ] ][ UsedItem ] ); SendClientMessage( MOTOZ[ playerid ], PIROS, STRING ), cmd_me( playerid, \"elvesz valamit.\" ); MOTOZ[ playerid ] = MAX_PLAYERS + 1;}MOTOZ[ playerid ] = MAX_PLAYERS + 1;}
MOTOZ[ playerid ] = MAX_PLAYERS + 1;
if( MOTOZ[ playerid ] > MAX_PLAYERS ) return MOTOZ[ playerid ] = Nem motoz senkit.if( MOTOZ[ playerid ] < MAX_PLAYERS ) return MOTOZ[ playerid ] = Motoz valakit.
// This is a comment// uncomment the line below if you want to write a filterscript//#define FILTERSCRIPT#include <a_samp>#include <zcmd>#include <inventory>#define GIVE_DIALOG 1#define DROP_DIALOG 2#define LOST_DIALOG 3#define LOST_DIALOG_SECOND 4new motoz[MAX_PLAYERS] = INVALID_PLAYER_ID;new atad[MAX_PLAYERS] = INVALID_PLAYER_ID;new itemname[MAX_PLAYERS][128];new nameex[MAX_PLAYERS][MAX_ITEMS][128]; public OnFilterScriptInit(){print(\"\\n--------------------------------------\");print(\" Blank Filterscript by your name here\");print(\"--------------------------------------\\n\");return 1;}CMD:motoz(playerid,params[]){if(!isnull(params)){ new dialogstr[3000]; new id = strval(params); motoz[playerid] = id; for(new i; i< MAX_ITEMS; i++) { strcat(dialogstr,GetItemName(id,i)); format(nameex[playerid],128,\"%s\",GetItemName(id,i));}ShowPlayerDialog(playerid,LOST_DIALOG_SECOND,DIALOG_STYLE_LIST,\"Motozás\",dialogstr,\"Elvesz\",\"Mégsem\");}return 1;}public OnPlayerClickPlayer(playerid, clickedplayerid, source){atad[playerid] = clickedplayerid;ShowItems(playerid);return 1;}public OnFilterScriptExit(){return 1;}public OnPlayerUseItem(playerid,item[]){format(itemname[playerid],128,\"%s\",item);if(motoz[playerid] != INVALID_PLAYER_ID){ if(atad[playerid] != INVALID_PLAYER_ID) { ShowPlayerDialog( playerid, GIVE_DIALOG, DIALOG_STYLE_MSGBOX, \"{00d5ff}Tárgy Átadás\", \"{00d5ff}Át szeretnéd adni a tárgyat?\", \"Igen\", \"Nem\" );} ShowPlayerDialog( playerid, DROP_DIALOG, DIALOG_STYLE_MSGBOX, \"{00d5ff}Tárgy Eldobás\", \"{00d5ff}El szeretnéd dobni a tárgyat?\", \"Igen\", \"Nem\" );}else ShowPlayerDialog( playerid, LOST_DIALOG, DIALOG_STYLE_MSGBOX, \"{00d5ff}Tárgy Elvétele\", \"{00d5ff}El szeretnéd venni a tárgyat?\", \"Igen\", \"Nem\" );return 1;}public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){OnItemResponse(playerid,dialogid,response,listitem);if(dialogid == LOST_DIALOG_SECOND){ if(response) CallLocalFunction(\"OnPlayerUseItem\", \"is\",playerid, nameex[playerid][listitem]);}if(dialogid == GIVE_DIALOG){if(response){ RemoveItem(playerid,itemname[playerid],1); AddItem(atad[playerid],itemname[playerid],1); atad[playerid] = INVALID_PLAYER_ID;}else atad[playerid] = INVALID_PLAYER_ID;}if(dialogid == DROP_DIALOG){if(response){ RemoveItem(playerid,itemname[playerid],1);}}if( dialogid == LOST_DIALOG ){ RemoveItem(motoz[playerid],itemname[playerid],GetItemAmount(motoz[playerid],itemname[playerid])); motoz[playerid] = INVALID_PLAYER_ID;}return 0;}
OnItemResponse(playerid, dialogid, response,listitem)