Raised This Month: $32 Target: $400
 8% 

Create timer


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
szogun
Senior Member
Join Date: Apr 2016
Old 11-13-2017 , 16:11   Create timer
Reply With Quote #1

Hey
I'm trying to add a timer to the plugin just do not know too much about what function it is because it gets the error that it's old

PHP Code:
public void OnClientPutInServer(int client)
{
    
CreateTimer(7.0CallVoteGetClientSerial(client)); 

Code:
error 100: function prototypes do not match
szogun is offline
Walgrim
AlliedModders Donor
Join Date: Dec 2015
Location: France
Old 11-13-2017 , 16:27   Re: Create timer
Reply With Quote #2

Hey,
PHP Code:
public void OnClientPutInServer(int client)
{
    
CreateTimer(7.0CallVoteGetClientSerial(client));
}

public 
Action:CallVote(Handle:Timerclient) {
  
//Do your stuff

Walgrim is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 11-13-2017 , 16:49   Re: Create timer
Reply With Quote #3

Code:
public void OnClientPutInServer(int client)
{
    CreateTimer(7.0, CallVote, GetClientUserId(client));
}

public Action CallVote(Timer timer, int userid)
{
    int client = GetClientOfUserId(userid);
    if (client == 0)
        return Plugin_Handled;

    // call your vote

    return Plugin_Handled;
}
__________________
Neuro Toxin is offline
Papero
Veteran Member
Join Date: Aug 2016
Location: Italy
Old 11-14-2017 , 02:38   Re: Create timer
Reply With Quote #4

Quote:
Originally Posted by Walgrim View Post
Hey,
PHP Code:
public void OnClientPutInServer(int client)
{
    
CreateTimer(7.0CallVoteGetClientSerial(client));
}

public 
Action:CallVote(Handle:Timerclient) {
  
//Do your stuff


If you use serial you need also to get the client index.
PHP Code:
int client GetClientFromSerial(int serial); 
__________________
My Plugins
SPCode


Steam: hexer504
Telegram: Hexah
Discord: Hexah#6903

If you like my work you can donate here!
Papero is offline
Walgrim
AlliedModders Donor
Join Date: Dec 2015
Location: France
Old 11-14-2017 , 07:40   Re: Create timer
Reply With Quote #5

Quote:
Originally Posted by Papero View Post
If you use serial you need also to get the client index.
PHP Code:
int client GetClientFromSerial(int serial); 
Oh ok, thanks for explaining, didn't know that too :^)
Walgrim is offline
Reply



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 16:38.


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