Pascal
Новичок
PHP:
CMD:coin(playerid, params[])
{
if(Player[playerid][pMoney] == 0) return SendClientMessage(playerid,0xFFFFFFAA,"{FF0000} У вас нет монетки!");
static const coin_str0[] = " подбросил монетку, выпал",
coin_str1[] = "а \"решка\".", coin_str2[] = " \"орёл\".";
new string[MAX_PLAYER_NAME+(sizeof(coin_str0)-1)+(sizeof(coin_str1)-1)+1];
new i = GetMaxPlayers(),
inter = GetPlayerInterior(playerid),
world = GetPlayerVirtualWorld(playerid),
Float:x, Float:y, Float:z;
GetPlayerName(playerid, string, sizeof(string));
strcat(string, coin_str0);
strcat(string, (random(2)) ? (coin_str1) : (coin_str2));
GetPlayerPos(playerid, x, y, z);
do{
if(IsPlayerConnected(--i) == 0
|| GetPlayerVirtualWorld(i) != world
|| GetPlayerInterior(i) != inter
|| IsPlayerInRangeOfPoint(i, 8.0, x, y, z) == 0) continue;
SendClientMessage(i, 0xC8A8E000, string);
}while(i);
switch(random(2))
{
case 0:
{
GivePlayerMoney(playerid, -1);
SendClientMessage(playerid,0xFFFFFFAA,"[Внимание] Вы потеряли монетку! (( - 1 $ ))");
SavePlayer(playerid);
}
case 1: return 1;
}
return 1;
}
Автор доработки: Pascal
