Jump to content
  • 0

Problema la %n


Iulian2

Question

12 answers to this question

Recommended Posts

  • 0

Bine, hai sa-ti arat cod-ul :
La inceput-ul gamemode ului jos de Include-uri pui asta:

static const antisqlinjection[][] = {
    "'",
    "#",
    "`",
    "%"
};

Apoi mergi la OnDialogResponse si pui asta:

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new string[700];
    new adv[MAX_PLAYER_NAME];
	for(new i; i < sizeof(antisqlinjection); i++)
    {
        if(strfind(inputtext, antisqlinjection[i], true) != -1)
        {
            GetPlayerName(playerid, adv, sizeof(adv));
			format(string,sizeof(string),"Server protected by NumeServer (Numele tau).",adv);
		    SCM(playerid, COLOR_YELLOW, string);
            return 1;
        }
	}

Daca ti-a fost de ajutor poti lasa un Like
Acel } nu este pus bine (eu l-am pus bn da systemu nu =]) il pui cu un tab mai in stanga decat penultimul

Edited by LucaAdv.
  • Thanks 2

GameMode Edited: gamemode

Servicii Scripting:

Contact:
Email: [email protected]
Discord: LucaAdv //  LHS#9084

 

Link to comment
Share on other sites

  • 0
Acum 37 minute, LucaAdv. a spus:

Bine, hai sa-ti arat cod-ul :
La inceput-ul gamemode ului jos de Include-uri pui asta:


static const antisqlinjection[][] = {
    "'",
    "#",
    "`",
    "%"
};

Apoi mergi la OnDialogResponse si pui asta:


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new string[700];
    new adv[MAX_PLAYER_NAME];
	for(new i; i < sizeof(antisqlinjection); i++)
    {
        if(strfind(inputtext, antisqlinjection[i], true) != -1)
        {
            GetPlayerName(playerid, adv, sizeof(adv));
			format(string,sizeof(string),"Server protected by NumeServer (Numele tau).",adv);
		    SCM(playerid, COLOR_YELLOW, string);
            return 1;
        }
	}

Daca ti-a fost de ajutor poti lasa un Like
Acel } nu este pus bine (eu l-am pus bn da systemu nu =]) il pui cu un tab mai in stanga decat penultimul

C:\Users\Ionut\Desktop\Bugged\gamemodes\bugged.pwn(42135) : warning 217: loose indentation
C:\Users\Ionut\Desktop\Bugged\gamemodes\bugged.pwn(42135) : error 029: invalid expression, assumed zero
C:\Users\Ionut\Desktop\Bugged\gamemodes\bugged.pwn(42135) : error 029: invalid expression, assumed zero
C:\Users\Ionut\Desktop\Bugged\gamemodes\bugged.pwn(42136) : error 001: expected token: ";", but found "new"
C:\Users\Ionut\Desktop\Bugged\gamemodes\bugged.pwn(42136) : warning 219: local variable "string" shadows a variable at a preceding level
Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.
 

Link to comment
Share on other sites

  • 0
Acum 4 minute, LucaAdv. a spus:

Da liniile?

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    new string[700];

C:\Users\Ionut\Desktop\Bugged\gamemodes\bugged.pwn(42136) : warning 217: loose indentation
C:\Users\Ionut\Desktop\Bugged\gamemodes\bugged.pwn(42136) : error 029: invalid expression, assumed zero
C:\Users\Ionut\Desktop\Bugged\gamemodes\bugged.pwn(42136) : error 029: invalid expression, assumed zero
C:\Users\Ionut\Desktop\Bugged\gamemodes\bugged.pwn(42137) : error 001: expected token: ";", but found "new"
C:\Users\Ionut\Desktop\Bugged\gamemodes\bugged.pwn(42137) : warning 217: loose indentation
C:\Users\Ionut\Desktop\Bugged\gamemodes\bugged.pwn(42137) : warning 219: local variable "string" shadows a variable at a preceding level
Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.
 

 

Edited by Iulian2
gre
Link to comment
Share on other sites

  • 0

 

Acum 1 oră, Iulian2 a spus:

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
    new string[700];

C:\Users\Ionut\Desktop\Bugged\gamemodes\bugged.pwn(42136) : warning 217: loose indentation
C:\Users\Ionut\Desktop\Bugged\gamemodes\bugged.pwn(42136) : error 029: invalid expression, assumed zero
C:\Users\Ionut\Desktop\Bugged\gamemodes\bugged.pwn(42136) : error 029: invalid expression, assumed zero
C:\Users\Ionut\Desktop\Bugged\gamemodes\bugged.pwn(42137) : error 001: expected token: ";", but found "new"
C:\Users\Ionut\Desktop\Bugged\gamemodes\bugged.pwn(42137) : warning 217: loose indentation
C:\Users\Ionut\Desktop\Bugged\gamemodes\bugged.pwn(42137) : warning 219: local variable "string" shadows a variable at a preceding level
Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.
 

 

salut, încearcă asa și nu o sa mai ai probleme adaugă asta la 

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(strlen(inputtext) >= 1) {
		if(strfind(inputtext, "%", true) != -1  || strfind(inputtext, "#", true) != -1 || strfind(inputtext, "`", true) != -1 || strfind(inputtext, "'", true) != -1) return SCM(playerid, COLOR_CLIENT, "Caractere invalide!");
      
    }
    return 1;
)

dacă ți-am fost de folos lasă și tu un mulțumesc!

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.