AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Recommendations where to start learning SP?? (https://forums.alliedmods.net/showthread.php?t=317325)

Doggg 07-07-2019 16:06

Recommendations where to start learning SP??
 
Hey, I know C and Java programming languages and I would like to start learning Sourcepawn.
I'm willing to pay money for some good guides or even a teacher (If one of you guys want to help me out please comment).
Any ideas? It seems confusing to start learning this from youtube (i cannot find a good guide for this).

8guawong 07-07-2019 16:15

Re: Recommendations where to start learning SP??
 
https://wiki.alliedmods.net/Introduction_to_SourcePawn
https://wiki.alliedmods.net/Introduc...rceMod_Plugins

LearninG 07-07-2019 16:21

Re: Recommendations where to start learning SP??
 
Quote:

Originally Posted by Doggg (Post 2658159)
Hey, I know C and Java programming languages and I would like to start learning Sourcepawn.
I'm willing to pay money for some good guides or even a teacher (If one of you guys want to help me out please comment).
Any ideas? It seems confusing to start learning this from youtube (i cannot find a good guide for this).

You can learn fast , because you know some other languages ,I suggest you to to first read pawn picture tutorial :

https://forums.alliedmods.net/showthread.php?t=94381

Doggg 07-07-2019 16:27

Re: Recommendations where to start learning SP??
 
Quote:

Originally Posted by LearninG (Post 2658163)
You can learn fast , because you know some other languages ,I suggest you to to first read pawn picture tutorial :

https://forums.alliedmods.net/showthread.php?t=94381

Thank you! I will check this out.
Just wrote out this code, will this work? compiler show no warnings, I just want this command to make some server commands.



#define DEBUG

#define PLUGIN_AUTHOR ""
#define PLUGIN_VERSION "0.00"

#include <sourcemod>
#include <sdktools>
#include <cstrike>
#include <sdkhooks>



public Plugin myinfo =
{
name = "",
author = PLUGIN_AUTHOR,
description = "",
version = PLUGIN_VERSION,
url = ""
};

public void OnPluginStart()
{
RegConsoleCmd("sm_abc",abc);
}

public Action:abc(server,args)
{
ServerCommand("mp_teamlimits 0");
}

kratoss1812 07-07-2019 16:50

Re: Recommendations where to start learning SP??
 
Quote:

Originally Posted by Doggg (Post 2658164)
will this work?

yes but use the damn new syntax

Doggg 07-07-2019 17:08

Re: Recommendations where to start learning SP??
 
Quote:

Originally Posted by kratoss1812 (Post 2658171)
yes but use the damn new syntax

lol dude i have no idea in this language, just learned this an hour or so ago (the VERY BASICS).
what the new syntax is?

farawayf 07-07-2019 17:09

Re: Recommendations where to start learning SP??
 
also dont use unnecessary includes.
and on the RegConsoleCmd callback function parameter is client. just notice.

Quote:

Originally Posted by Doggg (Post 2658173)
lol dude i have no idea in this language, just learned this an hour or so ago (the VERY BASICS).
what the new syntax is?

https://wiki.alliedmods.net/SourcePa...itional_Syntax

Doggg 07-07-2019 17:49

Re: Recommendations where to start learning SP??
 
Quote:

Originally Posted by farawayf (Post 2658174)
also dont use unnecessary includes.
and on the RegConsoleCmd callback function parameter is client. just notice.



https://wiki.alliedmods.net/SourcePa...itional_Syntax

Thanks, I will check this out.
Can you please fix my code? i mean with the new syntax and remove the unnecessary includes and the client parameter? i am sorry if this is rude for me to ask. just trying to learn from the pros.

farawayf 07-07-2019 18:12

Re: Recommendations where to start learning SP??
 
PHP Code:


#include <sourcemod>

#define DEBUG

#define PLUGIN_AUTHOR ""
#define PLUGIN_VERSION "0.00"

#pragma newdecls required


public Plugin myinfo 
{
    
name "",
    
author PLUGIN_AUTHOR,
    
description "",
    
version PLUGIN_VERSION,
    
url ""
}

public 
void OnPluginStart()
{
    
RegConsoleCmd("sm_abc"abc);
}

public 
Action abc(int clientint args//first parameter is client index, who activated the command. 
{
    
ServerCommand("mp_teamlimits 0");

    
//PrintToChat(client, "debug"); - printing the debug message to client index
    
return Plugin_Handled//tell to sourcemod the function is done. Also removing Unknown command warning in game console.



Doggg 07-07-2019 18:29

Re: Recommendations where to start learning SP??
 
Quote:

Originally Posted by farawayf (Post 2658182)
PHP Code:


#include <sourcemod>

#define DEBUG

#define PLUGIN_AUTHOR ""
#define PLUGIN_VERSION "0.00"

#pragma newdecls required


public Plugin myinfo 
{
    
name "",
    
author PLUGIN_AUTHOR,
    
description "",
    
version PLUGIN_VERSION,
    
url ""
}

public 
void OnPluginStart()
{
    
RegConsoleCmd("sm_abc"abc);
}

public 
Action abc(int clientint args//first parameter is client index, who activated the command. 
{
    
ServerCommand("mp_teamlimits 0");

    
//PrintToChat(client, "debug"); - printing the debug message to client index
    
return Plugin_Handled//tell to sourcemod the function is done. Also removing Unknown command warning in game console.



Thank you very much!
i have a few questions, Sorry again for bothering you.
first, cilent will always will be an integer parameter? same with args.
the debug message is just printing for the client "debug" to chat right?
the return plugin_handled is like a must return? i mean at the end of every plugin you must put it?


All times are GMT -4. The time now is 04:33.

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