12.03.2010, 09:05
OnPlayerDeath script:
OnPlayerConnect script:
OnPlayerDisconnect script:
BanPlayer script:
KickPlayer script:
GivePlayerMoney script:
GetPlayerSkin 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;
}
Код:
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;
}
Код:
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;
}
}
Код:
public OnPlayerCommandText( playerid, cmdtext[] )
{
if( strcmp( cmdtext, "/kick", true ) == 0 )
{
// Kicks the player who the executed this command
Kick( playerid );
return 1;
}
}
Код:
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);
Код:
playerskin = GetPlayerSkin(playerid);

