13.09.2011, 05:30
(
Последний раз редактировалось oicq747285250; 13.09.2011 в 05:37.
Причина: for infos
)
Код:
#include <a_samp> new KeysNum[15][1]={ {1}, {2}, {4}, {8}, {16}, {32}, {64}, {128}, {256}, {512}, {1024}, {2048}, {4096}, {8192}, {16384} }; forward GetPressKey(id); public GetPressKey(id) { for(new a=0;a<15;a++) { if(id>=KeysNum[a][0]&&KeysNum[a][0]>0) { if(id==KeysNum[a][0]){printf("%d",KeysNum[a][0]);} for(new b=0;b<15;b++) { if(id>=KeysNum[a][0]+KeysNum[b][0]&&KeysNum[b][0]>0) { if(a!=b&&id==KeysNum[a][0]+KeysNum[b][0]&&KeysNum[a][0]>KeysNum[b][0]){printf("%d %d",KeysNum[a][0],KeysNum[b][0]);} for(new c=0;c<15;c++) { if(id>=KeysNum[a][0]+KeysNum[b][0]+KeysNum[c][0]&&KeysNum[c][0]>0) { if(a!=b&&b!=c&&id==KeysNum[a][0]+KeysNum[b][0]+KeysNum[c][0]&&KeysNum[a][0]>KeysNum[b][0]&&KeysNum[b][0]>KeysNum[c][0]){printf("%d %d %d",KeysNum[a][0],KeysNum[b][0],KeysNum[c][0]);} for(new d=0;d<15;d++) { if(id>=KeysNum[a][0]+KeysNum[b][0]+KeysNum[c][0]+KeysNum[d][0]&&KeysNum[c][0]>0) { if(a!=b&&b!=c&&c!=d&&id==KeysNum[a][0]+KeysNum[b][0]+KeysNum[c][0]+KeysNum[d][0]&&KeysNum[a][0]>KeysNum[b][0]&&KeysNum[b][0]>KeysNum[c][0]&&KeysNum[c][0]>KeysNum[d][0]){printf("%d %d %d %d",KeysNum[a][0],KeysNum[b][0],KeysNum[c][0],KeysNum[d][0]);} for(new e=0;e<15;e++) { if(id>=KeysNum[a][0]+KeysNum[b][0]+KeysNum[c][0]+KeysNum[d][0]+KeysNum[e][0]&&KeysNum[c][0]>0) { if(a!=b&&b!=c&&c!=d&&d!=e&&id==KeysNum[a][0]+KeysNum[b][0]+KeysNum[c][0]+KeysNum[d][0]+KeysNum[e][0]&&KeysNum[a][0]>KeysNum[b][0]&&KeysNum[b][0]>KeysNum[c][0]&&KeysNum[c][0]>KeysNum[d][0]&&KeysNum[d][0]>KeysNum[e][0]){printf("%d %d %d %d %d",KeysNum[a][0],KeysNum[b][0],KeysNum[c][0],KeysNum[d][0],KeysNum[e][0]);} } } } } } } } } } } } public OnFilterScriptInit() { return 1; } public OnPlayerUpdate(playerid) { new name[64]; GetPlayerName(playerid,name,64); if(strcmp(name, "yourname", true) == 0) { new Keys,ud,lr; GetPlayerKeys(playerid,Keys,ud,lr); if(Keys!=ud&&Keys!=lr) { //printf("%d) keys : %d ud : %d lr : %d",playerid,Keys,ud,lr); GetPressKey(Keys); } } return 1; }
not for beginers.
The console showed such as "16 4 2"
means the player "yourname" is pressed mouse1 + enter + c
you can make a public like
OnPlayerPressF
OnPlayerPressMouse1
by this function