Szerző Téma: Szint Baj :(  (Megtekintve 867 alkalommal)

Szint Baj :(
« Dátum: 2013. január 12. - 12:46:10 »
0 Show voters
Hy!
Van egy ilyen rendszerem amit letöltöttem és átlakítottam.
Szóval mikor megölök egy játékost kapok pontot, de ezt a pontot a másik játékos akit megöltem az is megkapja ez miért van? :)
 
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
 
///////////////Szint//////////
#define egy \"Szint:1\"
#define ketto \"Szint:2\"
#define harom \"Szint:3\"
#define negy \"Szint:4\"
#define ot \"Szint:5\"
#define hat \"Szint:6\"
///////////////////////////
new Text:Textdraw0;
new Text:Textdraw2;
 
 
public OnGameModeInit()
{
SetTimer(\"Szamitas\", 1000, true);
///////RANGPONTOK////////////////////////////////
    Textdraw0 = TextDrawCreate(1.000000, 423.000000, \"_\");
    TextDrawBackgroundColor(Textdraw0, 255);
    TextDrawFont(Textdraw0, 2);
    TextDrawLetterSize(Textdraw0, 0.700000, 2.799999);
    TextDrawColor(Textdraw0, 0xffffffff);
    TextDrawSetOutline(Textdraw0, 0);
    TextDrawSetProportional(Textdraw0, 1);
    TextDrawSetShadow(Textdraw0, 1);
   
   
    /////////////////////LEVEL////////////////////////////////////
    Textdraw2 = TextDrawCreate(483.000000, 422.000000, \"_\");
    TextDrawBackgroundColor(Textdraw2, 255);
    TextDrawFont(Textdraw2, 2);
    TextDrawLetterSize(Textdraw2, 0.600000, 3.100000);
    TextDrawColor(Textdraw2, 0xffffffff);
    TextDrawSetOutline(Textdraw2, 0);
    TextDrawSetProportional(Textdraw2, 1);
    TextDrawSetShadow(Textdraw2, 1);
return 1;
}
public OnGameModeExit()
{
return 1;
}
 
public OnPlayerConnect(playerid)
{
    TextDrawShowForPlayer(playerid,Textdraw0);
    TextDrawShowForPlayer(playerid,Textdraw2);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
    TextDrawHideForPlayer(playerid,Textdraw0);
    TextDrawHideForPlayer(playerid,Textdraw2);
return 1;
}
forward Szamitas(playerid);
public Szamitas(playerid)
{
new string[65],pont = GetPlayerScore(playerid);
format(string,sizeof(string),\"Pont: %d\",pont);
TextDrawSetString(Textdraw0, string);
/////////////////////Szint/////////////////////////////////////////////
    if((GetPlayerScore(playerid) >= 0) && (GetPlayerScore(playerid) <= 50))
    {
    TextDrawSetString(Textdraw2,egy);
    }
    if((GetPlayerScore(playerid) >= 51) && (GetPlayerScore(playerid) <= 100))
    {
    TextDrawSetString(Textdraw2,ketto);
    }
    if((GetPlayerScore(playerid) >= 101) && (GetPlayerScore(playerid) <= 140))
    {
    TextDrawSetString(Textdraw2,harom);
    }
    if((GetPlayerScore(playerid) >= 141) && (GetPlayerScore(playerid) <= 180))
    {
    TextDrawSetString(Textdraw2,negy);
    }
    if((GetPlayerScore(playerid) >= 181) && (GetPlayerScore(playerid) <= 201))
    {
    TextDrawSetString(Textdraw2,ot);
    }
    if((GetPlayerScore(playerid) >= 202) && (GetPlayerScore(playerid) <= 300))
    {
    TextDrawSetString(Textdraw2,hat);
    }
    return 1;
    }

Szint Baj :(
« Válasz #1 Dátum: 2013. január 12. - 13:23:29 »
0 Show voters
A módodból (vagy ha vannak fs-eid akkor azokbó isl) az OnPlayerDeath részt másold már be, légyszi!
E: nem ez lesz a baj szeritem
« Utoljára szerkesztve: 2013. január 12. - 13:44:42 írta Virgonc »

Nem elérhető Rupert

  • 2301
    • Profil megtekintése
Szint Baj :(
« Válasz #2 Dátum: 2013. január 12. - 13:29:58 »
+1 Show voters

// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
 
///////////////Szint//////////
#define egy \"Szint:1\"
#define ketto \"Szint:2\"
#define harom \"Szint:3\"
#define negy \"Szint:4\"
#define ot \"Szint:5\"
#define hat \"Szint:6\"
///////////////////////////
new Text:Textdraw0;
new Text:Textdraw2;
 
 
public OnGameModeInit()
{
SetTimer(\"Szamitas\", 1000, true);
///////RANGPONTOK////////////////////////////////
    Textdraw0 = TextDrawCreate(1.000000, 423.000000, \"_\");
    TextDrawBackgroundColor(Textdraw0, 255);
    TextDrawFont(Textdraw0, 2);
    TextDrawLetterSize(Textdraw0, 0.700000, 2.799999);
    TextDrawColor(Textdraw0, 0xffffffff);
    TextDrawSetOutline(Textdraw0, 0);
    TextDrawSetProportional(Textdraw0, 1);
    TextDrawSetShadow(Textdraw0, 1);
   
   
    /////////////////////LEVEL////////////////////////////////////
    Textdraw2 = TextDrawCreate(483.000000, 422.000000, \"_\");
    TextDrawBackgroundColor(Textdraw2, 255);
    TextDrawFont(Textdraw2, 2);
    TextDrawLetterSize(Textdraw2, 0.600000, 3.100000);
    TextDrawColor(Textdraw2, 0xffffffff);
    TextDrawSetOutline(Textdraw2, 0);
    TextDrawSetProportional(Textdraw2, 1);
    TextDrawSetShadow(Textdraw2, 1);
return 1;
}
public OnGameModeExit()
{
return 1;
}
 
public OnPlayerConnect(playerid)
{
    TextDrawShowForPlayer(playerid,Textdraw0);
    TextDrawShowForPlayer(playerid,Textdraw2);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
    TextDrawHideForPlayer(playerid,Textdraw0);
    TextDrawHideForPlayer(playerid,Textdraw2);
return 1;
}
forward Szamitas();
public Szamitas()
{
        for(new playerid=-1;playerid<MAX_PLAYERS;playerid++)
        {
new string[65],pont = GetPlayerScore(playerid);
format(string,sizeof(string),\"Pont: %d\",pont);
TextDrawSetString(Textdraw0, string);
/////////////////////Szint/////////////////////////////////////////////
    if((GetPlayerScore(playerid) >= 0) && (GetPlayerScore(playerid) <= 50))
    {
    TextDrawSetString(Textdraw2,egy);
    }
    if((GetPlayerScore(playerid) >= 51) && (GetPlayerScore(playerid) <= 100))
    {
    TextDrawSetString(Textdraw2,ketto);
    }
    if((GetPlayerScore(playerid) >= 101) && (GetPlayerScore(playerid) <= 140))
    {
    TextDrawSetString(Textdraw2,harom);
    }
    if((GetPlayerScore(playerid) >= 141) && (GetPlayerScore(playerid) <= 180))
    {
    TextDrawSetString(Textdraw2,negy);
    }
    if((GetPlayerScore(playerid) >= 181) && (GetPlayerScore(playerid) <= 201))
    {
    TextDrawSetString(Textdraw2,ot);
    }
    if((GetPlayerScore(playerid) >= 202) && (GetPlayerScore(playerid) <= 300))
    {
    TextDrawSetString(Textdraw2,hat);
    }
    return 1;
    }

 
Most?

Nem elérhető Tamas

Szint Baj :(
« Válasz #3 Dátum: 2013. január 12. - 13:38:47 »
0 Show voters
Igen sztem ezel a kodal az baj hogy mikor van az hogy TextDrawSetString(Textdraw2,ot); eznemjo mert a textdraw-ot mindenki lasa de mikor van ez  TextDrawSetString itten akkor mindenkinek ugyvan hogy lassa azt a textdrawot kene olyan hogy \"playerid\"
Szerintem valhogy ezzel kene megoldani \"PlayerTextDrawSetString(playerid, PlayerText:text, string[])\"

http://wiki.sa-mp.com/wiki/PlayerTextDrawSetString
« Utoljára szerkesztve: 2013. január 12. - 13:42:40 írta Tamas »

Szint Baj :(
« Válasz #4 Dátum: 2013. január 12. - 15:47:55 »
0 Show voters
Ezekre a sorokra Errort ír :(
 
forward Szamitas(playerid);
public Szamitas(playerid)
{
for(new playerid=-1;playerid<MAX_PLAYERS;playerid++)
        {
new string[65],pont = GetPlayerScore(playerid);
format(string,sizeof(string),\"Pont: %d\",pont);
TextDrawSetString(Textdraw0, string);
/////////////////////Szint/////////////////////////////////////////////
    if((GetPlayerScore(playerid) >= 0) && (GetPlayerScore(playerid) <= 50))
    {
    TextDrawSetString(Textdraw2,egy);
    }
    if((GetPlayerScore(playerid) >= 51) && (GetPlayerScore(playerid) <= 100))
    {
    TextDrawSetString(Textdraw2,ketto);
    }
    if((GetPlayerScore(playerid) >= 101) && (GetPlayerScore(playerid) <= 140))
    {
    TextDrawSetString(Textdraw2,harom);
    }
    if((GetPlayerScore(playerid) >= 141) && (GetPlayerScore(playerid) <= 180))
    {
    TextDrawSetString(Textdraw2,negy);
    }
    if((GetPlayerScore(playerid) >= 181) && (GetPlayerScore(playerid) <= 201))
    {
    TextDrawSetString(Textdraw2,ot);
    }
    if((GetPlayerScore(playerid) >= 202) && (GetPlayerScore(playerid) <= 300))
    {
    TextDrawSetString(Textdraw2,hat);
    }
    return 1;
   

 

C:\\Games\\03e\\filterscripts\\stats.pwn(107) : error 017: undefined symbol \"Save\"
C:\\Games\\03e\\filterscripts\\stats.pwn(162) : warning 219: local variable \"playerid\" shadows a variable at a preceding level
C:\\Games\\03e\\filterscripts\\stats.pwn(194) : error 029: invalid expression, assumed zero
C:\\Games\\03e\\filterscripts\\stats.pwn(194) : error 004: function \"OnPlayerSpawn\" is not implemented
C:\\Games\\03e\\filterscripts\\stats.pwn(204) : warning 225: unreachable code
C:\\Games\\03e\\filterscripts\\stats.pwn(204) : error 029: invalid expression, assumed zero
C:\\Games\\03e\\filterscripts\\stats.pwn(204) : error 004: function \"OnPlayerDeath\" is not implemented
C:\\Games\\03e\\filterscripts\\stats.pwn(215) : error 017: undefined symbol \"killerid\"
C:\\Games\\03e\\filterscripts\\stats.pwn(220) : warning 225: unreachable code
C:\\Games\\03e\\filterscripts\\stats.pwn(220) : error 029: invalid expression, assumed zero
C:\\Games\\03e\\filterscripts\\stats.pwn(220) : error 004: function \"OnPlayerCommandText\" is not implemented
C:\\Games\\03e\\filterscripts\\stats.pwn(222) : error 017: undefined symbol \"cmdtext\"
C:\\Games\\03e\\filterscripts\\stats.pwn(232) : error 017: undefined symbol \"cmdtext\"
C:\\Games\\03e\\filterscripts\\stats.pwn(246) : warning 225: unreachable code
C:\\Games\\03e\\filterscripts\\stats.pwn(246) : error 029: invalid expression, assumed zero
C:\\Games\\03e\\filterscripts\\stats.pwn(246) : error 004: function \"StatsInfromation\" is not implemented
C:\\Games\\03e\\filterscripts\\stats.pwn(259) : warning 225: unreachable code
C:\\Games\\03e\\filterscripts\\stats.pwn(259) : error 029: invalid expression, assumed zero
C:\\Games\\03e\\filterscripts\\stats.pwn(259) : error 017: undefined symbol \"Save\"
C:\\Games\\03e\\filterscripts\\stats.pwn(279) : error 030: compound statement not closed at the end of file (started at line 162)
Pawn compiler 3.2.3664           Copyright (c) 1997-2006, ITB CompuPhase
 
15 Errors.

Nem elérhető Rupert

  • 2301
    • Profil megtekintése
Szint Baj :(
« Válasz #5 Dátum: 2013. január 12. - 15:52:03 »
+1 Show voters

forward Szamitas();
public Szamitas()
{
for(new playerid=-1;playerid<MAX_PLAYERS;playerid++)
        {
new string[65],pont = GetPlayerScore(playerid);
format(string,sizeof(string),\"Pont: %d\",pont);
TextDrawSetString(Textdraw0, string);
/////////////////////Szint/////////////////////////////////////////////
    if((GetPlayerScore(playerid) >= 0) && (GetPlayerScore(playerid) <= 50))
    {
    TextDrawSetString(Textdraw2,egy);
    }
    if((GetPlayerScore(playerid) >= 51) && (GetPlayerScore(playerid) <= 100))
    {
    TextDrawSetString(Textdraw2,ketto);
    }
    if((GetPlayerScore(playerid) >= 101) && (GetPlayerScore(playerid) <= 140))
    {
    TextDrawSetString(Textdraw2,harom);
    }
    if((GetPlayerScore(playerid) >= 141) && (GetPlayerScore(playerid) <= 180))
    {
    TextDrawSetString(Textdraw2,negy);
    }
    if((GetPlayerScore(playerid) >= 181) && (GetPlayerScore(playerid) <= 201))
    {
    TextDrawSetString(Textdraw2,ot);
    }
    if((GetPlayerScore(playerid) >= 202) && (GetPlayerScore(playerid) <= 300))
    {
    TextDrawSetString(Textdraw2,hat);
    }
    }
    return 1;
}

 
Most próbáld.

Szint Baj :(
« Válasz #6 Dátum: 2013. január 12. - 16:08:43 »
0 Show voters
Nem ír errort
De a pontot se adja semelykõknek.  :shurg:

Nem elérhető Tamas

Szint Baj :(
« Válasz #7 Dátum: 2013. január 12. - 17:04:12 »
0 Show voters
Szia megcsináltam szerintem mûködni fog.
 

#include <a_samp>
 
///////////////Szint//////////
#define egy \"Szint:1\"
#define ketto \"Szint:2\"
#define harom \"Szint:3\"
#define negy \"Szint:4\"
#define ot \"Szint:5\"
#define hat \"Szint:6\"
///////////////////////////
 
new PlayerText:Textdraw0[MAX_PLAYERS];
new PlayerText:Textdraw2[MAX_PLAYERS];
 
public OnFilterScriptInit()
{
SetTimer(\"Szamitas\", 1000, true);
return 1;
}
 
public OnPlayerConnect(playerid)
{
    Textdraw0[playerid] = CreatePlayerTextDraw(playerid,1.000000, 423.000000, \"_\");
    PlayerTextDrawBackgroundColor(playerid,Textdraw0[playerid], 255);
    PlayerTextDrawFont(playerid,Textdraw0[playerid], 2);
    PlayerTextDrawLetterSize(playerid,Textdraw0[playerid], 0.700000, 2.799999);
    PlayerTextDrawColor(playerid,Textdraw0[playerid], 0xffffffff);
    PlayerTextDrawSetOutline(playerid,Textdraw0[playerid], 0);
    PlayerTextDrawSetProportional(playerid,Textdraw0[playerid], 1);
    PlayerTextDrawSetShadow(playerid,Textdraw0[playerid], 1);
 
    /////////////////////LEVEL////////////////////////////////////
    Textdraw2[playerid] = CreatePlayerTextDraw(playerid,483.000000, 422.000000, \"_\");
    PlayerTextDrawBackgroundColor(playerid,Textdraw2[playerid], 255);
    PlayerTextDrawFont(playerid,Textdraw2[playerid], 2);
    PlayerTextDrawLetterSize(playerid,Textdraw2[playerid], 0.600000, 3.100000);
    PlayerTextDrawColor(playerid,Textdraw2[playerid], 0xffffffff);
    PlayerTextDrawSetOutline(playerid,Textdraw2[playerid], 0);
    PlayerTextDrawSetProportional(playerid,Textdraw2[playerid], 1);
    PlayerTextDrawSetShadow(playerid,Textdraw2[playerid], 1);
   
   
return 1;
}
 
public OnPlayerSpawn(playerid)
{
    PlayerTextDrawShow(playerid, Textdraw0[playerid]);
    PlayerTextDrawShow(playerid, Textdraw2[playerid]);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
    PlayerTextDrawHide(playerid,Textdraw0[playerid]);
    PlayerTextDrawHide(playerid,Textdraw2[playerid]);
return 1;
}
forward Szamitas(playerid);
public Szamitas(playerid)
{
new string[65],pont = GetPlayerScore(playerid);
format(string,sizeof(string),\"Pont: %d\",pont);
    PlayerTextDrawSetString(playerid,Textdraw0[playerid], string);
/////////////////////Szint/////////////////////////////////////////////
    if((GetPlayerScore(playerid) >= 0) && (GetPlayerScore(playerid) <= 50))
    {
    PlayerTextDrawSetString(playerid,Textdraw2[playerid],egy);
    }
    if((GetPlayerScore(playerid) >= 51) && (GetPlayerScore(playerid) <= 100))
    {
     PlayerTextDrawSetString(playerid,Textdraw2[playerid],ketto);
    }
    if((GetPlayerScore(playerid) >= 101) && (GetPlayerScore(playerid) <= 140))
    {
     PlayerTextDrawSetString(playerid,Textdraw2[playerid],harom);
    }
    if((GetPlayerScore(playerid) >= 141) && (GetPlayerScore(playerid) <= 180))
    {
     PlayerTextDrawSetString(playerid,Textdraw2[playerid],negy);
    }
    if((GetPlayerScore(playerid) >= 181) && (GetPlayerScore(playerid) <= 201))
    {
     PlayerTextDrawSetString(playerid,Textdraw2[playerid],ot);
    }
    if((GetPlayerScore(playerid) >= 202) && (GetPlayerScore(playerid) <= 300))
    {
    PlayerTextDrawSetString(playerid,Textdraw2[playerid],hat);
    }
    return 1;
    }

 

Idézetet írta: ninjo98 date=1357991170\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"32296\" data-ipsquote-contentclass=\"forums_Topic
Hy!
Van egy ilyen rendszerem amit letöltöttem és átlakítottam.
Szóval mikor megölök egy játékost kapok pontot, de ezt a pontot a másik játékos akit megöltem az is megkapja ez miért van? :)
 
Azert kapja  meg mert mikor beteszel a szerverbe egy rendes textdrawot akkor mindenki ugyanazt lássa igaz? Na énnél is pont úgyvolt mert mindegyik játékoshoz hozzákell tenni hogy\"playerid\" hogy csak annak a jatekosnak.
« Utoljára szerkesztve: 2013. január 12. - 17:09:14 írta Tamas »

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal