Jump to content

Tutorial textdraw reports


Daedric-Fox

Recommended Posts

Descriere tutorial: As vrea sa faceti un tutorial despre crearea unui textdraw care arata numarul de report-uri trimise de playeri.(pe dini)

reports.png

  • Upvote 1

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

Salut, creezi o variabila

new NumarReport = 0;//la inceputul gm-ului

La comanda /report dupa mesajul "reportul tau a fost trimis" adaugi asta

NumarReport ++;

La comanda /acceptreport sau cum ai tu comanda pentru a raspunde la report, adaugi asta dupa mesajul"X ti-a raspuns la report"

NumarulReport --;

Apoi creezi textdrawl


La inceputul gm-ului

new Text:TextdrawReport[MAX_PLAYERS];

La OnGameModeInit creezi textdrawul

 

        TextdrawReport[i] = TextDrawCreate(466.000000,380.000000, " "); // report
		TextDrawBackgroundColor(TextdrawReport[i], 255);
		TextDrawFont(TextdrawReport[i], 1);
		TextDrawLetterSize(TextdrawReport[i], 0.299999,1.000000);
		TextDrawColor(TextdrawReport[i], 0xFFFFFFFF);
		TextDrawSetOutline(TextdrawReport[i], 1);
		TextDrawSetProportional(TextdrawReport[i], 1);

la OnPlayerUpdate pui asta:

new stringreport[10];
format(stringreport, sizeof(stringreport), "~y~Reporturi: %d", NumarReport);//afisam reporturile
TextDrawSetString(TextdrawReport[playerid], stringreport);

Si la OnplayerSpawn punem codul uramtor:

	if(PlayerInfo[playerid][pAdmin] > 0)
	TextDrawShowForPlayer(playerid,TextdrawReport[playerid]);

E destul de simplu daca mai vrei ceva la el, modifici singur nu este atat de greu

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

@Mister imi da urmatoarele erori:

C:\Users\Dell\Desktop\pawno\gm qz - t4p\gamemodes\gf.pwn(19598) : error 017: undefined symbol "i"
C:\Users\Dell\Desktop\pawno\gm qz - t4p\gamemodes\gf.pwn(19599) : error 017: undefined symbol "i"
C:\Users\Dell\Desktop\pawno\gm qz - t4p\gamemodes\gf.pwn(19600) : error 017: undefined symbol "i"
C:\Users\Dell\Desktop\pawno\gm qz - t4p\gamemodes\gf.pwn(19601) : error 017: undefined symbol "i"
C:\Users\Dell\Desktop\pawno\gm qz - t4p\gamemodes\gf.pwn(19602) : error 017: undefined symbol "i"
C:\Users\Dell\Desktop\pawno\gm qz - t4p\gamemodes\gf.pwn(19603) : error 017: undefined symbol "i"

 

folosesc includeul foreach.

sinu am comanda accept rreport, mi-o poti da te rog frumos?

 

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

Unde ai tu celelante textdraw au o litera in [ ] schimbi la acest textdraw cu ce ai tu acolo si gata , accept report depinde ce ai tu in gm + ce procesor de comenzi foloseti , clasic , zcmd , etc  , lasa detalii si te ajut .

Link to comment
Share on other sites

  • 5 months later...

Salut. Am facut acesti pasi si uita-ti cum imi apare: http://imgur.com/PD5BsGL

Folosesc gm saints edit (bigzone)

Cum pot face sa mearga?

Edited by s4uriK

                     

  Serverul meu de Discord: Click aici       a7DfKP7.gif                                                                      FGIfknL.gif

k35T5Nb.png                                                                                                                                                                                                                                                                                                I0aS856.gif

Link to comment
Share on other sites

Acum 22 minute, s4uriK a spus:

Salut. Am facut acesti pasi si uita-ti cum imi apare: http://imgur.com/PD5BsGL

Folosesc gm saints edit (bigzone)

Cum pot face sa mearga?

Ai pus pa onplayerupdate?iar la /report NumarReport++;  ?

new stringreport[10];
format(stringreport, sizeof(stringreport), "~y~Reporturi: %d", NumarReport);//afisam reporturile
TextDrawSetString(TextdrawReport[playerid], stringreport);
Edited by Mister

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

44 minutes ago, Mister said:

Ai pus pa onplayerupdate?iar la /report NumarReport++;  ?


new stringreport[10];
format(stringreport, sizeof(stringreport), "~y~Reporturi: %d", NumarReport);//afisam reporturile
TextDrawSetString(TextdrawReport[playerid], stringreport);

DA

                     

  Serverul meu de Discord: Click aici       a7DfKP7.gif                                                                      FGIfknL.gif

k35T5Nb.png                                                                                                                                                                                                                                                                                                I0aS856.gif

Link to comment
Share on other sites

La 28.07.2015la16:43, Mister a spus:

Salut, creezi o variabila


new NumarReport = 0;//la inceputul gm-ului

La comanda /report dupa mesajul "reportul tau a fost trimis" adaugi asta


NumarReport ++;

La comanda /acceptreport sau cum ai tu comanda pentru a raspunde la report, adaugi asta dupa mesajul"X ti-a raspuns la report"


NumarulReport --;

Apoi creezi textdrawl


La inceputul gm-ului


new Text:TextdrawReport[MAX_PLAYERS];

La OnGameModeInit creezi textdrawul

 


        TextdrawReport[i] = TextDrawCreate(466.000000,380.000000, " "); // report
		TextDrawBackgroundColor(TextdrawReport[i], 255);
		TextDrawFont(TextdrawReport[i], 1);
		TextDrawLetterSize(TextdrawReport[i], 0.299999,1.000000);
		TextDrawColor(TextdrawReport[i], 0xFFFFFFFF);
		TextDrawSetOutline(TextdrawReport[i], 1);
		TextDrawSetProportional(TextdrawReport[i], 1);

la OnPlayerUpdate pui asta:


new stringreport[10];
format(stringreport, sizeof(stringreport), "~y~Reporturi: %d", NumarReport);//afisam reporturile
TextDrawSetString(TextdrawReport[playerid], stringreport);

Si la OnplayerSpawn punem codul uramtor:


	if(PlayerInfo[playerid][pAdmin] > 0)
	TextDrawShowForPlayer(playerid,TextdrawReport[playerid]);

E destul de simplu daca mai vrei ceva la el, modifici singur nu este atat de greu

Ma ajutati

E:\Users\ionut\Desktop\gamemode bun\gamemodes\gmm.pwn(2096) : error 017: undefined symbol "i"
E:\Users\ionut\Desktop\gamemode bun\gamemodes\gmm.pwn(2097) : error 017: undefined symbol "i"
E:\Users\ionut\Desktop\gamemode bun\gamemodes\gmm.pwn(2098) : error 017: undefined symbol "i"
E:\Users\ionut\Desktop\gamemode bun\gamemodes\gmm.pwn(2099) : error 017: undefined symbol "i"
E:\Users\ionut\Desktop\gamemode bun\gamemodes\gmm.pwn(2100) : error 017: undefined symbol "i"
E:\Users\ionut\Desktop\gamemode bun\gamemodes\gmm.pwn(2101) : error 017: undefined symbol "i"
E:\Users\ionut\Desktop\gamemode bun\gamemodes\gmm.pwn(2102) : error 017: undefined symbol "i"
E:\Users\ionut\Desktop\gamemode bun\gamemodes\gmm.pwn(10138) : error 017: undefined symbol "PlayerInfo"
E:\Users\ionut\Desktop\gamemode bun\gamemodes\gmm.pwn(10138) : warning 215: expression has no effect
E:\Users\ionut\Desktop\gamemode bun\gamemodes\gmm.pwn(10138) : error 001: expected token: ";", but found "]"
E:\Users\ionut\Desktop\gamemode bun\gamemodes\gmm.pwn(10138) : error 029: invalid expression, assumed zero
E:\Users\ionut\Desktop\gamemode bun\gamemodes\gmm.pwn(10138) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase


11 Errors.

Link to comment
Share on other sites

Acum 1 minut, Mister a spus:

Trebuie configurat pentru gm-ul tau nu il iei si il arunci pur si simplu in gm

Folosesc gm virtual RPG

aici am problema  mare , ce trebuie sa configurez

    if(PlayerInfo[playerid][pAdmin] > 0)
    TextDrawShowForPlayer(playerid,TextdrawReport[playerid]);

Acum 1 minut, marius11 a spus:

Folosesc gm virtual RPG

aici am problema  mare , ce trebuie sa configurez

    if(PlayerInfo[playerid][pAdmin] > 0)
    TextDrawShowForPlayer(playerid,TextdrawReport[playerid]);

E:\Users\ionut\Desktop\gamemode bun\gamemodes\gmm.pwn(10100) : error 017: undefined symbol "PlayerInfo"
E:\Users\ionut\Desktop\gamemode bun\gamemodes\gmm.pwn(10100) : warning 215: expression has no effect
E:\Users\ionut\Desktop\gamemode bun\gamemodes\gmm.pwn(10100) : error 001: expected token: ";", but found "]"
E:\Users\ionut\Desktop\gamemode bun\gamemodes\gmm.pwn(10100) : error 029: invalid expression, assumed zero
E:\Users\ionut\Desktop\gamemode bun\gamemodes\gmm.pwn(10100) : 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.

Link to comment
Share on other sites

te uiti la comanda /goto sa vezi cum este pdata sau playerinfo sau cum ai tu in gm, este imposibil sa nu fi gasit in gm sau sa fi vazut atata lucru :|  pdata sau playerinfo

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

Acum 2 minute, Mister a spus:

te uiti la comanda /goto sa vezi cum este pdata sau playerinfo sau cum ai tu in gm, este imposibil sa nu fi gasit in gm sau sa fi vazut atata lucru :|  pdata sau playerinfo

Scuze dar nu inteleg ce este cu goto

 

CMD:goto(playerid, params[]) {
    if(playerVariables[playerid][pAdminLevel] >= 1 || playerVariables[playerid][pHelper] >= 2) {
        new
            userID;

        if(sscanf(params, "u", userID)) {
            return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/goto [playerid]");
        }
        else if(playerVariables[playerid][pWarrants] >= 1) {
            return SendClientMessage(playerid, COLOR_GREY, "You are wanted, you can't goto to anyone.");
        }
        else if(AFK[playerid] >= 1) {
            return SendClientMessage(playerid, COLOR_GREY, "You can't goto because you are sleeping.");
        }
        else if(playerVariables[playerid][pPrisonTime] >= 1) {
            return SendClientMessage(playerid, COLOR_GREY, "You can't goto because you are in jail.");
        }
        else {
            if(!IsPlayerConnected(userID)) return SendClientMessage(playerid, COLOR_GREY, "The specified player ID is either not connected or has not authenticated.");

            new
                messageString[64],

                Float: fPos[3];

            GetPlayerPos(userID, fPos[0], fPos[1], fPos[2]);

            if(GetPlayerState(playerid) == 2) {

                SetVehiclePos(GetPlayerVehicleID(playerid), fPos[0], fPos[1]+2, fPos[2]);

                LinkVehicleToInterior(GetPlayerVehicleID(playerid), GetPlayerInterior(userID));
                SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), GetPlayerVirtualWorld(userID));
            }

            else SetPlayerPos(playerid, fPos[0], fPos[1]+2, fPos[2]);

            SetPlayerInterior(playerid, GetPlayerInterior(userID));
            SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(userID));

            GetPlayerName(userID, szPlayerName, MAX_PLAYER_NAME);

            format(messageString, sizeof(messageString), "You have teleported to %s.", szPlayerName);
            SendClientMessage(playerid, COLOR_WHITE, messageString);
            IsOnDM[playerid] = IsOnDM[userID];
            InBizz[playerid] = InBizz[userID];
            InHouse[playerid] = InHouse[userID];
            InHQ[playerid] = InHQ[userID];

        }
    }

    return 1;
}
 

Link to comment
Share on other sites

Simplu uite aici de aia ai cap sa gandesti

 

Observi ca in comanda ta este asta

if(playerVariables[playerid][pAdminLevel] >= 1

iar in comanda mea este asta

if(PlayerInfo[playerid][pAdmin] > 0)

Citesti si tu ca nu costa nimic sa gandesti si citesti

vezi ca seamana intre ele si mai si scrie acelasi lucru Padmin si pAdminLevel, ma poate trebuie facut cu asta al meu daca pe al lui nu il accepta sau da eraore

deci schimbi 

iPlayerInfo[playerid][pAdmin]

cu 

playerVariables[playerid][pAdminLevel]

Simplu si usor, dar nu va inteleg de ce va mai apucati de scripting, nu veti ajunge nicaieri, nimeni nu mai intra pe servere noi, limbajul este destul de greut si nu te ajuta cu nimic ca il stii, sunt o gramada de scripteri, si daca vedeti ca nu stiti, stati in banca voastra si jucati ca playeri sau cel putin cautati pe net ceva tutoriale

Edited by Mister

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

Acum 9 minute, Mister a spus:

Simplu uite aici de aia ai cap sa gandesti

 

Observi ca in comanda ta este asta


if(playerVariables[playerid][pAdminLevel] >= 1

iar in comanda mea este asta


if(PlayerInfo[playerid][pAdmin] > 0)

Citesti si tu ca nu costa nimic sa gandesti si citesti

vezi ca seamana intre ele si mai si scrie acelasi lucru Padmin si pAdminLevel, ma poate trebuie facut cu asta al meu daca pe al lui nu il accepta sau da eraore

deci schimbi 

iPlayerInfo[playerid][pAdmin]

cu 

playerVariables[playerid][pAdminLevel]

Simplu si usor, dar nu va inteleg de ce va mai apucati de scripting, nu veti ajunge nicaieri, nimeni nu mai intra pe servere noi, limbajul este destul de greut si nu te ajuta cu nimic ca il stii, sunt o gramada de scripteri, si daca vedeti ca nu stiti, stati in banca voastra si jucati ca playeri sau cel putin cautati pe net ceva tutoriale

Nu gasesc in comanda goto iPlayerInfo[playerid][pAdmin]

Link to comment
Share on other sites

Exact ce am spus din tot ce am scris acolo, tu nu ai gandit nimic, decat ai dat copy paste in ctrl+f la ce ti sa parut mai usor

if(PlayerInfo[playerid][pAdmin] > 0)

asta trebuie nu asta

iPlayerInfo[playerid][pAdmin]

 

ca dupa cum vezi este un i in fata, doamne....

te gandesti si tu ca e in if

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

Acum 9 minute, Mister a spus:

Exact ce am spus din tot ce am scris acolo, tu nu ai gandit nimic, decat ai dat copy paste in ctrl+f la ce ti sa parut mai usor


if(PlayerInfo[playerid][pAdmin] > 0)

asta trebuie nu asta

iPlayerInfo[playerid][pAdmin]

 

ca dupa cum vezi este un i in fata, doamne....

te gandesti si tu ca e in if

ok , dar la mine in gm nu exista asta  iPlayerInfo[playerid][pAdmin] cum sa o inlocuiesc daca nu o am :(  si chiar nu inteleg la ce te referi , eu nu vreau sa fac server de samp vreau sa invat sa fac dar nu inteleg care este legatura 

Am adaugat si asa si tot nu merge 

if(playerVariables[playerid][pAdminLevel] >= 1
Edited by marius11
Link to comment
Share on other sites

NU CAUTA  iPlayerInfo[playerid][pAdmin]

CAUTA  PlayerInfo[playerid][pAdmin]

SI INLOCUIESTE CU 

playerVariables[playerid][pAdminLevel]

UN COPIL DE 8 ANI CRED CA INTELEGEA MAI BINE

Ce atatea disctuii pentru atata lucru?

Edited by Mister
  • Upvote 1

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

Acum 2 minute, Mister a spus:

NU CAUTA  iPlayerInfo[playerid][pAdmin]

CAUTA  PlayerInfo[playerid][pAdmin]

SI INLOCUIESTE CU 

playerVariables[playerid][pAdminLevel]

UN COPIL DE 8 ANI CRED CA INTELEGEA MAI BINE

Ce atatea disctuii pentru atata lucru?

nu imi gaseste nici asta  PlayerInfo[playerid][pAdmin] o las asa mai bine oricum ms ca ai stat sa imi explici

Link to comment
Share on other sites

31 minutes ago, marius11 said:

nu imi gaseste nici asta  PlayerInfo[playerid][pAdmin] o las asa mai bine oricum ms ca ai stat sa imi explici

Băi baiatule,dacă știi ca înțelegi greu,citești printr.e rânduri și nu înțelegi nimic de ce te mai chinui cu scriptingul?

DECI:

Schimbi PlayerInfo cu playerVariables, iar apoi schimbi pAdmin cu pAdminLevel cum faci asta?

Apeși ctrl+ f de pe tastatura,(mai exact tastă din colțul de jos din partea stânga a tastaturii și tastă f..cred ca știi alfabetul) iar apoi ți se va deschide o casetă, în acea casetă scrii PlayerInfo și apeși tastă enter (tastă aia mare de pe tastatură)și faci înlocuirile care ți le.am zis mai sus ;) 

  • Upvote 1

**********************************

Servicii Scripting de calitate:

*********************************

Future Project: ExpertGame

*********************************

Link to comment
Share on other sites

Acum 1 minut, DaEdRiC-FoX a spus:

Băi baiatule,dacă știi ca înțelegi greu,citești printr.e rânduri și nu înțelegi nimic de ce te mai chinui cu scriptingul?

DECI:

Schimbi PlayerInfo cu playerVariables, iar apoi schimbi pAdmin cu pAdminLevel cum faci asta?

Apeși ctrl+ f de pe tastatura,(mai exact tastă din colțul de jos din partea stânga a tastaturii și tastă f..cred ca știi alfabetul) iar apoi ți se va deschide o casetă, în acea casetă scrii PlayerInfo și apeși tastă enter (tastă aia mare de pe tastatură)și faci înlocuirile care ți le.am zis mai sus ;) 

am rezolvat asta acum imi da la 

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.