AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   What I did wrong? (https://forums.alliedmods.net/showthread.php?t=259574)

skz 03-09-2015 12:14

What I did wrong?
 
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;



Dr. Greg House 03-09-2015 12:16

Re: What I did wrong?
 
Quote:

Originally Posted by skz (Post 2271660)
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.

Brrdy 03-09-2015 12:25

Re: What I did wrong?
 
Alright I will look at it does it compile or.....?

Brrdy 03-09-2015 12:26

Re: What I did wrong?
 
Figured it out already you never did anything with "infos" like defined it,etc.

skz 03-09-2015 12:27

Re: What I did wrong?
 
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...

Brrdy 03-09-2015 12:28

Re: What I did wrong?
 
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(String:PlayerAuth[], LengthOf(PlayerAuth), vip, etc,etc)
Maybe?

Dr. Greg House 03-09-2015 12:32

Re: What I did wrong?
 
Quote:

Originally Posted by skz (Post 2271668)
[...]but it doesn't work...


skz 03-09-2015 12:34

Re: What I did wrong?
 
Quote:

Originally Posted by Brrdy (Post 2271669)
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(String:PlayerAuth[], 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

Brrdy 03-09-2015 12:41

Re: What I did wrong?
 
Quote:

Originally Posted by skz (Post 2271677)
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 :P

skz 03-09-2015 14:10

Re: What I did wrong?
 
Quote:

Originally Posted by Brrdy (Post 2271679)
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 :P

I'm exploring Sourcemod and seems to be harder!
How I hook that action command?


All times are GMT -4. The time now is 09:36.

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