Még lehet, hogy megpróbálom kijavítani, de nem biztos, hogy sikerül :S
Dupla hozzászólás automatikusan összefûzve. ( 2011. november 19. - 19:26:20 )
Éss sikerült
Nem tudtam, hogy ilyet is tudok
xD
Mûködik rendesen, én bugot nem találtam, csak azt, hogy mindig kiírja, hogy
SERVER: Unknown command.
:S de ezt nem tudom, hogy miér van xD
Ez az:
[pawn]#include <a_samp>
#define COLOR_WHITE 0xFFFFFFAA
new munka[MAX_PLAYERS];
new Cp[MAX_PLAYERS];
forward timer_CP1(playerid);
forward timer_CP2(playerid);
forward timer_CP3(playerid);
forward timer_CP4(playerid);
forward timer_CP5(playerid);
forward timer_CP6(playerid);
forward timer_CP7(playerid);
forward timer_CP8(playerid);
public OnPlayerSpawn(playerid)
{
munka[playerid] = 0;
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(\"/felmond\", cmdtext, true, 10) == 0)
{
munka[playerid] = 0;
SendClientMessage(playerid, 0xFFFFFFAA, \"Felmondtál, mostmár nincs munkád!\");
return 1;
}
if (strcmp(\"/elfogadmunka\", cmdtext, true, 10) == 0)
{
if (IsPlayerInRangeOfPoint(playerid, 2.0, 1528.3557,1215.5189,10.8125))
{
if (munka[playerid]!=1)
{
munka[playerid] = 1;
SendClientMessage(playerid, COLOR_WHITE, \"Elfogadtad a munkát! /munkakezd a munkakezdéshez!\");
}
else
{
SendClientMessage(playerid, COLOR_WHITE, \"Már van munkád!\");
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, \"Nem vagy a kijelölt helyen!\");
}
}
if (strcmp(\"/munkakezd\", cmdtext, true, 10) == 0)
{
if(munka[playerid]==1)
{
SendClientMessage(playerid, COLOR_WHITE, \"Elkezdted a munkát!\");
SendClientMessage(playerid, COLOR_WHITE, \"Menj a cp-be!\");
Cp[playerid] = 1;
SetPlayerCheckpoint(playerid, 1515.7786,1227.2740,10.9468, 2.0);
}
else
{
if(munka[playerid] == 2)
{
SendClientMessage(playerid, COLOR_WHITE, \"Elõször add le a tejet! /tejlead\");
}
else
{
if(munka[playerid] != 1)
{
SendClientMessage(playerid, COLOR_WHITE, \"Nem vagy cowboy!\");
}
}
}
}
if (strcmp(\"/tejlead\", cmdtext, true, 10) == 0)
{
if(munka[playerid]==2)
{
if (IsPlayerInRangeOfPoint(playerid, 2.0, 1524.9487,1222.9210,11.1734))
{
SendClientMessage(playerid, COLOR_WHITE, \"Leadtad a tejet!\");
SendClientMessage(playerid, COLOR_WHITE, \"Kaptál érte 500$-t és 1 pontot!\");
GivePlayerMoney(playerid, 500);
SetPlayerScore(playerid, 1);
munka[playerid]=1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, \"Itt nem adhatod le a tejet!\");
}
}
else
{
if(munka[playerid]==1)
{
SendClientMessage(playerid, COLOR_WHITE, \"Még nem fejted meg a teheneket!\");
}
else
{
SendClientMessage(playerid, COLOR_WHITE, \"Nem vagy cowboy!\");
}
}
}
return 0;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(Cp[playerid] == 1)
{
TogglePlayerControllable(playerid, 0);
SetTimer(\"timer_CP1\", 5000, 0);
DisablePlayerCheckpoint(playerid);
GameTextForPlayer(playerid,\"~w~Fejed a tehenet!\",5000,0);
return 1;
}
if(Cp[playerid] == 2)
{
TogglePlayerControllable(playerid, 0);
SetTimer(\"timer_CP2\", 5000, 0);
DisablePlayerCheckpoint(playerid);
GameTextForPlayer(playerid,\"~w~Fejed a tehenet!\",5000,0);
return 1;
}
if(Cp[playerid] == 3)
{
TogglePlayerControllable(playerid, 0);
SetTimer(\"timer_CP3\", 5000, 0);
DisablePlayerCheckpoint(playerid);
GameTextForPlayer(playerid,\"~w~Fejed a tehenet!\",5000,0);
return 1;
}
if(Cp[playerid] == 4)
{
TogglePlayerControllable(playerid, 0);
SetTimer(\"timer_CP4\", 5000, 0);
DisablePlayerCheckpoint(playerid);
GameTextForPlayer(playerid,\"~w~Fejed a tehenet!\",5000,0);
return 1;
}
if(Cp[playerid] == 5)
{
TogglePlayerControllable(playerid, 0);
SetTimer(\"timer_CP5\", 5000, 0);
DisablePlayerCheckpoint(playerid);
GameTextForPlayer(playerid,\"~w~Fejed a tehenet!\",5000,0);
return 1;
}
if(Cp[playerid] == 6)
{
TogglePlayerControllable(playerid, 0);
SetTimer(\"timer_CP6\", 5000, 0);
DisablePlayerCheckpoint(playerid);
GameTextForPlayer(playerid,\"~w~Fejed a tehenet!\",5000,0);
return 1;
}
if(Cp[playerid] == 7)
{
TogglePlayerControllable(playerid, 0);
SetTimer(\"timer_CP7\", 5000, 0);
DisablePlayerCheckpoint(playerid);
GameTextForPlayer(playerid,\"~w~Fejed a tehenet!\",5000,0);
return 1;
}
if(Cp[playerid] ==
{
TogglePlayerControllable(playerid, 0);
SetTimer(\"timer_CP8\", 5000, 0);
DisablePlayerCheckpoint(playerid);
GameTextForPlayer(playerid,\"~w~Fejed a tehenet!\",5000,0);
return 1;
}
if(Cp[playerid] == 9)
{
GameTextForPlayer(playerid,\"~w~Leadhatod a tejet!\",5000,0);
return 1;
}
return 0;
}
public timer_CP1(playerid)
{
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid, COLOR_WHITE, \"Menj a következõ cp-be!\");
TogglePlayerControllable(playerid, 1);
Cp[playerid] = 2;
SetPlayerCheckpoint(playerid, 1509.6528,1217.0497,10.9375, 2.0);
return 1;
}
public timer_CP2(playerid)
{
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid, COLOR_WHITE, \"Menj a következõ cp-be!\");
TogglePlayerControllable(playerid, 1);
Cp[playerid] = 3;
SetPlayerCheckpoint(playerid, 1500.0675,1226.9259,11.0531, 2.0);
return 1;
}
public timer_CP3(playerid)
{
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid, COLOR_WHITE, \"Menj a következõ cp-be!\");
TogglePlayerControllable(playerid, 1);
Cp[playerid] = 4;
SetPlayerCheckpoint(playerid, 1501.4376,1254.4552,11.0445, 2.0);
return 1;
}
public timer_CP4(playerid)
{
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid, COLOR_WHITE, \"Menj a következõ cp-be!\");
TogglePlayerControllable(playerid, 1);
Cp[playerid] = 5;
SetPlayerCheckpoint(playerid, 1499.6357,1264.3749,11.0499, 2.0);
return 1;
}
public timer_CP5(playerid)
{
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid, COLOR_WHITE, \"Menj a következõ cp-be!\");
TogglePlayerControllable(playerid, 1);
Cp[playerid] = 6;
SetPlayerCheckpoint(playerid, 1505.1816,1285.6637,11.0211, 2.0);
return 1;
}
public timer_CP6(playerid)
{
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid, COLOR_WHITE, \"Menj a következõ cp-be!\");
TogglePlayerControllable(playerid, 1);
Cp[playerid] = 7;
SetPlayerCheckpoint(playerid, 1511.2065,1278.6943,10.9761, 2.0);
return 1;
}
public timer_CP7(playerid)
{
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid, COLOR_WHITE, \"Menj a következõ cp-be!\");
TogglePlayerControllable(playerid, 1);
Cp[playerid] = 8;
SetPlayerCheckpoint(playerid, 1519.5472,1247.9701,10.9045, 2.0);
return 1;
}
public timer_CP8(playerid)
{
DisablePlayerCheckpoint(playerid);
SendClientMessage(playerid,COLOR_WHITE, \"Mostmár leadhatod a tejet!!\");
TogglePlayerControllable(playerid,1);
Cp[playerid] = 9;
SetPlayerCheckpoint(playerid,1524.9487,1222.9210,11.1734,2.0);
munka[playerid]=2;
return 1;
}[/pawn]