Raised This Month: $ Target: $400
 0% 

A little help.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 06-12-2014 , 16:50   Re: A little help.
Reply With Quote #3

First you have to remove the check for the team before setting the task. In other word:
PHP Code:
public client_spawn(id)
{
if(
task_exists(id USERTASK))
{
remove_task(id USERTASK)
}

if(
get_user_team(id) == 1)
{
userreason[id] = random_num(0sizeof reasons 1)

set_task(UPDATEDELAY"client_jailinfo"id USERTASK__"b")
}

Should look like this:
PHP Code:
public client_spawn(id)
{
    if(
task_exists(id USERTASK))
    {
        
remove_task(id USERTASK)
    }
    
    
userreason[id] = random_num(0sizeof reasons 1)
    
    
set_task(UPDATEDELAY"client_jailinfo"id USERTASK__"b")
    

Then we put a check and format the message depending on user's team in the task itself. There are two ways to do what you want, on my mind.

1)
PHP Code:
public client_jailinfo(TASKID)
{
    static 
id
    id 
TASKID USERTASK

    set_hudmessage
(025500.80.106.012.0)

    new 
message[64]
    switch(
get_user_team(id))
    {
        case 
1formatex(messagecharsmax(message), "Day: %d | Reason: %s"roundsreasons[userreason[id]])
        case 
2formatex(messagecharsmax(message), "Day: %d"rounds)
    }
    
ShowSyncHudMsg(idhudhandlermessage)

2)
PHP Code:
public client_jailinfo(TASKID)
{
    static 
id
    id 
TASKID USERTASK

    set_hudmessage
(025500.80.106.012.0)

    new 
message[64]
    
formatex(messagecharsmax(message),"  | Reason: %s"reasons[userreason[id]])
    
ShowSyncHudMsg(idhudhandler"Day: %d%s"roundsget_user_team(id) == message "")

__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
 



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 21:10.


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