Hi..
van nekem egy OnPlayerCommandText-em elég hosszu(nekem legalábbis) de valami nem jön össze...
Hibát nem ir a mód de a szerveren nem használhatóak a parancsok
Server Unknown Command..
Valaki mondja meg hogy mi a baja, elõre kössz..
public RestartServer( ) {
--serverCount;
if( !serverCount ) {
inProgress = false;
SendRconCommand( \"gmx\" );
KillTimer( restartTimer );
return;
}
static formatString[ 3 ];
format( formatString, 3, \"%d\", serverCount );
GameTextForAll( formatString, 1000, 6 );
}
public OnPlayerCommandText(playerid, cmdtext[]) {
new tmp[512];
new idx;
new string[512];
if( !strcmp( \"/restart\", cmdtext, true ) ) {
if(PlayerInfo[playerid][Admin] >= 5) {
SendClientMessage( playerid, COLOR_RED, \"Nem használhatod ezt a parancsot!\" );
} else if( inProgress ) {
SendClientMessage( playerid, COLOR_RED, \"Már folyamatban van egy visszaszámlálás!\" );
} else {
GetPlayerName(playerid, nev12, sizeof(nev12));
inProgress = true;
serverCount = 30;
restartTimer = SetTimer( \"RestartServer\", 1000, true );
SendClientMessage( playerid, COLOR_GREEN, \"Visszaszámlálás elindítva!\" );
SendFormatMessageToAll(COLOR_ORANGE, \"****** A szerver ujraindul %s által 30 másodpercen belül!******\", nev12);
}
return 1;
}
else if( !strcmp( \"/help\", cmdtext, true ) ) {
SendClientMessage(playerid, COLOR_ORANGE, \"Ha megszeretnéd nézni az újításokat akkor pötyögd be /updates\");
SendClientMessage(playerid, COLOR_ORANGE, \"Ha afk-zni szeretnél pötyögd be /afk\");
SendClientMessage(playerid, COLOR_ORANGE, \"Ha enni szeretnél pötyögd be, /fánk\");
SendClientMessage(playerid, COLOR_ORANGE, \"Rendörségnél: /nyit /zár\");
SendClientMessage(playerid, COLOR_ORANGE, \"Tuningkocsiknál: /nyit, /zár, /beáll, /kiáll\");
SendClientMessage(playerid, COLOR_ORANGE, \"Teleportok megtekintése: /teles\");
return 1;
}
else if( !strcmp( \"/updates\", cmdtext, true ) ) {
SendClientMessage(playerid, COLOR_RED, \"\\\\-------Updates--------//\");
SendClientMessage(playerid, COLOR_YELLOW, \"Rendörséghez kapu betéve, parancs /nyit, /zar\");
SendClientMessage(playerid, COLOR_YELLOW, \"Új parancs: /teles\");
SendClientMessage(playerid, COLOR_YELLOW, \"Új sebességmérõ bevezetve!\");
SendClientMessage(playerid, COLOR_YELLOW, \"3 új teleport, megtekintéshez /teles\");
SendClientMessage(playerid, COLOR_YELLOW, \"Új km/h, Adminisland\");
SendClientMessage(playerid, COLOR_YELLOW, \"Vadonatúj adminrendszer\");
SendClientMessage(playerid, COLOR_YELLOW, \"Vadonatúj jármûlehívó rendszer, /veh\");
return 1;
}
else if( !strcmp( \"/afk\", cmdtext, true ) ) {
GetPlayerName(playerid, nev3, sizeof(nev3));
SendFormatMessageToAll(COLOR_YELLOW, \"%s Nincs a gépnél! [/afk]\", nev3);
SendClientMessage(playerid,0x99FF00AA,\"Ha visszajöttél /afk-off\");
GameTextForPlayer(playerid,\"~b~ AFK-ba vagy\", 5000, 3);
TogglePlayerControllable(playerid, 0);
SetPlayerColor(playerid, COLOR_RED);
return 1;
}
else if( !strcmp( \"/afk-off\", cmdtext, true ) ) {
GetPlayerName(playerid, nev4, sizeof(nev4));
GameTextForPlayer(playerid,\"~r~ AFK kikapcsolva\", 5000, 3);
SendFormatMessageToAll(COLOR_YELLOW, \"%s Visszatért az afkból! [/afk-off]\", nev4);
TogglePlayerControllable(playerid, 1);
SetPlayerColor(playerid, COLOR_YELLOW);
return 1;
}
else if( !strcmp( \"/fánk\", cmdtext, true ) ) {
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
SendClientMessage(playerid, COLOR_YELLOW, \"Hmm.. Jóllaktál, nézdcsak feltöltõdött az életed, és kaptál golyóállómellényt\");
return 1;
}
else if( !strcmp( \"/enter\", cmdtext, true ) ) {
if (IsPlayerInRangeOfPoint(playerid, 3.0, -2915.5198, 385.3093, 5.5489))
{
SetPlayerPos(playerid, 246.375991,109.245994,1003.218750);
SetPlayerInterior(playerid, 10);
SetPlayerVirtualWorld(playerid, 1);
}
else if (IsPlayerInRangeOfPoint(playerid, 3.0, -2192.6521, 647.4215, 49.4375))
{
SetPlayerPos(playerid, -2171.3066, 645.4599, 1057.5938);
SetPlayerInterior(playerid, 1);
SetPlayerVirtualWorld(playerid, 1);
}
else if (IsPlayerInRangeOfPoint(playerid, 3.0, -2170.3401, 635.7511, 1052.3750))
{
SetPlayerPos(playerid, 763.0883, -49.9427, 1000.5859);
SetPlayerInterior(playerid, 6);
}
else
{
SendClientMessage(playerid, COLOR_ORANGE, \"Nem vagy egy ajtó közelében sem\");
}
return 1;
}
else if( !strcmp( \"/exit\", cmdtext, true ) ) {
if (IsPlayerInRangeOfPoint(playerid, 3.0, 246.375991,109.245994,1003.218750))
{
SetPlayerPos(playerid, -2915.5198, 385.3093, 5.5489);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
}
else if (IsPlayerInRangeOfPoint(playerid, 3.0, -2171.3066, 645.4599, 1057.5938))
{
SetPlayerPos(playerid, -2192.6521, 647.4215, 49.4375);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
}
else if (IsPlayerInRangeOfPoint(playerid, 3.0, 763.0883, -49.9427, 1000.5859))
{
SetPlayerPos(playerid, -2170.3401, 635.7511, 1052.3750);
SetPlayerInterior(playerid, 1);
}
else
{
SendClientMessage(playerid, COLOR_ORANGE, \"Nem vagy egy ajtó közelében sem\");
}
return 1;
}
else if( !strcmp( \"/nyit\", cmdtext, true ) ) {
if (IsPlayerInRangeOfPoint(playerid, 12.0, -2242.19921875, 639.53125, 48.360000610352))
{
MoveObject(yak_kapu1, -2242.19921875, 639.53125, 45.360000610352, 2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, \"Kapu nyitódik\");
}
else if (IsPlayerInRangeOfPoint(playerid, 12.0, -2211.4797363281, 578.55059814453, 36.925994873047))
{
MoveObject(yak_kapu2, -2211.4797363281, 578.55059814453, 31.479999542236, 2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, \"Kapu nyitódik\");
}
else if(IsPlayerInRangeOfPoint(playerid, 12.0, -2860.6442871094, 467.68786621094, 6.1561040878296))
{
MoveObject(rendorsegkapu, -2860.6442871094, 467.68786621094, 0.1561040878296, 2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, \"Kapu nyitódik\");
}
else if(IsPlayerInRangeOfPoint(playerid, 12.0, -3284.7671,1296.2633,13.3817))
if(PlayerInfo[playerid][Admin] >= 1)
{
MoveObject(kapu, -3290.322998, 1296.884888, -27.543024, 3);
SendClientMessage(playerid, COLOR_LIGHTBLUE, \"Kapu nyitódik\");
}
else
{
SendClientMessage(playerid, COLOR_RED, \"Nem használhatod ezt a parancsot\");
}
return 1;
}
else if( !strcmp( \"/zár\", cmdtext, true ) ) {
if (IsPlayerInRangeOfPoint(playerid, 12.0, -2242.19921875, 639.53125, 48.360000610352))
{
MoveObject(yak_kapu1, -2242.19921875, 639.53125, 48.360000610352, 2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, \"Kapu záródik\");
}
else if (IsPlayerInRangeOfPoint(playerid, 12.0, -2211.4797363281, 578.55059814453, 36.925994873047))
{
MoveObject(yak_kapu2, -2211.4797363281, 578.55059814453, 36.925994873047, 2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, \"Kapu záródik\");
}
else if (IsPlayerInRangeOfPoint(playerid, 12.0, -2860.6442871094, 467.68786621094, 0.1561040878296))
{
MoveObject(rendorsegkapu, -2860.6442871094, 467.68786621094, 6.1561040878296, 2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, \"Kapu záródik\");
}
else if (IsPlayerInRangeOfPoint(playerid, 12.0, -3284.7671, 1296.2633, 13.3817))
{
MoveObject(kapu, -3284.7671, 1296.2633, 5.3817, 3);
SendClientMessage(playerid, COLOR_LIGHTBLUE, \"Kapu záródik\");
}
else
{
SendClientMessage(playerid, COLOR_RED, \"Nem vagy egy kapu közelében sem!\");
}
return 1;
}
else if( !strcmp( \"/beáll\", cmdtext, true ) ) {
if (IsPlayerInRangeOfPoint(playerid, 8.0, -2177.0896, 657.2063, 49.0871))
{
if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid), -2177.0825, 665.1991, 50.1780);
}
}
else
{
SendClientMessage(playerid, COLOR_RED, \"Nem vagy a yakuza kapu közelében!\");
}
return 1;
}
else if( !strcmp( \"/kiáll\", cmdtext, true ) ) {
if (IsPlayerInRangeOfPoint(playerid, 8.0, -2177.0825, 665.1991, 50.1780))
{
if (IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(GetPlayerVehicleID(playerid), -2177.0896, 657.2063, 49.0871);
}
}
else
{
SendClientMessage(playerid, COLOR_RED, \"Nem vagy a yakuza kapu közelében!\");
}
return 1;
}
else if( !strcmp( \"/fel\", cmdtext, true ) ) {
if(IsPlayerInRangeOfPoint(playerid, 15.0, -3297.155273, 1278.163818, 13.845752))
{
MoveObject(lift, -3297.080322, 1278.281128, 47.647739, 3);
SendClientMessage(playerid, COLOR_RED, \"A lift elindult felfele!\");
}
else
{
SendClientMessage(playerid, COLOR_RED, \"Nem vagy a lift közelében!\");
}
return 1;
}
else if( !strcmp( \"/le\", cmdtext, true ) ) {
if(IsPlayerInRangeOfPoint(playerid, 15.0, -3297.080322, 1278.281128, 47.647739))
{
MoveObject(lift, -3297.155273, 1278.163818, 13.845752, 3);
SendClientMessage(playerid, COLOR_RED, \"A lift elindult lefele!\");
}
else
{
SendClientMessage(playerid, COLOR_RED, \"Nem vagy a lift közelében!\");
}
return 1;
}
else if( !strcmp( \"/teles\", cmdtext, true) ) {
ShowPlayerDialog(playerid, DIALOG_TELE, DIALOG_STYLE_LIST, \"Teleportmenü\", \"Repterek\\nStuntok\\nDmZónák\\nEgyéb\", \"Kiválasztás\", \"Mégse\");
return 1;
}
else if ( !strcmp( \"/veh\", cmdtext, true) ) {
if(PlayerInfo[playerid][Admin] >= 2)
ShowPlayerDialog(playerid, DIALOG_VEH, DIALOG_STYLE_LIST, \"Jármûlehívómenü\", \"Kocsik\\nMotorok\\nRepülõk\\nBiciklik\\nRC Jármûvek\\nEgyéb Jármûvek\", \"Kiválasztás\", \"Mégse\");
else
{
SendClientMessage(playerid, COLOR_RED, \"Nem vagy admin\");
}
return 1;
}
else if ( !strcmp( \"/kill\", cmdtext, true ) ) {
SetPlayerHealth(playerid, 0);
return 1;
}
else if (!strcmp( \"/exitdm\", cmdtext, true ) ) {
if(DM[playerid] == false) return SendClientMessage(playerid,0xFFFF00AA,\"Nem vagy DM zónában!\");
DM[playerid] = false;
SendClientMessage(playerid, 0xFFFF00AA,\"Sikeresen kiléptél a DM zónából!\");
ResetPlayerWeapons(playerid);
SetPlayerPos(playerid, -2910.1963, 463.6516, 4.9519);
return 1;
}
/*#############################################################################
################################ADMINSYSTEM####################################
#############################################################################*/
else if( !strcmp(cmdtext, \"/rac\", true) )
{
if(PlayerInfo[playerid][Admin] >= 4){
GetPlayerName(playerid, nev10, sizeof(nev10));
SendClientMessage(playerid, 0xFFFFFFAA, \"Jármûvek újraspawnolva!\");
SendFormatMessageToAll(COLOR_ORANGE, \"%s respawnolta az összes használaton kívüli jármûvet!\", nev10);
for(new cars=0; cars<MAX_VEHICLES; cars++)
{
if(!VehicleOccupied(cars))
{
SetVehicleToRespawn(cars);
}
}
return 1;
}
}
else if( !strcmp(cmdtext, \"/kick\", true) ) {
if(PlayerInfo[playerid][Admin] >= 2){
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, \"HASZNÁLAT: /kick [iD] [indok]\");
return 1;
}
giveplayerid = strval(tmp);
GetPlayerName(playerid, sendername, sizeof(sendername));
if (IsPlayerConnected(giveplayerid)) {
GetPlayerName(giveplayerid,giveplayer,sizeof(giveplayer));
format(string, sizeof(string), \"AdmCmd: %s ki lett rúgva a szerverrõl %s által.Indok: %s\",giveplayer,sendername,cmdtext[8]);
SendClientMessageToAll(COLOR_RED, string);
Kick(giveplayerid);
}else{
format(string, sizeof(string), \"%d nem aktív játékos.\", giveplayerid);
SendClientMessage(playerid, COLOR_RED, string);
}
} else { SendClientMessage(playerid,COLOR_WHITE,\"Nem vagy admin!\");
}
return 1;
}
else if( !strcmp(cmdtext, \"/ban\", true) ) {
if(PlayerInfo[playerid][Admin] >= 3){
SendClientMessage(playerid,COLOR_WHITE,\"Nem vagy admin!\"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, \"HASZNÁLAT: /ban [iD] [indok]\");
return 1;
}
giveplayerid = strval(tmp);
GetPlayerName(playerid, sendername, sizeof(sendername));
if (IsPlayerConnected(giveplayerid)) {
GetPlayerName(giveplayerid,giveplayer,sizeof(giveplayer));
format(string, sizeof(string), \"AdmCmd %s ki lett tiltva a szerverrõl %s által.Indok: %s\",giveplayer,sendername,cmdtext[7]);
SendClientMessageToAll(COLOR_RED, string);
Ban(giveplayerid);
}else{
format(string, sizeof(string), \"%d nem aktív játékos.\", giveplayerid);
SendClientMessage(playerid, COLOR_RED, string);
}
return 1;
}
else if( !strcmp(cmdtext, \"/goto\", true) )
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, \"Használat: /goto [playerid/PartOfName]\");
return 1;
}
new Float:plocx,Float:plocy,Float:plocz;
new plo;
plo = ReturnUser(tmp);
if (IsPlayerConnected(plo))
{
if(plo != INVALID_PLAYER_ID)
{
if (PlayerInfo[playerid][Admin] >= 1)
{
if(Spectate[playerid] != 255)
{
Spectate[playerid] = 256;
}
GetPlayerPos(plo, plocx, plocy, plocz);
if(PlayerInfo[plo][pInt] > 0)
{
SetPlayerInterior(playerid,PlayerInfo[plo][pInt]);
PlayerInfo[playerid][pInt] = PlayerInfo[plo][pInt];
PlayerInfo[playerid][pLocal] = PlayerInfo[plo][pLocal];
}
if(PlayerInfo[playerid][pInt] == 0)
{
SetPlayerInterior(playerid,0);
}
if(plocz > 530.0 && PlayerInfo[plo][pInt] == 0) //the highest land point in sa = 526.8
{
SetPlayerInterior(playerid,1);
PlayerInfo[playerid][pInt] = 1;
}
if (GetPlayerState(playerid) == 2)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
}
else
{
SetPlayerPos(playerid,plocx,plocy+2, plocz);
}
SendClientMessage(playerid, COLOR_GRAD1, \" Elteleportáltak\");
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, \" Nem vagy jogosult használni ezt a parancsot!\");
}
}
}
else
{
format(string, sizeof(string), \" %d nem aktív játékos.\", plo);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
//----------------------------------[GETHERE]-----------------------------------------------
else if( !strcmp(cmdtext, \"/gethere\", true) )
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, \"Használat: /gethere [playerid/PartOfName]\");
return 1;
}
new Float:plocx,Float:plocy,Float:plocz;
new plo;
plo = ReturnUser(tmp);
if (IsPlayerConnected(plo))
{
if(plo != INVALID_PLAYER_ID)
{
if (PlayerInfo[plo][Admin] > 5)
{
SendClientMessage(playerid, COLOR_GRAD1, \"Kérd meg az admint, hogy menjen hozzád.\");
return 1;
}
if (PlayerInfo[playerid][Admin] >= 5)
{
GetPlayerPos(playerid, plocx, plocy, plocz);
if(PlayerInfo[playerid][pInt] > 0)
{
SetPlayerInterior(plo,PlayerInfo[playerid][pInt]);
PlayerInfo[plo][pInt] = PlayerInfo[playerid][pInt];
PlayerInfo[plo][pLocal] = PlayerInfo[playerid][pLocal];
}
if(PlayerInfo[playerid][pInt] == 0)
{
SetPlayerInterior(plo,0);
}
if(plocz > 930.0 && PlayerInfo[playerid][pInt] == 0) //the highest land point in sa = 526.8
{
SetPlayerInterior(plo,1);
PlayerInfo[plo][pInt] = 1;
}
if (GetPlayerState(plo) == 2)
{
TelePos[plo][0] = 0.0;
TelePos[plo][1] = 0.0;
new tmpcar = GetPlayerVehicleID(plo);
SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
}
else
{
SetPlayerPos(plo,plocx,plocy+2, plocz);
}
SendClientMessage(plo, COLOR_GRAD1, \" Elteleportáltak\");
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, \" Nem vagy jogosult használni ezt a parancsot!\");
}
}
}
else
{
format(string, sizeof(string), \" %d nem aktív játékos.\", plo);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
//----------------------------------[sethp]------------------------------------------------
else if( !strcmp(cmdtext, \"/sethp\", true) )
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, \"Használat: /sethp [playerid/PartOfName] [health]\");
return 1;
}
new playa;
new health;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
health = strval(tmp);
if (PlayerInfo[playerid][Admin] >= 4)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
SetPlayerHealth(playa, health);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, \" Nem vagy jogosult használni ezt a parancsot!\");
}
}
return 1;
}
else if( !strcmp(cmdtext, \"/setarmor\", true) )
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, \"Használat: /setarmor [playerid/PartOfName] [armor]\");
return 1;
}
new playa;
new health;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
health = strval(tmp);
if (PlayerInfo[playerid][Admin] >= 4)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
SetPlayerArmour(playa, health);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, \" Nem vagy jogosult használni ezt a parancsot!\");
}
}
return 1;
}
else if ( !strcmp(cmdtext, \"/admins\", true) )
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_GRAD1, \"Admin online:\");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[Admin] >= 1 && PlayerInfo[Admin] < 5)
{
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, \"Admin: %s\", sendername);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
}
}
}
return 1;
}
//----------------------------------[MAKEADMIN]------------------------------------------------
else if( !strcmp(cmdtext, \"/makeadmin\", true) )
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, \"Használat: /makeadmin [playerid/PartOfName] [level(1-5)]\");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if (PlayerInfo[playerid][Admin] >= 5)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][Admin] = level;
printf(\"AdmCmd: %s kinevezte %s-t %d szintû adminnak.\", sendername, giveplayer, level);
format(string, sizeof(string), \" Kinevezett %d szintû adminnak %s\", level, sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), \" Kinevezted %s-t %d szintû adminnak.\", giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, \" Nem vagy jogosult használni ezt a parancsot!\");
}
}
return 1;
}
else if( !strcmp(cmdtext, \"/report\", true) )
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= \' \'))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, \"Használat: /report [szöveg]\");
return 1;
}
format(string, sizeof(string), \"Jelentés %s: %s\", sendername, (result));
ABroadCast(COLOR_YELLOW,string,1);
SendClientMessage(playerid, COLOR_YELLOW, \"Üzeneted kézbesítettük az adminisztrátoroknak\");
}
return 1;
}
//----------------------------------[cnn]-----------------------------------------------
else if( !strcmp(cmdtext, \"/cnn\", true) )
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][Admin] >= 1)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= \' \'))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, \"Használat: /cnn [cnn szövegforma ~n~=új sor ~r~=piros ~g~=zöld ~b~=kék ~w~=fehér ~y~=sárga]\");
return 1;
}
format(string, sizeof(string), \"~b~%s: ~w~%s\",sendername,result);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GameTextForPlayer(i, string, 5000, 6);
}
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, \" Ezt a parancsot nem használhatod!\");
return 1;
}
}
return 1;
}
//----------------------------------[Freeze]------------------------------------------------
else if( !strcmp(cmdtext, \"/freeze\", true) )
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, \"Használat: /freeze [playerid/PartOfName]\");
return 1;
}
new playa;
playa = ReturnUser(tmp);
if(PlayerInfo[playa][Admin] > 2)
{
SendClientMessage(playerid, COLOR_GRAD2, \"Admin nem lehet lefagyasztva\");
return 1;
}
if (PlayerInfo[playerid][Admin] >= 2)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
TogglePlayerControllable(playa, 0);
format(string, sizeof(string), \"AdmCmd: %s lefagyasztotta %s -t\",sendername, giveplayer);
printf(\"%s\",string);
format(string, sizeof(string), \"AdmCmd: %s lefagyasztotta %s -t\",giveplayer ,sendername);
ABroadCast(COLOR_LIGHTRED,string,1);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, \" Nem vagy jogosult használni ezt a parancsot!\");
}
}
return 1;
}
//----------------------------------[unfreeze]------------------------------------------------
else if(strcmp(cmdtext, \"/unfreeze\", true) )
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, \"Használat: /unfreeze [playerid]\");
return 1;
}
new playa;
playa = ReturnUser(tmp);
if (PlayerInfo[playerid][Admin] >= 1)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
TogglePlayerControllable(playa, 1);
format(string, sizeof(string), \"AdmCmd: %s felolvasztja %s\",sendername, giveplayer);
printf(\"%s\",string);
format(string, sizeof(string), \"AdmCmd: %s fel lett olvasztva %s által\",giveplayer ,sendername);
ABroadCast(COLOR_LIGHTRED,string,1);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, \" Nem vagy jogosult használni ezt a parancsot!\");
}
}
return 1;
}
return 0;
}
Szerk.: a /reportnál ha beirom akkor elküldi reportba hogy report :S