-
Sziasztok! Segítséget szeretnék kérni, hogy oldható meg, hogy rányomok valakire (Tab, kattint) és kiadja input dialogba hogy pont utalás, beírom mennyit, és annyit utal el a játékosnak, akire rákattintottam. Jelenleg így néz ki a pont utalós scriptem:
//(SCM = SendClientMessage)
//(dialog DIALOG_115-ben)
if(GetPlayerScore(playerid)<500) return SendClientMessage(playerid, 0xFB0000FF, \"Nincs elég pontod!\");
SetPlayerScore(GetPVarInt(playerid, \"CLICKEDPLAYERID\"),GetPlayerScore(playerid)+500);
SetPlayerScore(playerid,GetPlayerScore(playerid)-500);
SCM(GetPVarInt(playerid, \"CLICKEDPLAYERID\"), COLOR_LIGHTGREEN, \"Kaptál 500 pontot!\");
SCM(pd, COLOR_LIGHTGREEN, \"Elutaltál 500 pontot!\");
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
ShowPlayerDialog(playerid, DIALOG_115, 2, \"Utal\", \"Pont utalás\", \"OK\", \"\");
SetPVarInt(playerid, \"CLICKEDPLAYERID\", clickedplayerid);
return 1;
}
Köszönöm szépen!
-
Mi a gond? Egy hibát találtam, hogy a beírt játékosnak nem az õ pontjaihoz adja hozzá, hanem a játékos pontjaihoz aki küldi neki.
//(SCM = SendClientMessage)
//(dialog DIALOG_115-ben)
if(GetPlayerScore(playerid)<500) return SendClientMessage(playerid, 0xFB0000FF, \"Nincs elég pontod!\");
SetPlayerScore(GetPVarInt(playerid, \"CLICKEDPLAYERID\"),GetPlayerScore(GetPVarInt(playerid, \"CLICKEDPLAYERID\"))+500);
SetPlayerScore(playerid,GetPlayerScore(playerid)-500);
SCM(GetPVarInt(playerid, \"CLICKEDPLAYERID\"), COLOR_LIGHTGREEN, \"Kaptál 500 pontot!\");
SCM(pd, COLOR_LIGHTGREEN, \"Elutaltál 500 pontot!\");
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
ShowPlayerDialog(playerid, DIALOG_115, 2, \"Utal\", \"Pont utalás\", \"OK\", \"\");
SetPVarInt(playerid, \"CLICKEDPLAYERID\", clickedplayerid);
return 1;
}
-
Köszönöm szépen :)
De akkor somebody segítsen az input dialogos megoldásban is :unsure:
-
//(SCM = SendClientMessage)
//(dialog DIALOG_115-ben)
if(GetPlayerScore(playerid)<strval(inputtext)) return SendClientMessage(playerid, 0xFB0000FF, \"Nincs elég pontod!\");
SetPlayerScore(GetPVarInt(playerid, \"CLICKEDPLAYERID\"),GetPlayerScore(GetPVarInt(playerid, \"CLICKEDPLAYERID\"))+strval(inputtext));
SetPlayerScore(playerid,GetPlayerScore(playerid)-strval(inputtext));
new str[32];
format(str, 32, \"Kaptál %d pontot!\", strval(inputtext));
SCM(GetPVarInt(playerid, \"CLICKEDPLAYERID\"), COLOR_LIGHTGREEN, str);
format(str, 32, \"Elutaltál %d pontot!\", strval(inputtext));
SCM(pd, COLOR_LIGHTGREEN, str);
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
ShowPlayerDialog(playerid, DIALOG_115, DIALOG_STYLE_INPUT, \"Utal\", \"Pont utalás\", \"OK\", \"\");
SetPVarInt(playerid, \"CLICKEDPLAYERID\", clickedplayerid);
return 1;
}
-
Isten vagy! Köszönöm szépen! :thumbsup:
-
Ha van még kérdésed vagy ha hibás írd le a problémád de ha jó zárd le kérlek, nem az én munkám mondani de zárd akkor le :) ;)