SA-MP Forums Archive
Hello - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Hello (/showthread.php?tid=377596)



Hello - adelmika - 14.09.2012

hello my name is Adel

iam new and ineed to learn to to scprit

ican't understand anything from that beginner

so anyone canhelp

and told me from where to start


Re: Hello - HuSs3n - 14.09.2012

start from here
https://sampwiki.blast.hk/wiki/PAWN_for_Begginers


Re: Hello - Dolby - 14.09.2012

https://sampforum.blast.hk/showthread.php?tid=92
And
https://sampforum.blast.hk/showthread.php?tid=360911



Re: Hello - Victor' - 14.09.2012

A basic tutorial

pawn Код:
// Top
#include a_samp

public OnPlayerConnect(playerid) // This callback is called when the player connect
{
    SendClientMessage(playerid, 0xFF0000AA, "Welcome :)"); // Send a message to player

    new PlayerName[MAX_PLAYER_NAME], StringMsg[128];
    GetPlayerName(playerid, PlayerName, sizeof PlayerName); // Get the player name and store in a variable

    format(StringMsg, sizeof StringMsg, "Your name: %s | Your playerid: %d", PlayerName, playerid); // Format the StringMsg
    SendClientMessage(playerid, 0x00FF00AA, StringMsg); // Send a message to player

    if(strcmp(PlayerName, "Adel", true) == 0) // if the PlayerName is "Adel"
    {
        SendClientMessage(playerid, 0xFF0000AA, "Welcome Adel!"); // Send a message to player
    }
    if(strfind(PlayerName, "Ad", true) != -1) // if the PlayerName contains the text "Ad"
    {
        SendClientMessage(playerid, 0xFF0000AA, "Your name contains ''Ad''"); // Send a message to player
    }
    return true;
}

/*
SendClientMessage(playerid, color in hex (0xRRGGBBAA), text);
new array[array size];

GetPlayerName(playerid, array, sizeof array);
format(array, sizeof array, text, params); // %s to string | %d to number | %f to float

strcmp(array, text, ignore case sensitive) // Compare a text
strfind(array, text, ignore case sensitive) // Find a text
*/


/* This is a comment */
// This is a comment
Sorry for my bad english