Szerző Téma: /felmond parancsot meglehet oldani a .....  (Megtekintve 1312 alkalommal)

/felmond parancsot meglehet oldani a .....
« Dátum: 2012. Április 10. - 16:31:53 »
0 Show voters
Hali.
Van a szerómon egy /felmond parancs.
és az a baj,vele ha a játékos a börtönben van és beirja akkor kidobja börtönbõl de persze csak akkor ha van munkája.
és ezt ugy kéne h ne tudja használni börtönbe a parancsokat.
Itt a /felmond parancs:
 
      CMD:felmond(playerid, params[])
{
if(GetPlayerTeam(playerid) == 0) return SendClientMessage(playerid, 0xFF0000AA, \"Nincs munkád!\");
        if(GetPlayerTeam(playerid) == 1)
        {
KillTimer(tatimer);
}
if(GetPlayerTeam(playerid) == 2)
{
KillTimer(mtimer);
}
if(GetPlayerTeam(playerid) == 3)
{
KillTimer(autimer);
}
SetPlayerTeam(playerid, 0);
SendClientMessage(playerid, SARGA, \"Felmondtál az állásodból!\");
GameTextForPlayer(playerid, \"~h~~l~Felmondtál!\", 3000, 4);
SetPlayerPos(playerid, -249.8684,2609.4885,62.8582);
return 1;
}

 
Lecsuk parancs:
 
CMD:lecsuk(playerid, params[])
{
if(IsPlayerLAdmin(playerid))
{
new giveplayerid, ido, indok[128], string[128], name[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME];
if(sscanf(params, \"uds\", giveplayerid, ido, indok)) return SendClientMessage(playerid, 0xFF0000FF, \"Használat: /lecsuk [playerid] [perc] [indok]\");
if(!IsPlayerConnected(giveplayerid) || 0 > giveplayerid || giveplayerid > MAX_PLAYERS) return SendClientMessage(playerid, 0xFF0000FF, \"Hiba: Nincs ilyen játékos!\");
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(giveplayerid, name2, sizeof(name2));
format(string, sizeof string, \"{ffffff}[RENDÕR,%s]:{00bbff} Börtönbe zárta %s -t {b22222}[[Perc: %d]] [[indok: %s]]\", name, name2, ido, indok);
SendClientMessageToAll(0xB3D5B2AA,string);
ido *= 60000;
SetTimerEx(\"Bortonido\",ido,false,\"d\",giveplayerid);
SetPlayerPos(giveplayerid,2199.7134,1224.0686,10.8203);
SetPlayerInterior(giveplayerid, 0);
}
else
{
SendClientMessage(playerid, hiba, \"Nem vagy rendõr!\");
}
return 1;
}
forward Bortonido(playerid);
public Bortonido(playerid)
{
SpawnPlayer(playerid);
return 1;
}

/felmond parancsot meglehet oldani a .....
« Válasz #1 Dátum: 2012. Április 10. - 16:37:11 »
0 Show voters
megírod hogy ha 2199.7134,1224.0686,10.8203 ezen a kordinátán van akkor ne használhasa a parancsot

/felmond parancsot meglehet oldani a .....
« Válasz #2 Dátum: 2012. Április 10. - 16:39:04 »
0 Show voters
De épp ezaz h hogy...

Nem elérhető zeteni

  • 1970
  • Ex-Scripter
    • Profil megtekintése
/felmond parancsot meglehet oldani a .....
« Válasz #3 Dátum: 2012. Április 10. - 16:54:38 »
0 Show voters
#include <a_samp>
#include <zcmd>
 
CMD:felmond(playerid, params[])
{
if(!IsPlayerInRangeOfPoint(playerid, 10.0, x, y, z)) return SendClientMessage(playerid, szin, \"Itt ezt nem használhatod!\");
if(GetPlayerTeam(playerid) == 0) return SendClientMessage(playerid, 0xFF0000AA, \"Nincs munkád!\");
        if(GetPlayerTeam(playerid) == 1)
        {
KillTimer(tatimer);
}
if(GetPlayerTeam(playerid) == 2)
{
KillTimer(mtimer);
}
if(GetPlayerTeam(playerid) == 3)
{
KillTimer(autimer);
}
SetPlayerTeam(playerid, 0);
SendClientMessage(playerid, SARGA, \"Felmondtál az állásodból!\");
GameTextForPlayer(playerid, \"~h~~l~Felmondtál!\", 3000, 4);
SetPlayerPos(playerid, -249.8684,2609.4885,62.8582);
return 1;
}

 
Tesztelni nem teszteltem!

Nem elérhető Gabor..

  • 1883
  • Gabor..
    • Profil megtekintése
/felmond parancsot meglehet oldani a .....
« Válasz #4 Dátum: 2012. Április 10. - 17:00:10 »
+1 Show voters
PVar-al megoldható.
 
public OnPlayerConnect(playerid)
{
     SetPVarInt(playerid, \"Lecsukott\", 0);
     return 1;
}
 
CMD:lecsuk(playerid, params[])
{
if(IsPlayerLAdmin(playerid))
{
new giveplayerid, ido, indok[128], string[128], name[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME];
if(sscanf(params, \"uds\", giveplayerid, ido, indok)) return SendClientMessage(playerid, 0xFF0000FF, \"Használat: /lecsuk [playerid] [perc] [indok]\");
if(!IsPlayerConnected(giveplayerid) || 0 > giveplayerid || giveplayerid > MAX_PLAYERS) return SendClientMessage(playerid, 0xFF0000FF, \"Hiba: Nincs ilyen játékos!\");
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(giveplayerid, name2, sizeof(name2));
format(string, sizeof string, \"{ffffff}[RENDÕR,%s]:{00bbff} Börtönbe zárta %s -t {b22222}[[Perc: %d]] [[indok: %s]]\", name, name2, ido, indok);
SendClientMessageToAll(0xB3D5B2AA,string);
ido *= 60000;
SetTimerEx(\"Bortonido\",ido,false,\"d\",giveplayerid);
SetPlayerPos(giveplayerid,2199.7134,1224.0686,10.8203);
SetPlayerInterior(giveplayerid, 0);
                SetPVarInt(playerid, \"Lecsukott\", 1);
}
else
{
SendClientMessage(playerid, hiba, \"Nem vagy rendõr!\");
}
return 1;
}
forward Bortonido(playerid);
public Bortonido(playerid)
{
SpawnPlayer(playerid);
            return 1;
}

 
Ezt meg odarakod minden parancsodhoz
if(GetPVarInt(playerid, \"Lecsukott\")) == 0)
{
//Függvények
}
« Utoljára szerkesztve: 2012. Április 10. - 17:11:32 írta Gabor.. »

/felmond parancsot meglehet oldani a .....
« Válasz #5 Dátum: 2012. Április 10. - 17:15:49 »
0 Show voters
E:\\Documents and Settings\\Krisz\\Asztal\\[R]endõr [A]cademy\\gamemodes\\EMR.pwn(744) : error 029: invalid expression, assumed zero
E:\\Documents and Settings\\Krisz\\Asztal\\[R]endõr [A]cademy\\gamemodes\\EMR.pwn(744) : warning 215: expression has no effect
E:\\Documents and Settings\\Krisz\\Asztal\\[R]endõr [A]cademy\\gamemodes\\EMR.pwn(744) : error 001: expected token: \";\", but found \")\"
E:\\Documents and Settings\\Krisz\\Asztal\\[R]endõr [A]cademy\\gamemodes\\EMR.pwn(744) : error 029: invalid expression, assumed zero
E:\\Documents and Settings\\Krisz\\Asztal\\[R]endõr [A]cademy\\gamemodes\\EMR.pwn(744) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase
 
4 Errors.

 
HIBA :S
« Utoljára szerkesztve: 2012. Április 10. - 17:18:08 írta Yakuza™ »

Nem elérhető Gabor..

  • 1883
  • Gabor..
    • Profil megtekintése
/felmond parancsot meglehet oldani a .....
« Válasz #6 Dátum: 2012. Április 10. - 17:20:31 »
0 Show voters
Másold be a sort!

/felmond parancsot meglehet oldani a .....
« Válasz #7 Dátum: 2012. Április 10. - 17:21:23 »
0 Show voters
if(GetPVarInt(playerid, \"Lecsukott\")) == 0);

 
tess

Nem elérhető Gabor..

  • 1883
  • Gabor..
    • Profil megtekintése
/felmond parancsot meglehet oldani a .....
« Válasz #8 Dátum: 2012. Április 10. - 17:22:53 »
0 Show voters
A pontos vesszõt töröld le:
 
if(GetPVarInt(playerid, \"Lecsukott\")) == 0)

/felmond parancsot meglehet oldani a .....
« Válasz #9 Dátum: 2012. Április 10. - 17:23:57 »
0 Show voters
ugyan az a hiba

Nem elérhető Gabor..

  • 1883
  • Gabor..
    • Profil megtekintése
/felmond parancsot meglehet oldani a .....
« Válasz #10 Dátum: 2012. Április 10. - 17:25:09 »
+1 Show voters
Bocsánat, tisztára elvagyok kalandozva.:D
 
if(GetPVarInt(playerid, \"Lecsukott\") == 0)
« Utoljára szerkesztve: 2012. Április 10. - 17:27:30 írta Gabor.. »

/felmond parancsot meglehet oldani a .....
« Válasz #11 Dátum: 2012. Április 10. - 17:26:33 »
0 Show voters
XD
szövegkörnyezet? xDDDd

Nem elérhető Gabor..

  • 1883
  • Gabor..
    • Profil megtekintése
/felmond parancsot meglehet oldani a .....
« Válasz #12 Dátum: 2012. Április 10. - 17:28:45 »
0 Show voters
Módositottam. Bocsánat, nem figyeltem oda. :D
 
if(GetPVarInt(playerid, \"Lecsukott\") == 0)

/felmond parancsot meglehet oldani a .....
« Válasz #13 Dátum: 2012. Április 10. - 17:29:16 »
0 Show voters
XD semmibaj.
Na mostmár jó. Ment a +!
Köszi.

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal