Welcome to The Forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads

Wanting To Learn Sourcepawn Scripting


---------
 Share

Recommended Posts

You'll never get as good of a tutorial for pawn as there is for PHP or other major languages. Although it's based off of C, you don't need to learn C. It's a simple language so it shouldn't take much to learn. Start here: http://wiki.alliedmods.net/Introduction_to_SourcePawn. That's about all you'll really need to get started.

Link to comment
Share on other sites

Here is the tutorial:

http://wiki.alliedmo...n_to_SourcePawn

 

Before you write the mods, you need to get

Source Dedicated Server (srcds) to test your mods

http://www.srcds.com...l&id=1097362093

 

Then you need to install metamod. SourceMod is a Metamod.

http://wiki.alliedmo..._Metamod:Source

 

Then SourceMod itself so you have the libraries

http://wiki.alliedmo...lling_SourceMod

 

To do your coding in SourcePawn, I'd say use the PawnStudio IDE

http://sourceforge.n...cts/pawnstudio/

Edited by BlackEyes
Link to comment
Share on other sites

Thanks for the info! Looks good, I'll dive into it when I get home from school.

 

 

Before you write the mods, you need to get

Source Dedicated Server (srcds) to test your mods

http://www.srcds.com...l&id=1097362093

 

Then you need to install metamod. SourceMod is a Metamod.

http://wiki.alliedmo..._Metamod:Source

 

Then SourceMod itself so you have the libraries

http://wiki.alliedmo...lling_SourceMod

 

I've setup and installed many SRCDS server, so this is second narture. ;)

Edited by Enigmo
Link to comment
Share on other sites

I call it, BaconMod! I'm quite happy with myself considering I've never coded a SourceMod plugin until a few hours ago. :P

 

#include <sourcemod>


public Plugin:myinfo = {
name = "Bacon",
author = "Enigmo",
description = "Share your love of bacon with everyone.",
version = "1.0",
url = "www.enigmo.co"
}

public OnPluginStart(){
RegAdminCmd("sm_bacon", commandBacon, ADMFLAG_SLAY, "Tell everyone how much you love bacon.");
}


public Action:commandBacon(client, args){
if(args < 1){
 PrintToConsole(client, "[baconMod] You need to tell everyone how crispy you like your bacon!");
 PrintToConsole(client, "[baconMod] Usage: sm_bacon <crispyness>");
 PrintToChat(client, "[baconMod] You need to tell everyone why you love bacon so much!");
 PrintToChat(client, "[baconMod] Usage: !bacon \"crispyness\"");
 return Plugin_Handled;
}

new String:Arg1[32], String:userName[32];

GetCmdArg(1, Arg1, sizeof(Arg1));
GetClientName(client, userName, sizeof(userName));

PrintToChatAll("[baconMod] %s loves their bacon %s", userName, Arg1);

return Plugin_Handled;
}

Link to comment
Share on other sites

  • 5 months later...

Try reversing your if statement so that the first statement is the header change. As Enigma stated, outputting crap outside of php tags can cause the buffer to be sent. As such, you cannot modify the headers. Use ob_start too, again as Enigma suggested.

Link to comment
Share on other sites

Guest The_Monkey

Try reversing your if statement so that the first statement is the header change. As Enigma stated, outputting crap outside of php tags can cause the buffer to be sent. As such, you cannot modify the headers. Use ob_start too, again as Enigma suggested.

 

LOL what.

  • Like 1
Link to comment
Share on other sites

Try reversing your if statement so that the first statement is the header change. As Enigma stated, outputting crap outside of php tags can cause the buffer to be sent. As such, you cannot modify the headers. Use ob_start too, again as Enigma suggested.

 

c3d0981ae770f926eedf4eda7505b006.jpeg

Link to comment
Share on other sites

Try reversing your if statement so that the first statement is the header change. As Enigma stated, outputting crap outside of php tags can cause the buffer to be sent. As such, you cannot modify the headers. Use ob_start too, again as Enigma suggested.

 

Which conversation are you apart of exactly? Because it isn't this one.

 

On topic, the crispyness parameter for the bacon command isn't sanitized to prevent unwanted input, therefor the plugin is inherently flawed. I will not be distributing my love of bacon to the masses using this plugin as a result.

Edited by Papa John
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share