17.07.2011, 02:50
You can use my include.
Example:
Example:
pawn Code:
#include <IRC>
#include <a_samp>
new RandomList:PlayersRandomList;
public OnPlayerConnect(playerid)
{
AddItemsToRandomList(PlayersRandomList, playerid);
return 1;
}
public OnPlayerDisconnect(playerid)
{
RemoveItemsFromRandomList(PlayersRandomList, playerid);
return 1;
}
public OnPlayerSpawn(playerid)
{
new msg[128], randomhitforplayer = RandomNumberFromList(PlayersRandomList);
if(randomlistforplayer != INVALID_RANDOM_NUMBER)
{
GetPlayerName(randomhitforplayer, msg, MAX_PLAYER_NAME);
format(msg, sizeof msg, "You have a new hit! Kill {FF4040}%s{FFFFFF}!", msg);
SendClientMessage(playerid, -1, msg);
Hit[playerid] = randomhitforplayer;
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(IsPlayerConnected(killerid))
{
if(Hit[killerid] == playerid)
{
new msg[128], randomhitforplayer = RandomNumberFromList(PlayersRandomList);
Hit[killerid] = randomhitforplayer;
GetPlayerName(playerid, msg, MAX_PLAYER_NAME);
format(msg, sizeof msg, "You killed %s and earned 500$", msg);
SendClientMessage(killerid, -1, msg);
format(msg, sizeof msg, "You have a new hit to do! Kill {FF4040}%s{FFFFFF}!", msg);
SendClientMessage(killerid, -1, msg);
}
}
}