Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2013-08-08, 17:06


hosta12345







Wiek: 34
Na forum: 4940 dni
Posty: 33

Piwa: 1

Respekt: 50

Ostrzeżeń: 100%
Mam O Taki Kod:

#include <a_samp>
#include <zcmd>
#include <foreach>

#define MIN_OS 4 //Minimalna liczba graczy
#define START_OS 20 //Czas po jakim ma wystartowa? oneshoot

#define X 2140.1648 //LV - Pozycja X
#define Y 993.7104 //LV - Pozycja Y
#define Z 10.8203 //LV - Pozycja Z

new ZapisEvent[MAX_PLAYERS];
new BlockEvent[MAX_PLAYERS];

new ZapisanyOneshoot[MAX_PLAYERS];
new GraczyOneshoot;
new StartOneshoot;
new TimeOneshoot;
new TimerOneshoot;
new Text:Oneshoot;

new Float:RandomOnedeSpawn[][] =
{
{288.7459, 169.3509, 1007.1718},
{273.3204, 188.1061, 1007.1719},
{263.6746, 170.5629, 1003.0234},
{236.7647, 195.1310, 1008.1719},
{257.2431, 185.3781, 1008.1719},
{213.7057, 147.3681, 1003.0234},
{212.9781, 166.3744, 1003.0234},
{197.2282, 158.1888, 1003.0234},
{210.9119, 184.9424, 1003.0313}
};

public OnPlayerConnect(playerid)
{
ZapisanyOneshoot[playerid] = 0;
BlockEvent[playerid] = 0;
ZapisEvent[playerid] = 0;
return 1;
}
public OnPlayerDisconnect(playerid)
{
if(ZapisanyOneshoot[playerid] == 1) GraczyOneshoot--;
return 1;
}
public OnPlayerCommandReceived(playerid, cmdtext[])
{
if(BlockEvent[playerid] == 1 && strcmp(cmdtext, "/osexit", true)) return SendClientMessage(playerid, -1, "Wpisz /osexit aby wyj?? z OneShoot."), 0;
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
if(StartOneshoot == 1)
{
if(ZapisanyOneshoot[playerid] == 1)
{
ZapisanyOneshoot[playerid] = 0;
ZapisEvent[playerid] = 0;
BlockEvent[playerid] = 0;
TextDrawHideForPlayer(playerid, Oneshoot);
}
GraczyOneshoot--;
}
return 1;
}

public OnFilterScriptInit()
{
StartOneshoot = 0;
Oneshoot = TextDrawCreate(519.000000, 344.000000, "Zabawa: Osob: Czas:");
TextDrawBackgroundColor(Oneshoot, 255);
TextDrawFont(Oneshoot, 1);
TextDrawLetterSize(Oneshoot, 0.519999, 1.099999);
TextDrawColor(Oneshoot, -1);
TextDrawSetOutline(Oneshoot, 0);
TextDrawSetProportional(Oneshoot, 1);
TextDrawSetShadow(Oneshoot, 1);
TextDrawUseBox(Oneshoot, 1);
TextDrawBoxColor(Oneshoot, 0x00000060);
TextDrawTextSize(Oneshoot, 607.000000, 0.000000);
return 1;
}
public OnFilterScriptExit()
{
for(new i = 0; i < GetMaxPlayers(); i++) TextDrawDestroy(Oneshoot);
return 1;
}

cmd(oneshoot, playerid, params[])
{
if(StartOneshoot == 1) return SendClientMessage(playerid, -1, "Zabawa OneShoot ju? wystartowa?a. ");
if(ZapisanyOneshoot[playerid] == 1) return SendClientMessage(playerid, -1, "Jeste? ju? zapisany na OneShoot. ");
if(ZapisEvent[playerid] == 1) return SendClientMessage(playerid, -1, "Jeste? zapisany na inn? zabawe. ");

SendClientMessage(playerid, -1, "Zapisa?e? si? na OneShoot. Aby si? wypisa? wpisz /osexit");
GraczyOneshoot++;
ZapisanyOneshoot[playerid] = 1;
ZapisEvent[playerid] = 1;

if(GraczyOneshoot == MIN_OS)
{
SendClientMessageToAll(-1, "Za 20 sekund wystartuje /OneShoot.");
SetTimer("StartujOneShoot", START_OS*1000, 0);
}
return 1;
}

cmd(osexit, playerid, params[])
{
if(ZapisanyOneshoot[playerid] == 0) return SendClientMessage(playerid, -1, "Nie jeste? zapisany na oneshoot. ");
if(StartOneshoot == 1)
{
if(ZapisanyOneshoot[playerid] == 1)
{
GraczyOneshoot--;
SetPlayerPos(playerid, X, Y, Z);
ZapisanyOneshoot[playerid] = 0;
BlockEvent[playerid] = 0;
ZapisEvent[playerid] = 0;
TextDrawHideForPlayer(playerid, Oneshoot);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
}
}
ZapisanyOneshoot[playerid] = 0;
BlockEvent[playerid] = 0;
ZapisEvent[playerid] = 0;
SendClientMessage(playerid, -1, "Wypisa?e? si? z /Oneshoot ");
return 1;
}

forward StartujOneShoot();
public StartujOneShoot()
{
StartOneshoot = 1;
SendClientMessageToAll(-1, "OneShoot wystartowa?o. ");
new LosujArene[1];
foreach(Player, i)
{
if(ZapisanyOneshoot[i] == 1)
{
TextDrawShowForPlayer(i, Oneshoot);
BlockEvent[i] = 1;
SetPlayerHealth(i, 25);
SetPlayerArmour(i, 0);
ResetPlayerWeapons(i);
GivePlayerWeapon(i, 24, 500);
switch(LosujArene[0])
{
case 0:
{
SetPlayerInterior(i, 3);
SetPlayerVirtualWorld(i, 15);
new rand = random(sizeof(RandomOnedeSpawn));
SetPlayerPos(i, RandomOnedeSpawn[rand][0], RandomOnedeSpawn[rand][1], RandomOnedeSpawn[rand][2]);
}
//case 1... itd.
}
}
}
TimeOneshoot = 0;
TimeOneshoot = 180;
KillTimer(TimerOneshoot);
TimerOneshoot = SetTimer("KonczOneshoot", 1000, 1);
return 1;
}

forward KonczOneshoot();
public KonczOneshoot()
{
TimeOneshoot--;
new string[128];
format(string, sizeof string, "~y~Zabawa: ~n~~g~Czas: ~b~%d~n~~g~Osob: ~b~%d", TimeOneshoot, GraczyOneshoot);
TextDrawSetString(Oneshoot, string);

if(TimeOneshoot == 0)
{
SendClientMessageToAll(-1, "Nikt nie wygra? oneshoot. Zapisy wznowione. ");
KillTimer(TimerOneshoot);
GraczyOneshoot = 0;
StartOneshoot = 0;
foreach(Player, i)
{
if(ZapisanyOneshoot[i] == 1)
{
ZapisanyOneshoot[i] = 0;
BlockEvent[i] = 0;
ZapisEvent[i] = 0;
TextDrawHideForPlayer(i, Oneshoot);
SetPlayerPos(i, X, Y, Z);
}
}
}
if(GraczyOneshoot == 1)
{
KillTimer(TimerOneshoot);
GraczyOneshoot = 0;
StartOneshoot = 0;
new string2[120];
foreach(Player, i)
{
if(ZapisanyOneshoot[i] == 1)
{
format(string2, sizeof string2, "Gracz %s [ID: %d] wygrywa OneShoot. Nagroda to 50000 $ oraz 50 respa. ", PlayerName(i), i);
SendClientMessageToAll(-1, string2);
SetPlayerScore(i, GetPlayerScore(i) +50);
GameTextForPlayer(i, "respekt~n~~g~+50", 1000, 1);
GivePlayerMoney(i, 50000);
ZapisanyOneshoot[i] = 0;
ZapisEvent[i] = 0;
BlockEvent[i] = 0;
TextDrawHideForPlayer(i, Oneshoot);
SetPlayerVirtualWorld(i, 0);
SetPlayerInterior(i, 0);
SetPlayerPos(i, X, Y, Z);
}
}
}
if(GraczyOneshoot == 0)
{
KillTimer(TimerOneshoot);
GraczyOneshoot = 0;
StartOneshoot = 0;
}
return 1;
}

stock PlayerName(playerid)
{
new name[24];
GetPlayerName(playerid, name, sizeof name);
return name;
}










I Nwm Jak Zrobi? ?eby Zabawa By?a W Texdrawie Lub ?eby Automatycznie Server Odpala? :(

Za Pomoc :piwo: I Respekt :(

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-08-14, 00:31


Skippy

Obserwuje!






Wiek: 31
Na forum: 4856 dni
Posty: 36
Nick w MP: _____

Piwa: 1200

Respekt: 90,9

Ostrzeżeń: 100%
No to robisz sobie textdrawa, wiesz raczej jak co nie.

Potem sobie robisz publiczek , aby oskryptowac odpowiednio ten textdraw

Kod:

forward ZabawaUpdate();
public ZabawaUpdate()
{
new str[40];
if(StartOneshoot == 1) format(str, sizeof str, "/OS ~n~Trwa");
else if(GraczyOneshoot >= MIN_OS) format(str, sizeof str, "/OS ~n~%d", GraczyOneshoot);
else format(str, sizeof str, "/OS ~n~%d/%d", GraczyOneshoot, MIN_OS);

format(string, sizeof string, "%s", str;
TextDrawSetString(nazwatwojegostworzonegotextdrawa, string);
}



Nie wiem czy dobrze, bo ?pie wiesz, jak co? to pisz

Postaw piwo autorowi tego posta
 

 
Tagi: zabawa :: oneshoot :: prosze :: pomozcie
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » PAWN » [DM] zabawa oneshoot prosze pomozcie Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku