19.07.2011, 07:28
i tried to make a speed m4 activity...
but it doesn't work because of few things:
1. you can type only /speed m4 and it starts the activity but it suppose to be /speed m4 start
2. both countdown doesn't start so there is no unfreeze or beggining for the activity...
i think that's it... if i'll have more problems i will tell you later...
pastabin:
http://pastebin.com/H2UPw3kb
code:
but it doesn't work because of few things:
1. you can type only /speed m4 and it starts the activity but it suppose to be /speed m4 start
2. both countdown doesn't start so there is no unfreeze or beggining for the activity...
i think that's it... if i'll have more problems i will tell you later...
pastabin:
http://pastebin.com/H2UPw3kb
code:
pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#include <dini>
#define COLOUR_BLUE 0x3A47DEFF
#define COLOUR_BLACK 0x00000000
#define COLOUR_GREEN 0x33AA33AA
#define COLOUR_WHITE 0xFFFFFFAA
#define COLOUR_ORANGE 0xFF9900AA
#define COLOUR_YELLOW 0xFFFF00AA
#define COLOUR_SYSTEM 0xEFEFF7AA
#define COLOUR_RED 0xFF0000AA
forward M4cd1(playerid);
forward M4cd2();
forward SpeedM4Spawn(playerid);
new ActivityOn;
new SpeedM4On;
new inSpeedM4[MAX_PLAYERS];
new Count = 60;
new Count2 = 3;
new M4CountTimer1;
new M4CountTimer2;
new AutoPrize;
new Prize;
new SpeedM4Players;
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(SpeedM4On == 1)
{
SpeedM4Players--;
if(SpeedM4Players == 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(inSpeedM4[i] == 1)
{
if(AutoPrize == 1)
{
GivePlayerMoney(i, 100000);
new string[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(i, name, sizeof(name));
format(string, sizeof(string), "рйцз бфтймеъ: жшйжеъ ан4 %s дщзчп", name);
SendClientMessageToAll(COLOUR_YELLOW, string);
SendClientMessageToAll(COLOUR_YELLOW, "100,000 деа жлд бфшс щм");
}
else
{
GivePlayerMoney(i, Prize);
new string[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(i, name, sizeof(name));
format(string, sizeof(string), "рйцз бфтймеъ: жшйжеъ ан4 %s дщзчп", name);
SendClientMessageToAll(COLOUR_YELLOW, string);
format(string, sizeof(string), "%d деа жлд бфшс щм", Prize);
SendClientMessageToAll(COLOUR_YELLOW, string);
}
}
}
}
}
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256], idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/speed", true) == 0)
{
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOUR_ORANGE, "/speed [M4 | тег бдощк]");
return 1;
}
if(!strcmp(tmp, "M4", true))
{
tmp = strtok(cmdtext, idx);
if(!strcmp(tmp, "Start", true) || !strcmp(tmp, "Start", true))
{
if(IsPlayerAdmin(playerid))
{
new tmp2[256];
tmp2 = strtok(cmdtext, idx);
if(ActivityOn == 0)
{
ActivityOn = 1;
SpeedM4On = 1;
M4CountTimer1 = SetTimer("M4cd1", 1000, false);
if(!strlen(tmp2))
{
SendClientMessageToAll(COLOUR_YELLOW, "/Speed M4 J дфтймеъ: жшйжеъ ан4 дефтмд. дщъоще бфчегд");
SendClientMessageToAll(COLOUR_YELLOW, "дфшс теог тм 100 аму");
AutoPrize = 1;
return 1;
}
Prize = strval(tmp2);
SendClientMessageToAll(COLOUR_YELLOW, "/Speed M4 J дфтймеъ: жшйжеъ ан4 дефтмд. дщъоще бфчегд");
new str[128];
format(str, sizeof(str), "лсу %d дфшс теог тм", Prize);
SendClientMessageToAll(COLOUR_YELLOW, str);
}
else
{
SendClientMessage(playerid, COLOUR_RED, "йщрд фтймеъ фъезд. ара злд щъсъййн мфрй щъъзйм азъ згщд");
}
}
else return SendClientMessage(playerid, COLOUR_RED, "аъд зййб мдйеъ агойп бщбйм мдщъощ бфчегд же");
return 1;
}
if(!strcmp(tmp, "Join", true) || !strcmp(tmp, "J", true))
{
if(SpeedM4On == 0) return SendClientMessage(playerid, COLOUR_RED, "дфтймеъ: жшйжеъ ан4 свешд");
if(inSpeedM4[playerid]) return SendClientMessage(playerid, COLOUR_RED, "аъд лбш ощъъу бфтймеъ");
SpeedM4Spawn(playerid);
GivePlayerWeapon(playerid, 31, 9999);
TogglePlayerControllable(playerid, 0);
SetPlayerHealth(playerid, 1);
SetPlayerArmour(playerid, 0);
inSpeedM4[playerid] = 1;
SpeedM4Players++;
return 1;
}
}
return SendClientMessage(playerid, COLOUR_RED, "айп фчегд лже");
}
return 0;
}
public M4cd1(playerid)
{
Count--;
new str[128];
if(Count == 0)
{
if(SpeedM4Players > 3)
{
SendClientMessageToAll(COLOUR_RED, "дфтймеъ беимд тчб зесш бощъъфйн");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(inSpeedM4[i] == 1)
{
SetPlayerPos(playerid, 0.00, 0.00, 0.00);
}
}
}
else
{
KillTimer(M4CountTimer1);
Count = 60;
M4CountTimer2 = SetTimer("M4cd2", 1000, false);
SpeedM4On = 0;
}
}
format(str, sizeof(str), "~r~M4 ~b~Speed Fight~g~start in~n~%d", M4CountTimer1);
GameTextForAll(str, 1000, 0);
return 1;
}
public M4cd2()
{
Count2--;
new str[128];
if(Count2 == 0)
{
KillTimer(M4CountTimer2);
Count2 = 4;
SendClientMessageToAll(COLOUR_YELLOW, "дфтймеъ: жшйжеъ ан4 дъзймд");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(inSpeedM4[i] == 1)
{
TogglePlayerControllable(i, 1);
}
}
}
format(str, sizeof(str), "%d", M4CountTimer2);
GameTextForAll(str, 1000, 0);
return 1;
}
public SpeedM4Spawn(playerid)
{
SetPlayerPos(playerid, 2249.1619,1082.9736,33.5234);
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}