SA-MP Forums Archive
Learning more about SA:MP Scripting - 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: Learning more about SA:MP Scripting (/showthread.php?tid=515012)



Learning more about SA:MP Scripting - jonas4554 - 24.05.2014

Hello Scripters! i've always been wanting to make a script of my own been trying now for almost 3 and a half year. I've always wanted to learn more about stuff, and it's not really the easiest thing. I've now through my years learnt alot more than i could of ever imagine. Although it feels as if my final lesson would be to learn on how to use parameters. I wish someone could contact me and give me a basic point of view on how the parameters etc system works. As for example on how a command such as /pm [id] [message] works and what all these different parameters actually does in the script.

Skype: Zooth91

Please feel free to contact me! i'd appricate it alot!


Re: Learning more about SA:MP Scripting - Stanford - 24.05.2014

I've done this now:

pawn Код:
CMD:pm(playerid, params[])
{
    new string[128], giveplayerid, message[50];
    if(sscanf(params,"us[50]",giveplayerid, message)) return SendClientMessage(playerid, -1, "USAGE: /PM [playerid][message]");
    if(IsPlayerConnected(giveplayerid) && giveplayerid != INVALID_PLAYER_ID)
    {
        format(string,sizeof(string),"PM Message from (%s): %s", ReturnPlayerName(playerid), message);
        SendClientMessage(giveplayerid, COLOR_ORANGE, string);
    }
    SendClientMessage(playerid, -1, "The message was sent successfully!.");
    return 1;
}


stock ReturnPlayerName(playerid)
{
    new szName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, szName, sizeof(szName));
    return szName;
}
I hope that I helped you, it took from me 2 minutes or something to create it so I didnt test it at all.


Re: Learning more about SA:MP Scripting - jonas4554 - 24.05.2014

Thanks for the post! going to try it right away!