SA-MP Forums Archive
[Include] Simple Script Include (SSI) - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] Simple Script Include (SSI) (/showthread.php?tid=295419)



Simple Script Include (SSI) - GAMER_PS2 - 06.11.2011

Hello i introduce you my first simple script include
the name of include is SSI (Simple Script Include)
on next version the name would be change
the include function is for beginners. Any idea
for function on include? PM Me!

Heres what the include can do:

pawn Код:
MessageToRcon(color,msg); //Will sent msg to RCON Admins
Kill(playerid); //Will kill yourself just like SetPlayerHealth(playerid, 0);
ChatLog(playerid, text); //Will save the chat on Server/Logs/ - Credits to System64
GetName(playerid) //Theres no special here this is for ChatLog Function - Credits to System64
Examples:

pawn Код:
ChatLog(playerid, text); //Will save in Server/Logs/
   
if(text[0] == '!' && IsPlayerAdmin(playerid) && strlen(text[1]))
{
     new string[128];
     new RCONNAME[MAX_PLAYER_NAME];
     GetPlayerName(playerid,RCONNAME,MAX_PLAYER_NAME);
     format(string,sizeof(string),"RCON Leader Chat: %s: "white"%s",string,text[1]); //Chat Format
     MessageToRcon(COLOR_RED,string); //Will sent to RCON Admins
}
pawn Код:
CMD:kill(playerid, params[])
{
    Kill(playerid); //Will set your health to 0
    return 1;
}
Hope you like it. useful for beginners.
you can modify it but credits to me

Link:

http://pastebin.com/uAmeLW6T

UPDATE:

Link is update edited. sorry for mistakes
What should i name for Simple Script Include
i cant take any name because some of name of include is taken


Re: Simple Script Include (SSI) - Lorenc_ - 06.11.2011

Recommending to use foreach, pointless include anyway.


Re: Simple Script Include (SSI) - [HiC]TheKiller - 06.11.2011

Here is a little tip for future coding. Defines are quicker than stocks. When you have something like the Kill stock function, you can easily make it into a define which would use less resources.

pawn Код:
stock Kill(playerid)
{
    SetPlayerHealth(playerid, 0);
    return 1;
}
Can go into
pawn Код:
#define Kill(%1) SetPlayerHealth(%1, 0)



Re: Simple Script Include (SSI) - wups - 06.11.2011

Well lol..
pawn Код:
#if defined _SSIc_included
        #endinput
#endif
#define _SSI_included
SSIc is not the same as SSI, so your code on top is worthless.
Message to rcon:
pawn Код:
if(IsPlayerConnected(i) || IsPlayerAdmin(i))
This will send the message to ALL connected players, even if they aren't admins.
Change || to &&
You store chatlogs in a folder. But you don't warn people to create them. IF they don't - their server will crash.
Well, atleast the function GetName(released about 1000 times) is alright.


Re: Simple Script Include (SSI) - GAMER_PS2 - 06.11.2011

Thanks for tips guys and yeah your correct @wups i forget to delete the c on SSI
then i forget also to make it && dont worry next time i will make it cooler

Anyway the Thread is update link


Re: Simple Script Include (SSI) - Speed - 06.11.2011

Quote:
Originally Posted by GAMER_PS2
Посмотреть сообщение
Thanks for tips guys and yeah your correct @wups i forget to delete the c on SSI
then i forget also to make it && dont worry next time i will make it cooler

Anyway the Thread is update link
again

pawn Код:
stock MessageToRcon(color, const msg[])
{
   for (new i=0; i<MAX_PLAYERS; i++)
   {
      if(IsPlayerConnected(i) || IsPlayerAdmin(i))
      {
           SendClientMessage(i,color,msg);
      }
   }
   return 1;
}
Should be:
pawn Код:
stock MessageToRcon(color, const msg[])
{
   for (new i=0; i<MAX_PLAYERS; i++)
   {
      if(IsPlayerConnected(i) && IsPlayerAdmin(i))
      {
           SendClientMessage(i,color,msg);
      }
   }
   return 1;
}
pawn Код:
||
that means "or"

pawn Код:
&&
that means "and"

learn some basic....

anyway is good


Re: Simple Script Include (SSI) - System64 - 06.11.2011

not bad, easy but good
Quote:

GetName(playerid) //Theres no special here this is for ChatLog Function - Credits to System64

I didn't made that function, I think that made ******


Re: Simple Script Include (SSI) - GAMER_PS2 - 06.11.2011

@Speed dude i told you its updated, read first before posting.


Re: Simple Script Include (SSI) - Danice Ton - 06.11.2011

Nice


Re: Simple Script Include (SSI) - GAMER_PS2 - 06.11.2011

@Danice Ton Thanks