Raised This Month: $ Target: $400
 0% 

Help in editing a code


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Obada
Senior Member
Join Date: Dec 2014
Location: Abu Dhabi
Old 01-09-2015 , 04:25   Help in editing a code
Reply With Quote #1

Hey there.

I'm trying to edit the plugin adminvote.sma, so basically what I want it to do is if staff member of the server made a vote and everybody voted, at last he/she will be asked to continue, if he/she declined, then there's a message will be printed saying Result Refused, and if he/she accepted, a message will be printed saying Result accepted.


So what I'm trying to do is when an admin makes a vote and he/she want's to continue, It will say

Result Accepted by Administrator %s

and if he/she wants to decline, it would say

Result Refused by Administrator %s


But the problem is I have an 2 extra staff ranks which are Golden and Silver Players.

and if they accepted or decline a vote, it would say

Result Accepted/Refused by GP/SP %s, %s should be the name of the staff member.


Here what I tried.

PHP Code:
public actionResult(idkey)
{
    
remove_task(4545454)
    
    switch (
key)
    {
        case 
0:
        {
            
set_task(2.0"delayedExec"0g_Executeg_execLen)
            
log_amx("Vote: %L""en""RES_ACCEPTED")
            
            if(
get_user_flags(id) & SILVER)
                    
client_print(0print_chat"%L"LANG_PLAYER"RES_ACCEPTED_S1")
        
            else if(
get_user_flags(id) & ADMIN)
                    
client_print(0print_chat"%L"LANG_PLAYER"RES_ACCEPTED_A1")
        
            else if(
get_user_flags(id) & GOLDEN)
                    
client_print(0print_chat"%L"LANG_PLAYER"RES_ACCEPTED"_G1)
        }
        case 
1autoRefuse()
    }
    
    return 
PLUGIN_HANDLED

Thank you
Obada is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:30.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode