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

Sourcepawn and plugin making


Post New Thread Reply   
 
Thread Tools Display Modes
matchaboy
Senior Member
Join Date: Jun 2013
Location: Bananaland
Old 10-18-2013 , 07:17   Re: Sourcepawn and plugin making
Reply With Quote #21

Quote:
Originally Posted by floube View Post
If you want to get the parameters the user gave (eg. <message>) than: Yes.
so example i have the if(args < 1) and if(args > 1)

so i put GetCmdArg(1) and GetCmdArg(2) right?

Edit 1: Would this work?

Code:
 GetCmdArg(1, Arg1, sizeof(Arg1)); 
     GetClientName(client, name, sizeof(name));
     PrintToChat(client, %s: %s, name, Arg1);
     
     GetCmdArg(2, Arg2, sizeof(Arg2));
     GetClientName(client, name, sizeof(name));
     PrintToChat(client, %s : %s, name, Arg2);
The strings being new String : Arg1[32];
__________________
Learning how to make plugins.

Last edited by matchaboy; 10-18-2013 at 07:23.
matchaboy is offline
floube
SourceMod Donor
Join Date: Jan 2013
Location: Austria
Old 10-18-2013 , 07:27   Re: Sourcepawn and plugin making
Reply With Quote #22

Completely right.

An if before GetCmdArg avoids problems:

PHP Code:
if (args != 2) {
    
PrintToChat(client"Usage: !command <message> <player>");
        
    return 
Plugin_Handled;

floube is offline
matchaboy
Senior Member
Join Date: Jun 2013
Location: Bananaland
Old 10-18-2013 , 07:32   Re: Sourcepawn and plugin making
Reply With Quote #23

after this the plugin can end right?

Edit 1 : How do I enable the cvar? also public Action?

Edit 2 : This was how I put it, but i'm not quite sure if it will work

Code:
public OnClientPutInServer(client
{
    new IsEnabled = GetConVarInt(report_enable);          //report_enable = IsEnabled
    if(IsEnabled == 1)
    {
      new String:EP[99];                                  //report_email
      Get ConVarString(report_email, EP, sizeof(EP));
      
     if(IsEnabled == 0)
   {
     report_email = "NONE"
   }
Edit 3: Nevermind I understand it now, I am left with a last part of my plugin, which is to send an email through typing !command

Any ideas how to do it?
__________________
Learning how to make plugins.

Last edited by matchaboy; 10-18-2013 at 09:48.
matchaboy is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 10-18-2013 , 11:42   Re: Sourcepawn and plugin making
Reply With Quote #24

nevermind, looks like you figured it out

Also, use the PHP tag instead of the CODE tag for sourcepawn... or you could try the PAWN tag too
__________________
View my Plugins | Donate

Last edited by TnTSCS; 10-18-2013 at 11:43.
TnTSCS is offline
matchaboy
Senior Member
Join Date: Jun 2013
Location: Bananaland
Old 10-18-2013 , 11:44   Re: Sourcepawn and plugin making
Reply With Quote #25

What's wrong in this code?

Edit 1 : Also, in the earlier post the !command <message>

This <message> how do i use it for a string?

like new String and then smth, cos i'm trying to use this plugin : https://forums.alliedmods.net/showthread.php?t=105443

Any help?
__________________
Learning how to make plugins.

Last edited by matchaboy; 10-18-2013 at 11:49.
matchaboy is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 10-18-2013 , 11:45   Re: Sourcepawn and plugin making
Reply With Quote #26

Quote:
Originally Posted by matchaboy View Post
... I am left with a last part of my plugin, which is to send an email through typing !command

Any ideas how to do it?
Look at this plugin to see how you can send eMail: https://forums.alliedmods.net/showthread.php?t=166577
__________________
View my Plugins | Donate

Last edited by TnTSCS; 10-18-2013 at 11:45.
TnTSCS is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 10-18-2013 , 11:47   Re: Sourcepawn and plugin making
Reply With Quote #27

Quote:
Originally Posted by matchaboy View Post
What's wrong in this code?
what code?
__________________
View my Plugins | Donate
TnTSCS is offline
matchaboy
Senior Member
Join Date: Jun 2013
Location: Bananaland
Old 10-18-2013 , 11:51   Re: Sourcepawn and plugin making
Reply With Quote #28

Quote:
Originally Posted by TnTSCS View Post
what code?
Nothing, now.
__________________
Learning how to make plugins.
matchaboy is offline
matchaboy
Senior Member
Join Date: Jun 2013
Location: Bananaland
Old 10-18-2013 , 11:51   Re: Sourcepawn and plugin making
Reply With Quote #29

Quote:
Originally Posted by TnTSCS View Post
Look at this plugin to see how you can send eMail: https://forums.alliedmods.net/showthread.php?t=166577
Is it possible i enter the code in my plugin?
__________________
Learning how to make plugins.
matchaboy is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 10-18-2013 , 11:54   Re: Sourcepawn and plugin making
Reply With Quote #30

I think you need to slow your roll a little. You are way too anxious to get something accomplished without first understanding the basics.

Between the wiki links I posted for CVars and Commands, and looking at peace-maker's code you should be able to figure out how to make a plugin that can send eMail when a user types the command and arguments.
__________________
View my Plugins | Donate

Last edited by TnTSCS; 10-18-2013 at 11:55.
TnTSCS 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 05:32.


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