SA-MP Forums Archive
Scripts for your server - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Scripts for your server (/showthread.php?tid=133392)



Scripts for your server - [TW]randomguy - 12.03.2010

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);



Re: Scripts for your server - GaGlets(R) - 12.03.2010

Boooo.. Only connect/disconnect are good..


Re: Scripts for your server - [TW]randomguy - 12.03.2010

I only just started scripting...


Re: Scripts for your server - adsy - 12.03.2010

most of them are complete copies of the wiki


Re: Scripts for your server - Lajko1 - 13.03.2010

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


Re: Scripts for your server - Jakku - 13.03.2010

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