[Include] Simple Script Include (SSI)
#1

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
Reply
#2

Recommending to use foreach, pointless include anyway.
Reply
#3

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)
Reply
#4

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.
Reply
#5

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
Reply
#6

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
Reply
#7

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 ******
Reply
#8

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

Nice
Reply
#10

@Danice Ton Thanks
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)