GTA Közösség - A magyar GTA fórum

San Andreas Multiplayer (SA-MP) => SA-MP: Szerverfejlesztés => Segítségkérés => A témát indította: Walaky - 2012. november 20. - 19:35:42

Cím: Clickedplayerid pontutalás
Írta: Walaky - 2012. november 20. - 19:35:42
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!
Cím: Clickedplayerid pontutalás
Írta: Casamiro - 2012. november 20. - 19:41:04
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;
}
Cím: Clickedplayerid pontutalás
Írta: Walaky - 2012. november 20. - 19:46:17
Köszönöm szépen :)
De akkor somebody segítsen az input dialogos megoldásban is  :unsure:
Cím: Clickedplayerid pontutalás
Írta: Casamiro - 2012. november 20. - 19:52:00
//(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;
}
Cím: Clickedplayerid pontutalás
Írta: Walaky - 2012. november 20. - 20:05:23
Isten vagy! Köszönöm szépen!  :thumbsup:
Cím: Clickedplayerid pontutalás
Írta: ZyZu. - 2012. november 21. - 15:12:04
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 :)  ;)