Jump to content

Question

Posted

Salut, am vazut pe internet 2 moduri pentru a scrie un foreach si sunt curios ce diferente sunt (daca sunt) intre foreach(Player, i) si foreach(new i : Player) inafara de modul de scriere, desigur.

Recommended Posts

  • 0
Posted
5 minutes ago, irinel77 said:

Pur si simplu faci 2 foldere numite fixes si temp in folderul scriptfiles.

Multumesc.

La OnPlayerCommandPerformed nu imi arata mesajul cu unknown command cand scriu o comanda care nu exista, aveti idee de ce? Am mai cautat solutii pe internet dar la toate e la fel

public e_COMMAND_ERRORS:OnPlayerCommandPerformed(playerid, cmdtext[], e_COMMAND_ERRORS:success) {
    //antispam
    if(aspam[playerid] == 0 && PlayerInfo[playerid][pAdmin] < 😎
    aspam[playerid] = 1;
    //antispam
    if(success == COMMAND_OK) {
        SpamCheck[playerid] = GetTickCount();
        return COMMAND_OK;
    }
    SCMM(playerid, COLOR_GREY, "Error: Unknown command!");
    return COMMAND_OK;
}

  • 0
Posted
6 minutes ago, Banditul said:

https://github.com/pawn-lang/YSI-Includes/issues/5#issuecomment-96043340

Aparent pentru verificarea aia ai nevoie de OnPlayerCommandReceived nu de OnPlayerCommandPerformed pentru ca daca comanda e invalida e imposibil sa fie executata

if(success == COMMAND_OK) SpamCheck[playerid] = GetTickCount();
if(success == COMMAND_UNDEFINED) {SCMM(playerid, COLOR_GREY, "Error: Unknown command!"); return COMMAND_ZERO_RET;}

Am pus asa la OnPlayerCommandReceived, indiferent de ce comanda introduc imi scrie mesajul default, SERVER: Unknown command. (nu cel pe care il am eu)

  • 0
Posted
public e_COMMAND_ERRORS:OnPlayerCommandReceived(playerid, cmdtext[], e_COMMAND_ERRORS:success) 
{
         if(success == COMMAND_UNDEFINED) 
		{
                   SCMM(playerid, COLOR_GREY, "Error: Unknown command!"); 
                   return COMMAND_OK;
         }
         return COMMAND_OK;
}

Incearca asa

  • 0
Posted

Daca nu sunt logat cu pin daca dau o comanda care nu exista imi arata bine, daca scriu de ex /a imi scrie sintaxa comenzii, dar ar trebui sa imi dea mesajul de aici

if(strlen(PlayerInfo[playerid][pPin]) != 0 && PlayerInfo[playerid][pPinLogged] == 0) { SCMM(playerid, -1, "{FF6347}[PIN] {FFFFFF}You can not use commands because you did not enter a valid PIN!"); return COMMAND_OK; }

Cu ok merge bine daca nu exista comanda, daca pun in loc de COMMAND_OK pun COMMAND_ZERO_RET indiferent daca comanda exista sau nu primesc mesajul default, 

SERVER: Unknown command

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.