Scripts for your server
#1

OnPlayerDeath script:

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
  SendDeathMessage(killerid, playerid, reason);
  return 1;
}

OnPlayerConnect script:

Код:
public OnPlayerConnect(playerid)
{
  new string[64], pName[MAX_PLAYER_NAME];
  GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  format(string,sizeof string,"%s has joined the server. Welcome!",pName);
  SendClientMessageToAll(0xFFFFFFAA,string);
  return 1;
}
OnPlayerDisconnect script:

Код:
public OnPlayerDisconnect(playerid, reason)
{
  new
    string[64],
    name[MAX_PLAYER_NAME];
  GetPlayerName(playerid,name,MAX_PLAYER_NAME);
  switch(reason)
  {
    case 0: format(string,sizeof string,"%s left the server. (Timed out)",name);
    case 1: format(string,sizeof string,"%s left the server. (Leaving)",name);
    case 2: format(string,sizeof string,"%s left the server. (Kicked/Banned)",name);
  }
  SendClientMessageToAll(0xFFFFFFAA,string);
  return 1;
}
BanPlayer script:

Код:
public OnPlayerCommandText( playerid, cmdtext[] )
{
  if( strcmp( cmdtext, "/ban", true ) == 0 )
  {
    // Bans the player who executed this command and includes a reason ("Request")
    BanEx( playerid, "Request" );
    return 1;
  }
}
KickPlayer script:

Код:
public OnPlayerCommandText( playerid, cmdtext[] )
{
  if( strcmp( cmdtext, "/kick", true ) == 0 )
  {
    // Kicks the player who the executed this command
    Kick( playerid );
    return 1;
  }
}
GivePlayerMoney script:

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
  new string[32];
 
  //Award $10,000 to the killer
  GivePlayerMoney(killerid, 10000);
 
  format(string, sizeof(string), "You now have %d.", GetPlayerMoney(killerid));
  SendClientMessage(killerid, 0xFFFFFFAA, string);
GetPlayerSkin script:

Код:
playerskin = GetPlayerSkin(playerid);
Reply
#2

Boooo.. Only connect/disconnect are good..
Reply
#3

I only just started scripting...
Reply
#4

most of them are complete copies of the wiki
Reply
#5

guys look in good way,if he just start scripting he made a good job, its helpful for starters, mybe commands for ban and kick are not good becouse you kick your self but he show in what way you can do commands etc etc... not bad, good for start
Reply
#6

Quote:
Originally Posted by adsy
most of them are complete copies of the wiki
Indeed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)