Konu

#1
Selamün aleyküm
Zombi escape için şapka menüsü kullanıyorumda ama bu şapkayı zombilerde kullanıyor isteğim tek insanları kullanması kısacası zombiler o menüye giremesin yapabilecek varsa güzel olur.
.sma ze_jeton.sma (Dosya Boyutu: 9,2 KB | İndirme Sayısı: 1)
#2
(12-07-2023, 23:38)AloneDark. Adlı Kullanıcıdan Alıntı: Selamün aleyküm
Zombi escape için şapka menüsü kullanıyorumda ama bu şapkayı zombilerde kullanıyor isteğim tek insanları kullanması kısacası zombiler o menüye giremesin yapabilecek varsa güzel olur.

Deneyiniz:

PHP Kod:
#include <amxmodx>
#include <reapi>
#include <nvault>

new const TAG[] = "DeadLy Escape Zombie Escape"
new const tag[] = "DeadLy Escape"
new const ney[] = "Escape Coin"
new const neykisa[] = "E.C"

new const SapkaMenu[][][] = {
        //{"Sapka Adi","Model Yolu",Fiyati,Kacinci Sirada}
        {"Mask","models/deadlyescape/hats/headcase.mdl",250,1},
    {
"Mario","models/deadlyescape/hats/mario.mdl",500,2},
    {
"Sailor","models/deadlyescape/hats/denizci.mdl",750,3},
        {"Arab","models/deadlyescape/hats/arab.mdl",1000,4},
    {
"HolyHunter","models/deadlyescape/hats/holyhunter.mdl",1250,5},
    {
"Dog","models/deadlyescape/hats/dog.mdl",1500,6},
        {"RoboKay","models/deadlyescape/hats/robokaykay.mdl",1750,7},
    {
"Sokacu","models/deadlyescape/hats/sokacu.mdl",2000,8},
    {
"Nemesis","models/deadlyescape/hats/nemesis.mdl",2250,9},
        {"Toxic","models/deadlyescape/hats/toxic.mdl",2500,10
};

new const 
XPMenu[][] = {
        //{"Kac XP Alacak?","Kac Escape Coin verecek?"}
        {2000,100},
        {5000,200},
        {8500,300},
        {11500,400}
};

native zp_get_user_zombie(iPlayer);
native zp_get_user_nemesis(iPlayer);
native set_user_xp(iPlayer,amount);
native get_user_xp(iPlayer);

new 
g_Vault,iHatModels[sizeof(SapkaMenu)+1],iHatEnt[MAX_CLIENTS+1],g_Jeton[MAX_CLIENTS+1],g_bunukaydet[MAX_CLIENTS+1];

public 
plugin_init() {
        register_plugin(ney"1.0""Kalipso22,Tayo")
        register_concmd("amx_coinver","pKrediVer",ADMIN_RCON,"<isim> <miktar>");
        register_concmd("amx_coinsil","pKrediAl",ADMIN_RCON,"<isim> <miktar>");    
}
public 
plugin_end()
{
    
nvault_close(g_Vault);
}
public 
plugin_cfg()
{
    
g_Vault nvault_open("coin_data")

    if ( 
g_Vault == INVALID_HANDLE )
    
set_fail_state"[ZE:3.0] Level Vault Dosyasi Acilamiyor!" )

public 
plugin_precache() {
        for(new 1isizeof(SapkaMenu);i++)
        {
            iHatModels[i] = precache_model(SapkaMenu[i][1]);
        }
}

public 
client_connect(id)
{
    
LoadLevel(id);
}
public 
client_disconnected(id)
{
    
SaveLevel(id);
    
g_Jeton[id] = 0;
    
g_bunukaydet[id] = 0
}

public 
plugin_natives()   {
        register_native("get_user_jeton""@NTV_Get");
        register_native("set_user_jeton""@NTV_Set");

        register_native("sapka""@sapka_menusu2"1);
        register_native("xpmenu""@xp_menusu2"1);
}
@
NTV_Get() {
        new iPlayer get_param(1);
        return g_Jeton[iPlayer];
}
@
NTV_Set() {
        new iPlayer get_param(1),amount get_param(2);
        g_Jeton[iPlayer] = amount;
}
public 
pKrediVer(id,pLVL,cid){
        if(~get_user_flags(id) & pLVL)
        {
           return PLUGIN_HANDLED;
        }
        new pYazi1[32],pYazi2[18],pIsim[33];

        read_argv(1,pYazi1,31);
        read_argv(2,pYazi2,17);

        new pUID find_player("bl",pYazi1);

        get_user_name(idpIsim32);

        new pDeger str_to_num(pYazi2);

        g_Jeton[pUID] += pDeger;    
        client_print_color
(pUID,pUID,"^4[%s] ^3Size ^4%d ^3%s Verildi!",tag,pDeger,ney);
        return PLUGIN_HANDLED;

public 
pKrediAl(id,pLVL,cid){
        if(~get_user_flags(id) & pLVL)
        {
           return PLUGIN_HANDLED;
        }
        new pYazi1[32],pYazi2[18],pIsim[33];

        read_argv(1,pYazi1,31);
        read_argv(2,pYazi2,17);

        new pUID find_player("bl",pYazi1);

        get_user_name(idpIsim32);

        new pDeger str_to_num(pYazi2);

        g_Jeton[pUID] -= pDeger;                
        client_print_color
(pUID,pUID,"^4[%s] ^3Sizden ^4%d ^3%s Alindi!",tag,pDeger,ney);
        return PLUGIN_HANDLED;

@
sapka_menusu2(const iPlayer) {
        if(!zp_get_user_zombie(iPlayer)) {
        new Menu menu_create(fmt("\r[Deadly Escape] \y~ \wSapka Menu"), "@sapka_menusu3");   
        menu_additem
(Menu,fmt("\wSapkayi Cikar"),"333");
        for(new i=0sizeof(SapkaMenu); i++) 
        {
          /*new iL_Key;
          iL_Key = i;*/

          if(g_bunukaydet[iPlayer] < SapkaMenu[i][3][0])
          {        
             menu_additem
(Menu,fmt("\d%s \r[%i %s]",SapkaMenu[i][0],SapkaMenu[i][2],neykisa),fmt("%i",i));
          }
          else
          {
             menu_additem(Menu,fmt("\w%s",SapkaMenu[i][0]),fmt("%i",i));
          }
        }  
        menu_setprop
(MenuMPROP_BACKNAME,"\d[Onceki Sayfa]"),menu_setprop(MenuMPROP_NEXTNAME,"\d[Sonraki Sayfa]"),menu_setprop(MenuMPROP_EXITNAME,"\wCikis");
        menu_display(iPlayerMenu);
       } else client_print_color(iPlayeriPlayer"Bu menuye zombiler giremez");
}
@
sapka_menusu3(const iPlayer, const iMenu, const iItem) {
        if(iItem == MENU_EXIT
        
           menu_destroy(iMenu);
           return PLUGIN_HANDLED;
        }
        if(zp_get_user_zombie(iPlayer) { 
           menu_destroy(iMenu);return PLUGIN_HANDLED;
           client_print_color(iPlayeriPlayer"Bu menuyu zombiler kullanamaz!");
        
        new iData[6],iL_Key;
        menu_item_getinfo(iMenuiItem_iDatacharsmax(iData));
        iL_Key str_to_num(iData)

        if(iL_Key == 333)
        {
           @SetUserHat(iPlayer,0);
           client_print_color(iPlayer,iPlayer,"^4[%s] ^1[^3 Ba?ar?l? bir ?ekilde ?apkay? ??kard?n! ^1]",tag);

           menu_destroy(iMenu);
           return PLUGIN_HANDLED;
        }

        if(g_bunukaydet[iPlayer] < SapkaMenu[iL_Key][3][0])
        {
          if(g_Jeton[iPlayer] >= SapkaMenu[iL_Key][2][0])
          {
            client_print_color(iPlayer,iPlayer,"^4[%s] ^1[^3 Ba?ar?l? bir ?ekilde ?apkay? satin ald?n! ^1]",tag);
            g_Jeton[iPlayer] -= SapkaMenu[iL_Key][2][0];
            g_bunukaydet[iPlayer] = SapkaMenu[iL_Key][3][0];
          }
          else
          {
            client_print_color(iPlayer,iPlayer,"^4[%s] ^1[^3 Bu ?apkay? almak i?in yeterli ^4%s ^3yok! ^1]",tag,neykisa);
            @sapka_menusu2(iPlayer);
          }
        }
        else
        {
           @SetUserHat(iPlayer,0);
           @SetUserHat(iPlayer,iL_Key);
           client_print_color(iPlayer,iPlayer,"^4[%s] ^1[^3 Ba?ar?l? bir ?ekilde ?apkay? takt?n! ^1]",tag);
        }
        menu_destroy(iMenu);
        return PLUGIN_HANDLED;
}
@
xp_menusu2(const iPlayer) {
        new Menu menu_create(fmt("\w[\r%s\w] \w| \yXP Menu",TAG), "@xp_menusu3");     
  
        
for(new i=0sizeof(XPMenu); i++) {
        menu_additem(Menu,fmt("\dSatin Al \y%i XP \r[-%i %s]",XPMenu[i][0],XPMenu[i][1],neykisa),fmt("%i",i));
        }  
    
        menu_setprop
(MenuMPROP_BACKNAME,"\w[\yOnceki Sayfa\w]"),menu_setprop(MenuMPROP_NEXTNAME,"\w[\ySonraki Sayfa\w]"),menu_setprop(MenuMPROP_EXITNAME,"\w[\yCikis\w]");
        menu_display(iPlayerMenu);
}
@
xp_menusu3(const iPlayer, const iMenu, const iItem) {
        if(iItem == MENU_EXIT
        
           menu_destroy(iMenu);
           return PLUGIN_HANDLED
        }
        new iData[6],iL_Key;
    
    menu_item_getinfo(iMenuiItem_iDatacharsmax(iData));
        iL_Key str_to_num(iData)

        if(g_Jeton[iPlayer] >= XPMenu[iL_Key][1])
        {
           g_Jeton[iPlayer] -= XPMenu[iL_Key][1];    
           set_user_xp
(iPlayer,get_user_xp(iPlayer) + XPMenu[iL_Key][0]);
           client_print_color(iPlayer,iPlayer,"^4[%s] ^1[^3 Ba?ar?yla ^4%d %s ^3kar??l???nda ^4%d XP ^3ald?n. ^1]",tag,XPMenu[iL_Key][1],neykisa,XPMenu[iL_Key][0]);
           }else{
           client_print_color(iPlayer,iPlayer,"^4[%s] ^1[^3 Yeteri kadar ^4%s ^3yok! ^1]",tag,neykisa);
           @xp_menusu2(iPlayer);
        }
        menu_destroy(iMenu);
        return PLUGIN_HANDLED;
}
public 
zp_user_infected_post(iPlayerinfectornemesis ){
       if(zp_get_user_zombie(iPlayer) || zp_get_user_nemesis(iPlayer)){
       @SetUserHat(iPlayer,0);}
}
public 
zp_round_ended(WIN_HUMANS){
       new players[32],inum;
       static tempid;
       get_players(players,inum)
       for(new ii<inumi++){
       tempid players[i]
       if(is_user_alive(tempid) && !zp_get_user_zombie(tempid)){
       client_print(tempidprint_center"+1 %s",ney),
       g_Jeton[tempid] += 1;
       }
       }
       return PLUGIN_HANDLED;
}
@
SetUserHat(const iPlayer, const iHatNum) {
        switch(iHatNum){
        case 0:{
        iHatEnt[iPlayer] > rg_remove_entity(iHatEnt[iPlayer]):(iHatEnt[iPlayer] = 0);
        }
        default:{
        iHatEnt[iPlayer] = rg_create_entity("info_target");
        set_entvar(iHatEnt[iPlayer],var_movetype,MOVETYPE_FOLLOW);
        set_entvar(iHatEnt[iPlayer],var_aiment,iPlayer);
        set_entvar(iHatEnt[iPlayer],var_rendermode,kRenderNormal);
        set_entvar(iHatEnt[iPlayer],var_modelindex,iHatModels[iHatNum]);
        }
        }
}
rg_remove_entity(const iEnt){
        if(is_entity(iEnt))
        set_entvar(iEnt,var_flags,FL_KILLME);
}
SaveLevel(id){
    new 
szAuth[33];
    new 
szKey[64];
    
    
get_user_authid(id szAuth charsmax(szAuth));
    
formatex(szKey 63 "%s-ID" szAuth);

    new 
szData[256];
        
    
formatex(szData 255 "%i#%i#"g_Jeton[id], g_bunukaydet[id]);
    
nvault_pset(g_Vault szKey szData);
}
LoadLevel(id){
    new 
szAuth[33];
    new 
szKey[40];
    
    
get_user_authid(id szAuth charsmax(szAuth));
    
formatex(szKey 63 "%s-ID" szAuth);
    
    new 
szData[256]
        
    
formatex(szData 255"%i#%i#"g_Jeton[id], g_bunukaydet[id]);
        
    
nvault_get(g_VaultszKeyszData255);
        
    
replace_all(szData 255"#"" ");
    new 
level[32], kd[32];
    
parse(szDatalevel31kd31);
    
g_Jeton[id] = str_to_num(level);
    
g_bunukaydet[id] = str_to_num(kd);

~ Ücretli Eklenti İçin 'DM' ~ Discord ~
#3
(13-07-2023, 02:07)QuryWesT Adlı Kullanıcıdan Alıntı:
(12-07-2023, 23:38)AloneDark. Adlı Kullanıcıdan Alıntı: Selamün aleyküm
Zombi escape için şapka menüsü kullanıyorumda ama bu şapkayı zombilerde kullanıyor isteğim tek insanları kullanması kısacası zombiler o menüye giremesin yapabilecek varsa güzel olur.

Deneyiniz:

PHP Kod:
#include <amxmodx>
#include <reapi>
#include <nvault>

new const TAG[] = "DeadLy Escape Zombie Escape"
new const tag[] = "DeadLy Escape"
new const ney[] = "Escape Coin"
new const neykisa[] = "E.C"

new const SapkaMenu[][][] = {
        //{"Sapka Adi","Model Yolu",Fiyati,Kacinci Sirada}
        {"Mask","models/deadlyescape/hats/headcase.mdl",250,1},
    {
"Mario","models/deadlyescape/hats/mario.mdl",500,2},
    {
"Sailor","models/deadlyescape/hats/denizci.mdl",750,3},
        {"Arab","models/deadlyescape/hats/arab.mdl",1000,4},
    {
"HolyHunter","models/deadlyescape/hats/holyhunter.mdl",1250,5},
    {
"Dog","models/deadlyescape/hats/dog.mdl",1500,6},
        {"RoboKay","models/deadlyescape/hats/robokaykay.mdl",1750,7},
    {
"Sokacu","models/deadlyescape/hats/sokacu.mdl",2000,8},
    {
"Nemesis","models/deadlyescape/hats/nemesis.mdl",2250,9},
        {"Toxic","models/deadlyescape/hats/toxic.mdl",2500,10
};

new const 
XPMenu[][] = {
        //{"Kac XP Alacak?","Kac Escape Coin verecek?"}
        {2000,100},
        {5000,200},
        {8500,300},
        {11500,400}
};

native zp_get_user_zombie(iPlayer);
native zp_get_user_nemesis(iPlayer);
native set_user_xp(iPlayer,amount);
native get_user_xp(iPlayer);

new 
g_Vault,iHatModels[sizeof(SapkaMenu)+1],iHatEnt[MAX_CLIENTS+1],g_Jeton[MAX_CLIENTS+1],g_bunukaydet[MAX_CLIENTS+1];

public 
plugin_init() {
        register_plugin(ney"1.0""Kalipso22,Tayo")
        register_concmd("amx_coinver","pKrediVer",ADMIN_RCON,"<isim> <miktar>");
        register_concmd("amx_coinsil","pKrediAl",ADMIN_RCON,"<isim> <miktar>");    
}
public 
plugin_end()
{
    
nvault_close(g_Vault);
}
public 
plugin_cfg()
{
    
g_Vault nvault_open("coin_data")

    if ( 
g_Vault == INVALID_HANDLE )
    
set_fail_state"[ZE:3.0] Level Vault Dosyasi Acilamiyor!" )

public 
plugin_precache() {
        for(new 1isizeof(SapkaMenu);i++)
        {
            iHatModels[i] = precache_model(SapkaMenu[i][1]);
        }
}

public 
client_connect(id)
{
    
LoadLevel(id);
}
public 
client_disconnected(id)
{
    
SaveLevel(id);
    
g_Jeton[id] = 0;
    
g_bunukaydet[id] = 0
}

public 
plugin_natives()   {
        register_native("get_user_jeton""@NTV_Get");
        register_native("set_user_jeton""@NTV_Set");

        register_native("sapka""@sapka_menusu2"1);
        register_native("xpmenu""@xp_menusu2"1);
}
@
NTV_Get() {
        new iPlayer get_param(1);
        return g_Jeton[iPlayer];
}
@
NTV_Set() {
        new iPlayer get_param(1),amount get_param(2);
        g_Jeton[iPlayer] = amount;
}
public 
pKrediVer(id,pLVL,cid){
        if(~get_user_flags(id) & pLVL)
        {
           return PLUGIN_HANDLED;
        }
        new pYazi1[32],pYazi2[18],pIsim[33];

        read_argv(1,pYazi1,31);
        read_argv(2,pYazi2,17);

        new pUID find_player("bl",pYazi1);

        get_user_name(idpIsim32);

        new pDeger str_to_num(pYazi2);

        g_Jeton[pUID] += pDeger;    
        client_print_color
(pUID,pUID,"^4[%s] ^3Size ^4%d ^3%s Verildi!",tag,pDeger,ney);
        return PLUGIN_HANDLED;

public 
pKrediAl(id,pLVL,cid){
        if(~get_user_flags(id) & pLVL)
        {
           return PLUGIN_HANDLED;
        }
        new pYazi1[32],pYazi2[18],pIsim[33];

        read_argv(1,pYazi1,31);
        read_argv(2,pYazi2,17);

        new pUID find_player("bl",pYazi1);

        get_user_name(idpIsim32);

        new pDeger str_to_num(pYazi2);

        g_Jeton[pUID] -= pDeger;                
        client_print_color
(pUID,pUID,"^4[%s] ^3Sizden ^4%d ^3%s Alindi!",tag,pDeger,ney);
        return PLUGIN_HANDLED;

@
sapka_menusu2(const iPlayer) {
        if(!zp_get_user_zombie(iPlayer)) {
        new Menu menu_create(fmt("\r[Deadly Escape] \y~ \wSapka Menu"), "@sapka_menusu3");   
        menu_additem
(Menu,fmt("\wSapkayi Cikar"),"333");
        for(new i=0sizeof(SapkaMenu); i++) 
        {
          /*new iL_Key;
          iL_Key = i;*/

          if(g_bunukaydet[iPlayer] < SapkaMenu[i][3][0])
          {        
             menu_additem
(Menu,fmt("\d%s \r[%i %s]",SapkaMenu[i][0],SapkaMenu[i][2],neykisa),fmt("%i",i));
          }
          else
          {
             menu_additem(Menu,fmt("\w%s",SapkaMenu[i][0]),fmt("%i",i));
          }
        }  
        menu_setprop
(MenuMPROP_BACKNAME,"\d[Onceki Sayfa]"),menu_setprop(MenuMPROP_NEXTNAME,"\d[Sonraki Sayfa]"),menu_setprop(MenuMPROP_EXITNAME,"\wCikis");
        menu_display(iPlayerMenu);
       } else client_print_color(iPlayeriPlayer"Bu menuye zombiler giremez");
}
@
sapka_menusu3(const iPlayer, const iMenu, const iItem) {
        if(iItem == MENU_EXIT
        
           menu_destroy(iMenu);
           return PLUGIN_HANDLED;
        }
        if(zp_get_user_zombie(iPlayer) { 
           menu_destroy(iMenu);return PLUGIN_HANDLED;
           client_print_color(iPlayeriPlayer"Bu menuyu zombiler kullanamaz!");
        
        new iData[6],iL_Key;
        menu_item_getinfo(iMenuiItem_iDatacharsmax(iData));
        iL_Key str_to_num(iData)

        if(iL_Key == 333)
        {
           @SetUserHat(iPlayer,0);
           client_print_color(iPlayer,iPlayer,"^4[%s] ^1[^3 Ba?ar?l? bir ?ekilde ?apkay? ??kard?n! ^1]",tag);

           menu_destroy(iMenu);
           return PLUGIN_HANDLED;
        }

        if(g_bunukaydet[iPlayer] < SapkaMenu[iL_Key][3][0])
        {
          if(g_Jeton[iPlayer] >= SapkaMenu[iL_Key][2][0])
          {
            client_print_color(iPlayer,iPlayer,"^4[%s] ^1[^3 Ba?ar?l? bir ?ekilde ?apkay? satin ald?n! ^1]",tag);
            g_Jeton[iPlayer] -= SapkaMenu[iL_Key][2][0];
            g_bunukaydet[iPlayer] = SapkaMenu[iL_Key][3][0];
          }
          else
          {
            client_print_color(iPlayer,iPlayer,"^4[%s] ^1[^3 Bu ?apkay? almak i?in yeterli ^4%s ^3yok! ^1]",tag,neykisa);
            @sapka_menusu2(iPlayer);
          }
        }
        else
        {
           @SetUserHat(iPlayer,0);
           @SetUserHat(iPlayer,iL_Key);
           client_print_color(iPlayer,iPlayer,"^4[%s] ^1[^3 Ba?ar?l? bir ?ekilde ?apkay? takt?n! ^1]",tag);
        }
        menu_destroy(iMenu);
        return PLUGIN_HANDLED;
}
@
xp_menusu2(const iPlayer) {
        new Menu menu_create(fmt("\w[\r%s\w] \w| \yXP Menu",TAG), "@xp_menusu3");     
  
        
for(new i=0sizeof(XPMenu); i++) {
        menu_additem(Menu,fmt("\dSatin Al \y%i XP \r[-%i %s]",XPMenu[i][0],XPMenu[i][1],neykisa),fmt("%i",i));
        }  
    
        menu_setprop
(MenuMPROP_BACKNAME,"\w[\yOnceki Sayfa\w]"),menu_setprop(MenuMPROP_NEXTNAME,"\w[\ySonraki Sayfa\w]"),menu_setprop(MenuMPROP_EXITNAME,"\w[\yCikis\w]");
        menu_display(iPlayerMenu);
}
@
xp_menusu3(const iPlayer, const iMenu, const iItem) {
        if(iItem == MENU_EXIT
        
           menu_destroy(iMenu);
           return PLUGIN_HANDLED
        }
        new iData[6],iL_Key;
    
    menu_item_getinfo(iMenuiItem_iDatacharsmax(iData));
        iL_Key str_to_num(iData)

        if(g_Jeton[iPlayer] >= XPMenu[iL_Key][1])
        {
           g_Jeton[iPlayer] -= XPMenu[iL_Key][1];    
           set_user_xp
(iPlayer,get_user_xp(iPlayer) + XPMenu[iL_Key][0]);
           client_print_color(iPlayer,iPlayer,"^4[%s] ^1[^3 Ba?ar?yla ^4%d %s ^3kar??l???nda ^4%d XP ^3ald?n. ^1]",tag,XPMenu[iL_Key][1],neykisa,XPMenu[iL_Key][0]);
           }else{
           client_print_color(iPlayer,iPlayer,"^4[%s] ^1[^3 Yeteri kadar ^4%s ^3yok! ^1]",tag,neykisa);
           @xp_menusu2(iPlayer);
        }
        menu_destroy(iMenu);
        return PLUGIN_HANDLED;
}
public 
zp_user_infected_post(iPlayerinfectornemesis ){
       if(zp_get_user_zombie(iPlayer) || zp_get_user_nemesis(iPlayer)){
       @SetUserHat(iPlayer,0);}
}
public 
zp_round_ended(WIN_HUMANS){
       new players[32],inum;
       static tempid;
       get_players(players,inum)
       for(new ii<inumi++){
       tempid players[i]
       if(is_user_alive(tempid) && !zp_get_user_zombie(tempid)){
       client_print(tempidprint_center"+1 %s",ney),
       g_Jeton[tempid] += 1;
       }
       }
       return PLUGIN_HANDLED;
}
@
SetUserHat(const iPlayer, const iHatNum) {
        switch(iHatNum){
        case 0:{
        iHatEnt[iPlayer] > rg_remove_entity(iHatEnt[iPlayer]):(iHatEnt[iPlayer] = 0);
        }
        default:{
        iHatEnt[iPlayer] = rg_create_entity("info_target");
        set_entvar(iHatEnt[iPlayer],var_movetype,MOVETYPE_FOLLOW);
        set_entvar(iHatEnt[iPlayer],var_aiment,iPlayer);
        set_entvar(iHatEnt[iPlayer],var_rendermode,kRenderNormal);
        set_entvar(iHatEnt[iPlayer],var_modelindex,iHatModels[iHatNum]);
        }
        }
}
rg_remove_entity(const iEnt){
        if(is_entity(iEnt))
        set_entvar(iEnt,var_flags,FL_KILLME);
}
SaveLevel(id){
    new 
szAuth[33];
    new 
szKey[64];
    
    
get_user_authid(id szAuth charsmax(szAuth));
    
formatex(szKey 63 "%s-ID" szAuth);

    new 
szData[256];
        
    
formatex(szData 255 "%i#%i#"g_Jeton[id], g_bunukaydet[id]);
    
nvault_pset(g_Vault szKey szData);
}
LoadLevel(id){
    new 
szAuth[33];
    new 
szKey[40];
    
    
get_user_authid(id szAuth charsmax(szAuth));
    
formatex(szKey 63 "%s-ID" szAuth);
    
    new 
szData[256]
        
    
formatex(szData 255"%i#%i#"g_Jeton[id], g_bunukaydet[id]);
        
    
nvault_get(g_VaultszKeyszData255);
        
    
replace_all(szData 255"#"" ");
    new 
level[32], kd[32];
    
parse(szDatalevel31kd31);
    
g_Jeton[id] = str_to_num(level);
    
g_bunukaydet[id] = str_to_num(kd);

Yarın deneyip haber verecem

(13-07-2023, 02:07)QuryWesT Adlı Kullanıcıdan Alıntı:
(12-07-2023, 23:38)AloneDark. Adlı Kullanıcıdan Alıntı: Selamün aleyküm
Zombi escape için şapka menüsü kullanıyorumda ama bu şapkayı zombilerde kullanıyor isteğim tek insanları kullanması kısacası zombiler o menüye giremesin yapabilecek varsa güzel olur.

Deneyiniz:

PHP Kod:
#include <amxmodx>
#include <reapi>
#include <nvault>

new const TAG[] = "DeadLy Escape Zombie Escape"
new const tag[] = "DeadLy Escape"
new const ney[] = "Escape Coin"
new const neykisa[] = "E.C"

new const SapkaMenu[][][] = {
        //{"Sapka Adi","Model Yolu",Fiyati,Kacinci Sirada}
        {"Mask","models/deadlyescape/hats/headcase.mdl",250,1},
    {
"Mario","models/deadlyescape/hats/mario.mdl",500,2},
    {
"Sailor","models/deadlyescape/hats/denizci.mdl",750,3},
        {"Arab","models/deadlyescape/hats/arab.mdl",1000,4},
    {
"HolyHunter","models/deadlyescape/hats/holyhunter.mdl",1250,5},
    {
"Dog","models/deadlyescape/hats/dog.mdl",1500,6},
        {"RoboKay","models/deadlyescape/hats/robokaykay.mdl",1750,7},
    {
"Sokacu","models/deadlyescape/hats/sokacu.mdl",2000,8},
    {
"Nemesis","models/deadlyescape/hats/nemesis.mdl",2250,9},
        {"Toxic","models/deadlyescape/hats/toxic.mdl",2500,10
};

new const 
XPMenu[][] = {
        //{"Kac XP Alacak?","Kac Escape Coin verecek?"}
        {2000,100},
        {5000,200},
        {8500,300},
        {11500,400}
};

native zp_get_user_zombie(iPlayer);
native zp_get_user_nemesis(iPlayer);
native set_user_xp(iPlayer,amount);
native get_user_xp(iPlayer);

new 
g_Vault,iHatModels[sizeof(SapkaMenu)+1],iHatEnt[MAX_CLIENTS+1],g_Jeton[MAX_CLIENTS+1],g_bunukaydet[MAX_CLIENTS+1];

public 
plugin_init() {
        register_plugin(ney"1.0""Kalipso22,Tayo")
        register_concmd("amx_coinver","pKrediVer",ADMIN_RCON,"<isim> <miktar>");
        register_concmd("amx_coinsil","pKrediAl",ADMIN_RCON,"<isim> <miktar>");    
}
public 
plugin_end()
{
    
nvault_close(g_Vault);
}
public 
plugin_cfg()
{
    
g_Vault nvault_open("coin_data")

    if ( 
g_Vault == INVALID_HANDLE )
    
set_fail_state"[ZE:3.0] Level Vault Dosyasi Acilamiyor!" )

public 
plugin_precache() {
        for(new 1isizeof(SapkaMenu);i++)
        {
            iHatModels[i] = precache_model(SapkaMenu[i][1]);
        }
}

public 
client_connect(id)
{
    
LoadLevel(id);
}
public 
client_disconnected(id)
{
    
SaveLevel(id);
    
g_Jeton[id] = 0;
    
g_bunukaydet[id] = 0
}

public 
plugin_natives()   {
        register_native("get_user_jeton""@NTV_Get");
        register_native("set_user_jeton""@NTV_Set");

        register_native("sapka""@sapka_menusu2"1);
        register_native("xpmenu""@xp_menusu2"1);
}
@
NTV_Get() {
        new iPlayer get_param(1);
        return g_Jeton[iPlayer];
}
@
NTV_Set() {
        new iPlayer get_param(1),amount get_param(2);
        g_Jeton[iPlayer] = amount;
}
public 
pKrediVer(id,pLVL,cid){
        if(~get_user_flags(id) & pLVL)
        {
           return PLUGIN_HANDLED;
        }
        new pYazi1[32],pYazi2[18],pIsim[33];

        read_argv(1,pYazi1,31);
        read_argv(2,pYazi2,17);

        new pUID find_player("bl",pYazi1);

        get_user_name(idpIsim32);

        new pDeger str_to_num(pYazi2);

        g_Jeton[pUID] += pDeger;    
        client_print_color
(pUID,pUID,"^4[%s] ^3Size ^4%d ^3%s Verildi!",tag,pDeger,ney);
        return PLUGIN_HANDLED;

public 
pKrediAl(id,pLVL,cid){
        if(~get_user_flags(id) & pLVL)
        {
           return PLUGIN_HANDLED;
        }
        new pYazi1[32],pYazi2[18],pIsim[33];

        read_argv(1,pYazi1,31);
        read_argv(2,pYazi2,17);

        new pUID find_player("bl",pYazi1);

        get_user_name(idpIsim32);

        new pDeger str_to_num(pYazi2);

        g_Jeton[pUID] -= pDeger;                
        client_print_color
(pUID,pUID,"^4[%s] ^3Sizden ^4%d ^3%s Alindi!",tag,pDeger,ney);
        return PLUGIN_HANDLED;

@
sapka_menusu2(const iPlayer) {
        if(!zp_get_user_zombie(iPlayer)) {
        new Menu menu_create(fmt("\r[Deadly Escape] \y~ \wSapka Menu"), "@sapka_menusu3");   
        menu_additem
(Menu,fmt("\wSapkayi Cikar"),"333");
        for(new i=0sizeof(SapkaMenu); i++) 
        {
          /*new iL_Key;
          iL_Key = i;*/

          if(g_bunukaydet[iPlayer] < SapkaMenu[i][3][0])
          {        
             menu_additem
(Menu,fmt("\d%s \r[%i %s]",SapkaMenu[i][0],SapkaMenu[i][2],neykisa),fmt("%i",i));
          }
          else
          {
             menu_additem(Menu,fmt("\w%s",SapkaMenu[i][0]),fmt("%i",i));
          }
        }  
        menu_setprop
(MenuMPROP_BACKNAME,"\d[Onceki Sayfa]"),menu_setprop(MenuMPROP_NEXTNAME,"\d[Sonraki Sayfa]"),menu_setprop(MenuMPROP_EXITNAME,"\wCikis");
        menu_display(iPlayerMenu);
       } else client_print_color(iPlayeriPlayer"Bu menuye zombiler giremez");
}
@
sapka_menusu3(const iPlayer, const iMenu, const iItem) {
        if(iItem == MENU_EXIT
        
           menu_destroy(iMenu);
           return PLUGIN_HANDLED;
        }
        if(zp_get_user_zombie(iPlayer) { 
           menu_destroy(iMenu);return PLUGIN_HANDLED;
           client_print_color(iPlayeriPlayer"Bu menuyu zombiler kullanamaz!");
        
        new iData[6],iL_Key;
        menu_item_getinfo(iMenuiItem_iDatacharsmax(iData));
        iL_Key str_to_num(iData)

        if(iL_Key == 333)
        {
           @SetUserHat(iPlayer,0);
           client_print_color(iPlayer,iPlayer,"^4[%s] ^1[^3 Ba?ar?l? bir ?ekilde ?apkay? ??kard?n! ^1]",tag);

           menu_destroy(iMenu);
           return PLUGIN_HANDLED;
        }

        if(g_bunukaydet[iPlayer] < SapkaMenu[iL_Key][3][0])
        {
          if(g_Jeton[iPlayer] >= SapkaMenu[iL_Key][2][0])
          {
            client_print_color(iPlayer,iPlayer,"^4[%s] ^1[^3 Ba?ar?l? bir ?ekilde ?apkay? satin ald?n! ^1]",tag);
            g_Jeton[iPlayer] -= SapkaMenu[iL_Key][2][0];
            g_bunukaydet[iPlayer] = SapkaMenu[iL_Key][3][0];
          }
          else
          {
            client_print_color(iPlayer,iPlayer,"^4[%s] ^1[^3 Bu ?apkay? almak i?in yeterli ^4%s ^3yok! ^1]",tag,neykisa);
            @sapka_menusu2(iPlayer);
          }
        }
        else
        {
           @SetUserHat(iPlayer,0);
           @SetUserHat(iPlayer,iL_Key);
           client_print_color(iPlayer,iPlayer,"^4[%s] ^1[^3 Ba?ar?l? bir ?ekilde ?apkay? takt?n! ^1]",tag);
        }
        menu_destroy(iMenu);
        return PLUGIN_HANDLED;
}
@
xp_menusu2(const iPlayer) {
        new Menu menu_create(fmt("\w[\r%s\w] \w| \yXP Menu",TAG), "@xp_menusu3");     
  
        
for(new i=0sizeof(XPMenu); i++) {
        menu_additem(Menu,fmt("\dSatin Al \y%i XP \r[-%i %s]",XPMenu[i][0],XPMenu[i][1],neykisa),fmt("%i",i));
        }  
    
        menu_setprop
(MenuMPROP_BACKNAME,"\w[\yOnceki Sayfa\w]"),menu_setprop(MenuMPROP_NEXTNAME,"\w[\ySonraki Sayfa\w]"),menu_setprop(MenuMPROP_EXITNAME,"\w[\yCikis\w]");
        menu_display(iPlayerMenu);
}
@
xp_menusu3(const iPlayer, const iMenu, const iItem) {
        if(iItem == MENU_EXIT
        
           menu_destroy(iMenu);
           return PLUGIN_HANDLED
        }
        new iData[6],iL_Key;
    
    menu_item_getinfo(iMenuiItem_iDatacharsmax(iData));
        iL_Key str_to_num(iData)

        if(g_Jeton[iPlayer] >= XPMenu[iL_Key][1])
        {
           g_Jeton[iPlayer] -= XPMenu[iL_Key][1];    
           set_user_xp
(iPlayer,get_user_xp(iPlayer) + XPMenu[iL_Key][0]);
           client_print_color(iPlayer,iPlayer,"^4[%s] ^1[^3 Ba?ar?yla ^4%d %s ^3kar??l???nda ^4%d XP ^3ald?n. ^1]",tag,XPMenu[iL_Key][1],neykisa,XPMenu[iL_Key][0]);
           }else{
           client_print_color(iPlayer,iPlayer,"^4[%s] ^1[^3 Yeteri kadar ^4%s ^3yok! ^1]",tag,neykisa);
           @xp_menusu2(iPlayer);
        }
        menu_destroy(iMenu);
        return PLUGIN_HANDLED;
}
public 
zp_user_infected_post(iPlayerinfectornemesis ){
       if(zp_get_user_zombie(iPlayer) || zp_get_user_nemesis(iPlayer)){
       @SetUserHat(iPlayer,0);}
}
public 
zp_round_ended(WIN_HUMANS){
       new players[32],inum;
       static tempid;
       get_players(players,inum)
       for(new ii<inumi++){
       tempid players[i]
       if(is_user_alive(tempid) && !zp_get_user_zombie(tempid)){
       client_print(tempidprint_center"+1 %s",ney),
       g_Jeton[tempid] += 1;
       }
       }
       return PLUGIN_HANDLED;
}
@
SetUserHat(const iPlayer, const iHatNum) {
        switch(iHatNum){
        case 0:{
        iHatEnt[iPlayer] > rg_remove_entity(iHatEnt[iPlayer]):(iHatEnt[iPlayer] = 0);
        }
        default:{
        iHatEnt[iPlayer] = rg_create_entity("info_target");
        set_entvar(iHatEnt[iPlayer],var_movetype,MOVETYPE_FOLLOW);
        set_entvar(iHatEnt[iPlayer],var_aiment,iPlayer);
        set_entvar(iHatEnt[iPlayer],var_rendermode,kRenderNormal);
        set_entvar(iHatEnt[iPlayer],var_modelindex,iHatModels[iHatNum]);
        }
        }
}
rg_remove_entity(const iEnt){
        if(is_entity(iEnt))
        set_entvar(iEnt,var_flags,FL_KILLME);
}
SaveLevel(id){
    new 
szAuth[33];
    new 
szKey[64];
    
    
get_user_authid(id szAuth charsmax(szAuth));
    
formatex(szKey 63 "%s-ID" szAuth);

    new 
szData[256];
        
    
formatex(szData 255 "%i#%i#"g_Jeton[id], g_bunukaydet[id]);
    
nvault_pset(g_Vault szKey szData);
}
LoadLevel(id){
    new 
szAuth[33];
    new 
szKey[40];
    
    
get_user_authid(id szAuth charsmax(szAuth));
    
formatex(szKey 63 "%s-ID" szAuth);
    
    new 
szData[256]
        
    
formatex(szData 255"%i#%i#"g_Jeton[id], g_bunukaydet[id]);
        
    
nvault_get(g_VaultszKeyszData255);
        
    
replace_all(szData 255"#"" ");
    new 
level[32], kd[32];
    
parse(szDatalevel31kd31);
    
g_Jeton[id] = str_to_num(level);
    
g_bunukaydet[id] = str_to_num(kd);

Fotaraf atamadım böyle hatalar verdi.
ze_jeton.sma(148) : warning 217: loose indentation
ze_jeton.sma(156) : error 001: expected token: ")", but found "{"
ze_jeton.sma(158) : warning 225: unreachable code


(13-07-2023, 02:40)AloneDark. Adlı Kullanıcıdan Alıntı:
(13-07-2023, 02:07)QuryWesT Adlı Kullanıcıdan Alıntı: Deneyiniz:
PHP Kod:
#include <amxmodx>
#include <reapi>
#include <nvault>
new const TAG[] = "DeadLy Escape Zombie Escape"
new const tag[] = "DeadLy Escape"
new const ney[] = "Escape Coin"
new const neykisa[] = "E.C"
new const SapkaMenu[][][] = {
        //{"Sapka Adi","Model Yolu",Fiyati,Kacinci Sirada}
        {"Mask","models/deadlyescape/hats/headcase.mdl",250,1},
    {
"Mario","models/deadlyescape/hats/mario.mdl",500,2},
    {
"Sailor","models/deadlyescape/hats/denizci.mdl",750,3},
        {"Arab","models/deadlyescape/hats/arab.mdl",1000,4},
    {
"HolyHunter","models/deadlyescape/hats/holyhunter.mdl",1250,5},
    {
"Dog","models/deadlyescape/hats/dog.mdl",1500,6},
        {"RoboKay","models/deadlyescape/hats/robokaykay.mdl",1750,7},
    {
"Sokacu","models/deadlyescape/hats/sokacu.mdl",2000,8},
    {
"Nemesis","models/deadlyescape/hats/nemesis.mdl",2250,9},
        {"Toxic","models/deadlyescape/hats/toxic.mdl",2500,10
};
new const 
XPMenu[][] = {
        //{"Kac XP Alacak?","Kac Escape Coin verecek?"}
        {2000,100},
        {5000,200},
        {8500,300},
        {11500,400}
};
native zp_get_user_zombie(iPlayer);
native zp_get_user_nemesis(iPlayer);
native set_user_xp(iPlayer,amount);
native get_user_xp(iPlayer);
new 
g_Vault,iHatModels[sizeof(SapkaMenu)+1],iHatEnt[MAX_CLIENTS+1],g_Jeton[MAX_CLIENTS+1],g_bunukaydet[MAX_CLIENTS+1];
public 
plugin_init() {
        register_plugin(ney"1.0""Kalipso22,Tayo")
        register_concmd("amx_coinver","pKrediVer",ADMIN_RCON,"<isim> <miktar>");
        register_concmd("amx_coinsil","pKrediAl",ADMIN_RCON,"<isim> <miktar>");    
}
public 
plugin_end()
{
    
nvault_close(g_Vault);
}
public 
plugin_cfg()
{
    
g_Vault nvault_open("coin_data")
    if ( 
g_Vault == INVALID_HANDLE )
    
set_fail_state"[ZE:3.0] Level Vault Dosyasi Acilamiyor!" )

public 
plugin_precache() {
        for(new 1isizeof(SapkaMenu);i++)
        {
            iHatModels[i] = precache_model(SapkaMenu[i][1]);
        }
}
public 
client_connect(id)
{
    
LoadLevel(id);
}
public 
client_disconnected(id)
{
    
SaveLevel(id);
    
g_Jeton[id] = 0;
    
g_bunukaydet[id] = 0
}
public 
plugin_natives()   {
        register_native("get_user_jeton""@NTV_Get");
        register_native("set_user_jeton""@NTV_Set");
        register_native("sapka""@sapka_menusu2"1);
        register_native("xpmenu""@xp_menusu2"1);
}
@
NTV_Get() {
        new iPlayer get_param(1);
        return g_Jeton[iPlayer];
}
@
NTV_Set() {
        new iPlayer get_param(1),amount get_param(2);
        g_Jeton[iPlayer] = amount;
}
public 
pKrediVer(id,pLVL,cid){
        if(~get_user_flags(id) & pLVL)
        {
           return PLUGIN_HANDLED;
        }
        new pYazi1[32],pYazi2[18],pIsim[33];
        read_argv(1,pYazi1,31);
        read_argv(2,pYazi2,17);
        new pUID find_player("bl",pYazi1);
        get_user_name(idpIsim32);
        new pDeger str_to_num(pYazi2);
        g_Jeton[pUID] += pDeger;    
        client_print_color
(pUID,pUID,"^4[%s] ^3Size ^4%d ^3%s Verildi!",tag,pDeger,ney);
        return PLUGIN_HANDLED;

public 
pKrediAl(id,pLVL,cid){
        if(~get_user_flags(id) & pLVL)
        {
           return PLUGIN_HANDLED;
        }
        new pYazi1[32],pYazi2[18],pIsim[33];
        read_argv(1,pYazi1,31);
        read_argv(2,pYazi2,17);
        new pUID find_player("bl",pYazi1);
        get_user_name(idpIsim32);
        new pDeger str_to_num(pYazi2);
        g_Jeton[pUID] -= pDeger;                
        client_print_color
(pUID,pUID,"^4[%s] ^3Sizden ^4%d ^3%s Alindi!",tag,pDeger,ney);
        return PLUGIN_HANDLED;

@
sapka_menusu2(const iPlayer) {
        if(!zp_get_user_zombie(iPlayer)) {
        new Menu menu_create(fmt("\r[Deadly Escape] \y~ \wSapka Menu"), "@sapka_menusu3");   
        menu_additem
(Menu,fmt("\wSapkayi Cikar"),"333");
        for(new i=0sizeof(SapkaMenu); i++) 
        {
          /*new iL_Key;
          iL_Key = i;*/
          if(g_bunukaydet[iPlayer] < SapkaMenu[i][3][0])
          {        
             menu_additem
(Menu,fmt("\d%s \r[%i %s]",SapkaMenu[i][0],SapkaMenu[i][2],neykisa),fmt("%i",i));
          }
          else
          {
             menu_additem(Menu,fmt("\w%s",SapkaMenu[i][0]),fmt("%i",i));
          }
        }  
        menu_setprop
(MenuMPROP_BACKNAME,"\d[Onceki Sayfa]"),menu_setprop(MenuMPROP_NEXTNAME,"\d[Sonraki Sayfa]"),menu_setprop(MenuMPROP_EXITNAME,"\wCikis");
        menu_display(iPlayerMenu);
       } else client_print_color(iPlayeriPlayer"Bu menuye zombiler giremez");
}
@
sapka_menusu3(const iPlayer, const iMenu, const iItem) {
        if(iItem == MENU_EXIT
        
           menu_destroy(iMenu);
           return PLUGIN_HANDLED;
        }
        if(zp_get_user_zombie(iPlayer) { 
           menu_destroy(iMenu);return PLUGIN_HANDLED;
           client_print_color(iPlayeriPlayer"Bu menuyu zombiler kullanamaz!");
        
        new iData[6],iL_Key;
        menu_item_getinfo(iMenuiItem_iDatacharsmax(iData));
        iL_Key str_to_num(iData)
        if(iL_Key == 333)
        {
           @SetUserHat(iPlayer,0);
           client_print_color(iPlayer,iPlayer,"^4[%s] ^1[^3 Ba?ar?l? bir ?ekilde ?apkay? ??kard?n! ^1]",tag);
           menu_destroy(iMenu);
           return PLUGIN_HANDLED;
        }
        if(g_bunukaydet[iPlayer] < SapkaMenu[iL_Key][3][0])
        {
          if(g_Jeton[iPlayer] >= SapkaMenu[iL_Key][2][0])
          {
            client_print_color(iPlayer,iPlayer,"^4[%s] ^1[^3 Ba?ar?l? bir ?ekilde ?apkay? satin ald?n! ^1]",tag);
            g_Jeton[iPlayer] -= SapkaMenu[iL_Key][2][0];
            g_bunukaydet[iPlayer] = SapkaMenu[iL_Key][3][0];
          }
          else
          {
            client_print_color(iPlayer,iPlayer,"^4[%s] ^1[^3 Bu ?apkay? almak i?in yeterli ^4%s ^3yok! ^1]",tag,neykisa);
            @sapka_menusu2(iPlayer);
          }
        }
        else
        {
           @SetUserHat(iPlayer,0);
           @SetUserHat(iPlayer,iL_Key);
           client_print_color(iPlayer,iPlayer,"^4[%s] ^1[^3 Ba?ar?l? bir ?ekilde ?apkay? takt?n! ^1]",tag);
        }
        menu_destroy(iMenu);
        return PLUGIN_HANDLED;
}
@
xp_menusu2(const iPlayer) {
        new Menu menu_create(fmt("\w[\r%s\w] \w| \yXP Menu",TAG), "@xp_menusu3");     
  
        
for(new i=0sizeof(XPMenu); i++) {
        menu_additem(Menu,fmt("\dSatin Al \y%i XP \r[-%i %s]",XPMenu[i][0],XPMenu[i][1],neykisa),fmt("%i",i));
        }  
    
        menu_setprop
(MenuMPROP_BACKNAME,"\w[\yOnceki Sayfa\w]"),menu_setprop(MenuMPROP_NEXTNAME,"\w[\ySonraki Sayfa\w]"),menu_setprop(MenuMPROP_EXITNAME,"\w[\yCikis\w]");
        menu_display(iPlayerMenu);
}
@
xp_menusu3(const iPlayer, const iMenu, const iItem) {
        if(iItem == MENU_EXIT
        
           menu_destroy(iMenu);
           return PLUGIN_HANDLED
        }
        new iData[6],iL_Key;
    
    menu_item_getinfo(iMenuiItem_iDatacharsmax(iData));
        iL_Key str_to_num(iData)
        if(g_Jeton[iPlayer] >= XPMenu[iL_Key][1])
        {
           g_Jeton[iPlayer] -= XPMenu[iL_Key][1];    
           set_user_xp
(iPlayer,get_user_xp(iPlayer) + XPMenu[iL_Key][0]);
           client_print_color(iPlayer,iPlayer,"^4[%s] ^1[^3 Ba?ar?yla ^4%d %s ^3kar??l???nda ^4%d XP ^3ald?n. ^1]",tag,XPMenu[iL_Key][1],neykisa,XPMenu[iL_Key][0]);
           }else{
           client_print_color(iPlayer,iPlayer,"^4[%s] ^1[^3 Yeteri kadar ^4%s ^3yok! ^1]",tag,neykisa);
           @xp_menusu2(iPlayer);
        }
        menu_destroy(iMenu);
        return PLUGIN_HANDLED;
}
public 
zp_user_infected_post(iPlayerinfectornemesis ){
       if(zp_get_user_zombie(iPlayer) || zp_get_user_nemesis(iPlayer)){
       @SetUserHat(iPlayer,0);}
}
public 
zp_round_ended(WIN_HUMANS){
       new players[32],inum;
       static tempid;
       get_players(players,inum)
       for(new ii<inumi++){
       tempid players[i]
       if(is_user_alive(tempid) && !zp_get_user_zombie(tempid)){
       client_print(tempidprint_center"+1 %s",ney),
       g_Jeton[tempid] += 1;
       }
       }
       return PLUGIN_HANDLED;
}
@
SetUserHat(const iPlayer, const iHatNum) {
        switch(iHatNum){
        case 0:{
        iHatEnt[iPlayer] > rg_remove_entity(iHatEnt[iPlayer]):(iHatEnt[iPlayer] = 0);
        }
        default:{
        iHatEnt[iPlayer] = rg_create_entity("info_target");
        set_entvar(iHatEnt[iPlayer],var_movetype,MOVETYPE_FOLLOW);
        set_entvar(iHatEnt[iPlayer],var_aiment,iPlayer);
        set_entvar(iHatEnt[iPlayer],var_rendermode,kRenderNormal);
        set_entvar(iHatEnt[iPlayer],var_modelindex,iHatModels[iHatNum]);
        }
        }
}
rg_remove_entity(const iEnt){
        if(is_entity(iEnt))
        set_entvar(iEnt,var_flags,FL_KILLME);
}
SaveLevel(id){
    new 
szAuth[33];
    new 
szKey[64];
    
    
get_user_authid(id szAuth charsmax(szAuth));
    
formatex(szKey 63 "%s-ID" szAuth);
    new 
szData[256];
        
    
formatex(szData 255 "%i#%i#"g_Jeton[id], g_bunukaydet[id]);
    
nvault_pset(g_Vault szKey szData);
}
LoadLevel(id){
    new 
szAuth[33];
    new 
szKey[40];
    
    
get_user_authid(id szAuth charsmax(szAuth));
    
formatex(szKey 63 "%s-ID" szAuth);
    
    new 
szData[256]
        
    
formatex(szData 255"%i#%i#"g_Jeton[id], g_bunukaydet[id]);
        
    
nvault_get(g_VaultszKeyszData255);
        
    
replace_all(szData 255"#"" ");
    new 
level[32], kd[32];
    
parse(szDatalevel31kd31);
    
g_Jeton[id] = str_to_num(level);
    
g_bunukaydet[id] = str_to_num(kd);

Yarın deneyip haber verecem

(13-07-2023, 02:07)QuryWesT Adlı Kullanıcıdan Alıntı: Deneyiniz:
PHP Kod:
#include <amxmodx>
#include <reapi>
#include <nvault>
new const TAG[] = "DeadLy Escape Zombie Escape"
new const tag[] = "DeadLy Escape"
new const ney[] = "Escape Coin"
new const neykisa[] = "E.C"
new const SapkaMenu[][][] = {
        //{"Sapka Adi","Model Yolu",Fiyati,Kacinci Sirada}
        {"Mask","models/deadlyescape/hats/headcase.mdl",250,1},
    {
"Mario","models/deadlyescape/hats/mario.mdl",500,2},
    {
"Sailor","models/deadlyescape/hats/denizci.mdl",750,3},
        {"Arab","models/deadlyescape/hats/arab.mdl",1000,4},
    {
"HolyHunter","models/deadlyescape/hats/holyhunter.mdl",1250,5},
    {
"Dog","models/deadlyescape/hats/dog.mdl",1500,6},
        {"RoboKay","models/deadlyescape/hats/robokaykay.mdl",1750,7},
    {
"Sokacu","models/deadlyescape/hats/sokacu.mdl",2000,8},
    {
"Nemesis","models/deadlyescape/hats/nemesis.mdl",2250,9},
        {"Toxic","models/deadlyescape/hats/toxic.mdl",2500,10
};
new const 
XPMenu[][] = {
        //{"Kac XP Alacak?","Kac Escape Coin verecek?"}
        {2000,100},
        {5000,200},
        {8500,300},
        {11500,400}
};
native zp_get_user_zombie(iPlayer);
native zp_get_user_nemesis(iPlayer);
native set_user_xp(iPlayer,amount);
native get_user_xp(iPlayer);
new 
g_Vault,iHatModels[sizeof(SapkaMenu)+1],iHatEnt[MAX_CLIENTS+1],g_Jeton[MAX_CLIENTS+1],g_bunukaydet[MAX_CLIENTS+1];
public 
plugin_init() {
        register_plugin(ney"1.0""Kalipso22,Tayo")
        register_concmd("amx_coinver","pKrediVer",ADMIN_RCON,"<isim> <miktar>");
        register_concmd("amx_coinsil","pKrediAl",ADMIN_RCON,"<isim> <miktar>");    
}
public 
plugin_end()
{
    
nvault_close(g_Vault);
}
public 
plugin_cfg()
{
    
g_Vault nvault_open("coin_data")
    if ( 
g_Vault == INVALID_HANDLE )
    
set_fail_state"[ZE:3.0] Level Vault Dosyasi Acilamiyor!" )

public 
plugin_precache() {
        for(new 1isizeof(SapkaMenu);i++)
        {
            iHatModels[i] = precache_model(SapkaMenu[i][1]);
        }
}
public 
client_connect(id)
{
    
LoadLevel(id);
}
public 
client_disconnected(id)
{
    
SaveLevel(id);
    
g_Jeton[id] = 0;
    
g_bunukaydet[id] = 0
}
public 
plugin_natives()   {
        register_native("get_user_jeton""@NTV_Get");
        register_native("set_user_jeton""@NTV_Set");
        register_native("sapka""@sapka_menusu2"1);
        register_native("xpmenu""@xp_menusu2"1);
}
@
NTV_Get() {
        new iPlayer get_param(1);
        return g_Jeton[iPlayer];
}
@
NTV_Set() {
        new iPlayer get_param(1),amount get_param(2);
        g_Jeton[iPlayer] = amount;
}
public 
pKrediVer(id,pLVL,cid){
        if(~get_user_flags(id) & pLVL)
        {
           return PLUGIN_HANDLED;
        }
        new pYazi1[32],pYazi2[18],pIsim[33];
        read_argv(1,pYazi1,31);
        read_argv(2,pYazi2,17);
        new pUID find_player("bl",pYazi1);
        get_user_name(idpIsim32);
        new pDeger str_to_num(pYazi2);
        g_Jeton[pUID] += pDeger;    
        client_print_color
(pUID,pUID,"^4[%s] ^3Size ^4%d ^3%s Verildi!",tag,pDeger,ney);
        return PLUGIN_HANDLED;

public 
pKrediAl(id,pLVL,cid){
        if(~get_user_flags(id) & pLVL)
        {
           return PLUGIN_HANDLED;
        }
        new pYazi1[32],pYazi2[18],pIsim[33];
        read_argv(1,pYazi1,31);
        read_argv(2,pYazi2,17);
        new pUID find_player("bl",pYazi1);
        get_user_name(idpIsim32);
        new pDeger str_to_num(pYazi2);
        g_Jeton[pUID] -= pDeger;                
        client_print_color
(pUID,pUID,"^4[%s] ^3Sizden ^4%d ^3%s Alindi!",tag,pDeger,ney);
        return PLUGIN_HANDLED;

@
sapka_menusu2(const iPlayer) {
        if(!zp_get_user_zombie(iPlayer)) {
        new Menu menu_create(fmt("\r[Deadly Escape] \y~ \wSapka Menu"), "@sapka_menusu3");   
        menu_additem
(Menu,fmt("\wSapkayi Cikar"),"333");
        for(new i=0sizeof(SapkaMenu); i++) 
        {
          /*new iL_Key;
          iL_Key = i;*/
          if(g_bunukaydet[iPlayer] < SapkaMenu[i][3][0])
          {        
             menu_additem
(Menu,fmt("\d%s \r[%i %s]",SapkaMenu[i][0],SapkaMenu[i][2],neykisa),fmt("%i",i));
          }
          else
          {
             menu_additem(Menu,fmt("\w%s",SapkaMenu[i][0]),fmt("%i",i));
          }
        }  
        menu_setprop
(MenuMPROP_BACKNAME,"\d[Onceki Sayfa]"),menu_setprop(MenuMPROP_NEXTNAME,"\d[Sonraki Sayfa]"),menu_setprop(MenuMPROP_EXITNAME,"\wCikis");
        menu_display(iPlayerMenu);
       } else client_print_color(iPlayeriPlayer"Bu menuye zombiler giremez");
}
@
sapka_menusu3(const iPlayer, const iMenu, const iItem) {
        if(iItem == MENU_EXIT
        
           menu_destroy(iMenu);
           return PLUGIN_HANDLED;
        }
        if(zp_get_user_zombie(iPlayer) { 
           menu_destroy(iMenu);return PLUGIN_HANDLED;
           client_print_color(iPlayeriPlayer"Bu menuyu zombiler kullanamaz!");
        
        new iData[6],iL_Key;
        menu_item_getinfo(iMenuiItem_iDatacharsmax(iData));
        iL_Key str_to_num(iData)
        if(iL_Key == 333)
        {
           @SetUserHat(iPlayer,0);
           client_print_color(iPlayer,iPlayer,"^4[%s] ^1[^3 Ba?ar?l? bir ?ekilde ?apkay? ??kard?n! ^1]",tag);
           menu_destroy(iMenu);
           return PLUGIN_HANDLED;
        }
        if(g_bunukaydet[iPlayer] < SapkaMenu[iL_Key][3][0])
        {
          if(g_Jeton[iPlayer] >= SapkaMenu[iL_Key][2][0])
          {
            client_print_color(iPlayer,iPlayer,"^4[%s] ^1[^3 Ba?ar?l? bir ?ekilde ?apkay? satin ald?n! ^1]",tag);
            g_Jeton[iPlayer] -= SapkaMenu[iL_Key][2][0];
            g_bunukaydet[iPlayer] = SapkaMenu[iL_Key][3][0];
          }
          else
          {
            client_print_color(iPlayer,iPlayer,"^4[%s] ^1[^3 Bu ?apkay? almak i?in yeterli ^4%s ^3yok! ^1]",tag,neykisa);
            @sapka_menusu2(iPlayer);
          }
        }
        else
        {
           @SetUserHat(iPlayer,0);
           @SetUserHat(iPlayer,iL_Key);
           client_print_color(iPlayer,iPlayer,"^4[%s] ^1[^3 Ba?ar?l? bir ?ekilde ?apkay? takt?n! ^1]",tag);
        }
        menu_destroy(iMenu);
        return PLUGIN_HANDLED;
}
@
xp_menusu2(const iPlayer) {
        new Menu menu_create(fmt("\w[\r%s\w] \w| \yXP Menu",TAG), "@xp_menusu3");     
  
        
for(new i=0sizeof(XPMenu); i++) {
        menu_additem(Menu,fmt("\dSatin Al \y%i XP \r[-%i %s]",XPMenu[i][0],XPMenu[i][1],neykisa),fmt("%i",i));
        }  
    
        menu_setprop
(MenuMPROP_BACKNAME,"\w[\yOnceki Sayfa\w]"),menu_setprop(MenuMPROP_NEXTNAME,"\w[\ySonraki Sayfa\w]"),menu_setprop(MenuMPROP_EXITNAME,"\w[\yCikis\w]");
        menu_display(iPlayerMenu);
}
@
xp_menusu3(const iPlayer, const iMenu, const iItem) {
        if(iItem == MENU_EXIT
        
           menu_destroy(iMenu);
           return PLUGIN_HANDLED
        }
        new iData[6],iL_Key;
    
    menu_item_getinfo(iMenuiItem_iDatacharsmax(iData));
        iL_Key str_to_num(iData)
        if(g_Jeton[iPlayer] >= XPMenu[iL_Key][1])
        {
           g_Jeton[iPlayer] -= XPMenu[iL_Key][1];    
           set_user_xp
(iPlayer,get_user_xp(iPlayer) + XPMenu[iL_Key][0]);
           client_print_color(iPlayer,iPlayer,"^4[%s] ^1[^3 Ba?ar?yla ^4%d %s ^3kar??l???nda ^4%d XP ^3ald?n. ^1]",tag,XPMenu[iL_Key][1],neykisa,XPMenu[iL_Key][0]);
           }else{
           client_print_color(iPlayer,iPlayer,"^4[%s] ^1[^3 Yeteri kadar ^4%s ^3yok! ^1]",tag,neykisa);
           @xp_menusu2(iPlayer);
        }
        menu_destroy(iMenu);
        return PLUGIN_HANDLED;
}
public 
zp_user_infected_post(iPlayerinfectornemesis ){
       if(zp_get_user_zombie(iPlayer) || zp_get_user_nemesis(iPlayer)){
       @SetUserHat(iPlayer,0);}
}
public 
zp_round_ended(WIN_HUMANS){
       new players[32],inum;
       static tempid;
       get_players(players,inum)
       for(new ii<inumi++){
       tempid players[i]
       if(is_user_alive(tempid) && !zp_get_user_zombie(tempid)){
       client_print(tempidprint_center"+1 %s",ney),
       g_Jeton[tempid] += 1;
       }
       }
       return PLUGIN_HANDLED;
}
@
SetUserHat(const iPlayer, const iHatNum) {
        switch(iHatNum){
        case 0:{
        iHatEnt[iPlayer] > rg_remove_entity(iHatEnt[iPlayer]):(iHatEnt[iPlayer] = 0);
        }
        default:{
        iHatEnt[iPlayer] = rg_create_entity("info_target");
        set_entvar(iHatEnt[iPlayer],var_movetype,MOVETYPE_FOLLOW);
        set_entvar(iHatEnt[iPlayer],var_aiment,iPlayer);
        set_entvar(iHatEnt[iPlayer],var_rendermode,kRenderNormal);
        set_entvar(iHatEnt[iPlayer],var_modelindex,iHatModels[iHatNum]);
        }
        }
}
rg_remove_entity(const iEnt){
        if(is_entity(iEnt))
        set_entvar(iEnt,var_flags,FL_KILLME);
}
SaveLevel(id){
    new 
szAuth[33];
    new 
szKey[64];
    
    
get_user_authid(id szAuth charsmax(szAuth));
    
formatex(szKey 63 "%s-ID" szAuth);
    new 
szData[256];
        
    
formatex(szData 255 "%i#%i#"g_Jeton[id], g_bunukaydet[id]);
    
nvault_pset(g_Vault szKey szData);
}
LoadLevel(id){
    new 
szAuth[33];
    new 
szKey[40];
    
    
get_user_authid(id szAuth charsmax(szAuth));
    
formatex(szKey 63 "%s-ID" szAuth);
    
    new 
szData[256]
        
    
formatex(szData 255"%i#%i#"g_Jeton[id], g_bunukaydet[id]);
        
    
nvault_get(g_VaultszKeyszData255);
        
    
replace_all(szData 255"#"" ");
    new 
level[32], kd[32];
    
parse(szDatalevel31kd31);
    
g_Jeton[id] = str_to_num(level);
    
g_bunukaydet[id] = str_to_num(kd);

Fotaraf atamadım böyle error verdi

ze_jeton.sma(156) : error 001: expected token: ")", but found "{"
Son Düzenleme: 13-07-2023, 15:01, Düzenleyen: AloneDark..
#6
İstek konusu, @scuro adlı kullanıcı tarafından 2 gün içinde çözülmüştür.
İsteği çözdüğü için scuro Adlı kullanıcıya 1 rep puanı ve 1 yardım etme puanı otomatik olarak verilmiştir.
scuro Adlı kullanıcı sizin dışınızda toplam 1344 kişiye yardım etmiştir.

Herhangi bir konuda hata olduğunu düşünüyorsanız destek sistemi üzerinden iletişim kurabilirsiniz.

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da
Task
Kayıt Ol
Discord Adresimize Katılın