Jump to content
  • 0

Problema Includeuri Pawno in Notepad ++


BoBBiTa

Question

Problema intalnita (descriere): Salut, sa-mp.ro! Am inceput sa scriptez  in Notepad ++, problema este in felul urmator : cand pun un include sus, nu imi da eroare. Dar de exemplu, daca folosesc ZCMD, scriu CMD:lv(playerid, params[]). Imi zice ca CMD este invalid, la fel si la SSCANF.

 

Ero(area / rile) / warning-(ul / urile):

error 029: invalid expression, assumed zero
error 017: undefined symbol "cmd_kick"
error 029: invalid expression, assumed zero

fatal error 107: too many error messages on one line
Liniile de cod / sursa / script-ul(obligatoriu):

 

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success)
    {
    new szString[128];
    format(szString, sizeof(szString), "{FF0000}Eroare: {FFFFFF}Comanda {C0FF00}%s {FFFFFF}Nu exista!");
    SCM(playerid, -1, szString);
    }
    CMD:kick(playerid, params[])
    {
    new UserID, motiv[128];
    if(!IsPlayerAdmin(playerid))return SCM(playerid, -1, "Eroare! Nu esti admin!");
    if(!IsPlayerConnected(UserID)return SCM(playerid, -1, "Eroare! Player-ul nu este conectat!");
    if(sscanf(params, "us[128]", UserID, motiv))return SCM(playerid, -1, "Foloseste /kick [ userid ] [ motiv]");
    Kick(UserID);
    return 1;
    }
}

 

Imagini / Video (optional):
Ati incercat sa rezolvati singur?: Am incercat sa fac o comanda simpla cu ZCMD fara sscanf, si tot aia da.. mentionez ca sus am : #include <zcmd> si #include <sscanf2>

// Desenul meu animat 
// Alte episoade aici: 
https://www.youtube.com/channel/UCF2kY1CzhHI_PCyV5LprQ1w/videos

 

 

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Comenzile de TIP ZCMD ( CMD) nu se pun la OnPlayerCommandPerformed , le pui oriunde in gamemod dar sa nu fie intr-un public/stock etc ,

 

Un Ex :

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
  if(!success)
  {
  new szString[128];
  format(szString, sizeof(szString), "{FF0000}Eroare: {FFFFFF}Comanda {C0FF00}%s {FFFFFF}Nu exista!");
  SCM(playerid, -1, szString);
  }
}

CMD:kick(playerid, params[])
{
  new UserID, motiv[128];
  if(!IsPlayerAdmin(playerid))return SCM(playerid, -1, "Eroare! Nu esti admin!");
  if(!IsPlayerConnected(UserID)return SCM(playerid, -1, "Eroare! Player-ul nu este conectat!");
  if(sscanf(params, "us[128]", UserID, motiv))return SCM(playerid, -1, "Foloseste /kick [ userid ] [ motiv]");
  Kick(UserID);
  return 1;
}
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.