Raised This Month: $51 Target: $400
 12% 

What I did wrong?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
skz
Senior Member
Join Date: Jul 2014
Location: Portugal
Old 03-09-2015 , 12:14   What I did wrong?
Reply With Quote #1

My plugin doesn't work, I wanted to open a motd whanever someone type /vip or 30 seconds after someone joins the server.

PHP Code:
#include <sourcemod>

public Plugin:myinfo 
{
    
name "VIP",
    
author "Skatz",
    
description "VIP CS:GO",
    
version "1.0",
    
url "warStation.pt"
}

public 
OnPluginStart()
{
    
HookEvent("player_say"event_PlayerSay);
}

public 
OnClientPutInServer(client)
{
    
CreateTimer(30.0EntradaVIPGetClientSerial(client))
}

public 
Action:event_PlayerSay(Handle:event, const String:name[], bool:dontBroadcast)
{
    
decl String:Texto[128];
    
    
GetEventString(event"text"Textosizeof(Texto));
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    
    if (
StrEqual(Texto"/vip"))
    {
        
MotdVIP(client)
    }
    


public 
MotdVIP(client)
{
    new const 
String:URL[] = "http://warstation.pt/csgo/comprarvip.html"    
    
ShowMOTDPanel(client"[wS] Comprar VIP"URLMOTDPANEL_TYPE_URL);
}

public 
Action:EntradaVIP(Handle:timerany:serial)
{
    new 
client GetClientFromSerial(serial);
    
    if (
client == 0)
    {
        return 
Plugin_Stop;
    }
    
    new const 
String:URL[] = "http://warstation.pt/csgo/comprarvip.html"    
    
ShowMOTDPanel(client"[wS] Comprar VIP"URLMOTDPANEL_TYPE_URL);
    
    return 
Plugin_Handled;

__________________

Last edited by skz; 03-09-2015 at 12:32.
skz is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 03-09-2015 , 12:16   Re: What I did wrong?
Reply With Quote #2

Quote:
Originally Posted by skz View Post
My plugin doesn't work[...]
Oh yeah that one. More info please.
My guess is that the whole openmotd thing only works with https these days.
__________________
Santa or Satan?

Watch out when you're paying people for private requests! Most stuff already exists and you can hardly assess the quality of what you'll get, and if it's worth the money.
Dr. Greg House is offline
Brrdy
Senior Member
Join Date: Feb 2015
Old 03-09-2015 , 12:25   Re: What I did wrong?
Reply With Quote #3

Alright I will look at it does it compile or.....?
Brrdy is offline
Brrdy
Senior Member
Join Date: Feb 2015
Old 03-09-2015 , 12:26   Re: What I did wrong?
Reply With Quote #4

Figured it out already you never did anything with "infos" like defined it,etc.
Brrdy is offline
skz
Senior Member
Join Date: Jul 2014
Location: Portugal
Old 03-09-2015 , 12:27   Re: What I did wrong?
Reply With Quote #5

decl String: infos[ 128 ]

I defined but somehow when I copy pasted the code, that part of the code dissapear.

Yes, it compiles, but it doesn't work...
__________________

Last edited by skz; 03-09-2015 at 12:28.
skz is offline
Brrdy
Senior Member
Join Date: Feb 2015
Old 03-09-2015 , 12:28   Re: What I did wrong?
Reply With Quote #6

native Format(String:buffer[], maxlength, const String:format[], any:...);


So im guessing you need to make it so
It formats whatever string you are using eg: Format(StringlayerAuth[], LengthOf(PlayerAuth), vip, etc,etc)
Maybe?
Brrdy is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 03-09-2015 , 12:32   Re: What I did wrong?
Reply With Quote #7

Quote:
Originally Posted by skz View Post
[...]but it doesn't work...
__________________
Santa or Satan?

Watch out when you're paying people for private requests! Most stuff already exists and you can hardly assess the quality of what you'll get, and if it's worth the money.
Dr. Greg House is offline
skz
Senior Member
Join Date: Jul 2014
Location: Portugal
Old 03-09-2015 , 12:34   Re: What I did wrong?
Reply With Quote #8

Quote:
Originally Posted by Brrdy View Post
native Format(String:buffer[], maxlength, const String:format[], any:...);


So im guessing you need to make it so
It formats whatever string you are using eg: Format(StringlayerAuth[], LengthOf(PlayerAuth), vip, etc,etc)
Maybe?
Forget about the infos xD
It was a part of the code that I didn't want to post here and now I think is confusing you. I edited my thread, I just wanted to know why whenever I write /vip on the server the motd doesn't appear and when I join, 30 seconds after It doesn't appear too.

I'm new on sourcepawn btw but I already have some skills on amxx
__________________

Last edited by skz; 03-09-2015 at 12:34.
skz is offline
Brrdy
Senior Member
Join Date: Feb 2015
Old 03-09-2015 , 12:41   Re: What I did wrong?
Reply With Quote #9

Quote:
Originally Posted by skz View Post
Forget about the infos xD
It was a part of the code that I didn't want to post here and now I think is confusing you. I edited my thread, I just wanted to know why whenever I write /vip on the server the motd doesn't appear and when I join, 30 seconds after It doesn't appear too.

I'm new on sourcepawn btw but I already have some skills on amxx
Aww oaky lol I see now. AMX is easier in my point of view. But Sourcemod I think is better ;P
But like sourcemod is better in certain aspects but anyways. / and ! are predefined lol just use Action Command or whatever. It works 100%
Like as long as the cmd is marked as "sm_vip"
!vip
And /vip will work
Brrdy is offline
skz
Senior Member
Join Date: Jul 2014
Location: Portugal
Old 03-09-2015 , 14:10   Re: What I did wrong?
Reply With Quote #10

Quote:
Originally Posted by Brrdy View Post
Aww oaky lol I see now. AMX is easier in my point of view. But Sourcemod I think is better ;P
But like sourcemod is better in certain aspects but anyways. / and ! are predefined lol just use Action Command or whatever. It works 100%
Like as long as the cmd is marked as "sm_vip"
!vip
And /vip will work
I'm exploring Sourcemod and seems to be harder!
How I hook that action command?
__________________
skz 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 13:59.


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