Author Topic: How to code SA-MP Pawn [Tutorial]  (Read 38459 times)

0 Members and 1 Guest are viewing this topic.

Offline [MAF]Rac3r

  • Leader
  • Posts: 2,807
  • Well, this is embarrassing.
    • View Profile
Re: How to code SA-MP Pawn [Tutorial]
« Reply #15 on: February 26, 2010, 10:04:52 am »
Hope so Simon, that's the reason I did this tutorial.

It's a golden gamble.

Offline [MAF]Sighmoan

  • Admin
  • Posts: 1,599
    • View Profile
Re: How to code SA-MP Pawn [Tutorial]
« Reply #16 on: February 26, 2010, 10:23:55 am »
I will do then. I haven't really started in earnest but will make notes on the small simple things i have learn so far and you can amalgamate anything you think prudent into your initial post?

Offline [MAF]Rac3r

  • Leader
  • Posts: 2,807
  • Well, this is embarrassing.
    • View Profile
Re: How to code SA-MP Pawn [Tutorial]
« Reply #17 on: February 26, 2010, 07:24:04 pm »
Sure.

Offline ﱡ קּﻰﺢ Love

  • Admin
  • Posts: 1,936
  • Elements of life: Air, Water, Oil, Fuel
    • View Profile
    • LSR Forum
Re: How to code SA-MP Pawn [Tutorial]
« Reply #18 on: February 26, 2010, 09:55:36 pm »
It will be like apply on the way guide i think.Would be a nice side help to your guide Rac3r.I see youve added new stuff, nice! But i didnt read any bit of it. :L
Sign-A-True

Offline [MAF]MrHess

Re: How to code SA-MP Pawn [Tutorial]
« Reply #19 on: February 26, 2010, 11:37:01 pm »
I still cant stand that stuff, all I can do is text commands XD, I want to open SK server to run @ home, but I need to fix the modes to work on 0.3 and cba to do it, so if somebody wants to gimme a lil hand..... :P
I would much rather be hated for what I am than loved for something that I'm not

Re: How to code SA-MP Pawn [Tutorial]
« Reply #20 on: February 27, 2010, 01:26:29 pm »
Next tutorial is about public OnPlayerConnect and public OnPlayerDisconnect.

1.
Code: [Select]
public OnPlayerConnect(playerid)
{
new player[100];
GetPlayerName(playerid,player, 24);
format(player, 100, "%s has joined the server.",player);// Player Name
SendClientMessageToAll(0xA52A2AAA, player);// Color

SendClientMessage(playerid,0xA52A2AAA,"Welcome to blabla..... ");// SCM

GameTextForPlayer(playerid,"Welcome to Adrenaline~r~X ~w~server.",5000,5);//GT

ShowPlayerDialog(playerid, dialogid, dialogstyle, "welcoming title", "Welcome\nBlablan\nBlabla", "button1", "button2");//  \n = next line

return 1;
}


Game Text: http://wiki.sa-mp.com/wiki/GameTextStyle



2.
Code: [Select]
public OnPlayerDisconnect(playerid, reason)
{
new player[100];//name
GetPlayerName(playerid, player, 30);
switch (reason) {
case 0: format(hrac, 100, "%s has  left the  server.",player);// Reason 1
case 1: format(hrac, 100, "%s has  left the  server.(Timeout)",player);// Reason 2
case 2: format(hrac, 100, "%s has  left the  server (Kick/Ban)",player);// Reason 3
}
SendClientMessageToAll(0xA52A2AAA, player);//color

return 1;
}

This function are easy :) 


Offline [MAF]Rac3r

  • Leader
  • Posts: 2,807
  • Well, this is embarrassing.
    • View Profile
Re: How to code SA-MP Pawn [Tutorial]
« Reply #21 on: May 20, 2012, 04:03:34 pm »
Bump:  Max, here's a nice tutorial to get started.

Offline [MAF]Cromiell

Re: How to code SA-MP Pawn [Tutorial]
« Reply #22 on: May 20, 2012, 04:41:13 pm »
lol Max coding, heh good luck. Even I can do a lot of nice stuffs in website source I have no clue about PAWN. I mean I know how it works but I don't know how to script stuffs there. I'm "learning" since 1 year. :L By the time I would have had already known a lot but I am just too lazy.

Offline [MAF]Karlis

Re: How to code SA-MP Pawn [Tutorial]
« Reply #23 on: May 20, 2012, 04:49:36 pm »
if max really knows basics of C++ like he says this should be easy.

EDIT: nice and short documentation, helped me to get started: http://thedarkjoker94.cer33.com/?p=1017
« Last Edit: May 20, 2012, 04:52:08 pm by [MAF]Karlis »