Szerző Téma: Clickedplayerid pontutalás  (Megtekintve 682 alkalommal)

Clickedplayerid pontutalás
« Dátum: 2012. November 20. - 19:35:42 »
0 Show voters
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!
« Utoljára szerkesztve: 2012. November 20. - 19:37:18 írta Walaky »

Nem elérhető Casamiro

  • 1046
    • Profil megtekintése
Clickedplayerid pontutalás
« Válasz #1 Dátum: 2012. November 20. - 19:41:04 »
0 Show voters
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;
}

Clickedplayerid pontutalás
« Válasz #2 Dátum: 2012. November 20. - 19:46:17 »
0 Show voters
Köszönöm szépen :)
De akkor somebody segítsen az input dialogos megoldásban is  :unsure:

Nem elérhető Casamiro

  • 1046
    • Profil megtekintése
Clickedplayerid pontutalás
« Válasz #3 Dátum: 2012. November 20. - 19:52:00 »
0 Show voters
//(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;
}

Clickedplayerid pontutalás
« Válasz #4 Dátum: 2012. November 20. - 20:05:23 »
0 Show voters
Isten vagy! Köszönöm szépen!  :thumbsup:

Nem elérhető ZyZu.

  • Globális moderátor
  • 8939
  • my turbo diesel forum
  • Discord: ZyZu.
    • Profil megtekintése
Clickedplayerid pontutalás
« Válasz #5 Dátum: 2012. November 21. - 15:12:04 »
0 Show voters
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 :)  ;)

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal