Jump to content
  • 0

Erori GM


Xtrem_Maddox

Question

Salut. M-am chinuit o gramada sa pun un GM up-to-date cu noile includes si as vrea totusi sa reusesc sa-l rulez pana la urma. Am urmatoarele erori:

 

Citat

(22101) : error 035: argument type mismatch (argument 2)
(22497) : error 035: argument type mismatch (argument 2)
(24776) : error 035: argument type mismatch (argument 2)
(24777) : error 035: argument type mismatch (argument 2)

 

Iar liniile respective sunt, in ordine, urmatoarele:

Citat

PlayAudioStreamForPlayer(playerid, url, posX, posY, posZ, distance, usepos);

ApplyAnimation(playerid, animlib, "null", 0.0, 0, 0, 0, 0, 0);

ApplyAnimation(playerid, animlib, "null", fDelta, loop, lockx, locky, freeze, time, forcesync); // Pre-load animation library
    return ApplyAnimation(playerid, animlib, animname, fDelta, loop, lockx, locky, freeze, time, forcesync);

Vreo idee ce este gresit?

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

De obicei, această eroare „argument type mismatch” înseamnă că introduci un tip de argument într-o funcție care are nevoie să primească un argument de alt tip, de ex.: vei primi această eroare, dacă introduci un integer într-o funcție care necesită un string.

 

 

  • Like 1

logo.png

sig-1-1907976

Link to comment
Share on other sites

  • 0
Citat

stock PlayStream(playerid, const url[], Float:posX = 0.0, Float:posY = 0.0, Float:posZ = 0.0, Float:distance = 50.0, usepos = 0)
{
    if(GetPVarType(playerid, "pAudioStream")) StopAudioStreamForPlayer(playerid);
    else SetPVarInt(playerid, "pAudioStream", 1);
    PlayAudioStreamForPlayer(playerid, url, posX, posY, posZ, distance, usepos);
}

Citat

PreloadAnimLib(playerid, const animlib[])
{
    ApplyAnimation(playerid, animlib, "null", 0.0, 0, 0, 0, 0, 0);
}

Citat

stock ApplyPlayerAnimation(playerid, const animlib[], const animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync = 0)
{
    ApplyAnimation(playerid, animlib, "null", fDelta, loop, lockx, locky, freeze, time, forcesync); // Pre-load animation library
    return ApplyAnimation(playerid, animlib, animname, fDelta, loop, lockx, locky, freeze, time, forcesync);
}

Acestea sunt liniile full, in caz ca imi poate indica cineva ce as putea schimba in ele incat sa se compileze cum trebuie.

Acum 5 ore, matei_ a spus:

De obicei, această eroare „argument type mismatch” înseamnă că introduci un tip de argument într-o funcție care are nevoie să primească un argument de alt tip, de ex.: vei primi această eroare, dacă introduci un integer într-o funcție care necesită un string.

 

 

Am mai vazut raspunsul acesta pe alt site, doar ca in engleza. Cu toate acestea, nu am nicio idee ce as putea schimba in linii ca sa fie treaba buna.

Edited by Xtrem_Maddox
Link to comment
Share on other sites

  • 0

Am găsit funcțiile pe care le folosești într-un vechi gamemode-ul de-al meu, tot ceea ce trebuia să faci era să ștergi „const”:

stock PlayStream(playerid, url[], Float:posX = 0.0, Float:posY = 0.0, Float:posZ = 0.0, Float:distance = 50.0, usepos = 0)
{
    if(GetPVarType(playerid, "pAudioStream")) StopAudioStreamForPlayer(playerid);
    else SetPVarInt(playerid, "pAudioStream", 1);
    PlayAudioStreamForPlayer(playerid, url, posX, posY, posZ, distance, usepos);
}
stock ApplyPlayerAnimation(playerid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync = 0)
{
    ApplyAnimation(playerid, animlib, "null", fDelta, loop, lockx, locky, freeze, time, forcesync); // Pre-load animation library
    return ApplyAnimation(playerid, animlib, animname, fDelta, loop, lockx, locky, freeze, time, forcesync);
}
PreloadAnimLib(playerid, animlib[]) return ApplyAnimation(playerid, animlib, "null", 0.0, 0, 0, 0, 0, 0, 0);

logo.png

sig-1-1907976

Link to comment
Share on other sites

  • 0
Acum 10 ore, matei_ a spus:

Am găsit funcțiile pe care le folosești într-un vechi gamemode-ul de-al meu, tot ceea ce trebuia să faci era să ștergi „const”:

stock PlayStream(playerid, url[], Float:posX = 0.0, Float:posY = 0.0, Float:posZ = 0.0, Float:distance = 50.0, usepos = 0)
{
    if(GetPVarType(playerid, "pAudioStream")) StopAudioStreamForPlayer(playerid);
    else SetPVarInt(playerid, "pAudioStream", 1);
    PlayAudioStreamForPlayer(playerid, url, posX, posY, posZ, distance, usepos);
}
stock ApplyPlayerAnimation(playerid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync = 0)
{
    ApplyAnimation(playerid, animlib, "null", fDelta, loop, lockx, locky, freeze, time, forcesync); // Pre-load animation library
    return ApplyAnimation(playerid, animlib, animname, fDelta, loop, lockx, locky, freeze, time, forcesync);
}
PreloadAnimLib(playerid, animlib[]) return ApplyAnimation(playerid, animlib, "null", 0.0, 0, 0, 0, 0, 0, 0);

Iti multumesc frumos, asta a rezolvat cele 4 erori. Acum insa primesc "Pawn Compiler library has stopped working" si imi da 2 warninguri:

Citat

warning 201: redefinition of constant/macro (symbol "SCM")
warning 203: symbol is never used: "YSI_MAYBE_HEAP_MALLOC"

Banuiesc ca stopped working da fiindca ar fi pe undeva prin script o paranteza care nu a fost inchisa/deschisa pe cealalta parte? Daca e asa, ma dau batut, scriptul e prea mare sa pot gasi asa ceva. Ciudat e ca developer-ul a spus ca n-ar trebui sa afiseze absolut niciun warning sau eroare.

Link to comment
Share on other sites

  • 0
Acum 1 minut, Xtrem_Maddox a spus:

Iti multumesc frumos, asta a rezolvat cele 4 erori. Acum insa primesc "Pawn Compiler library has stopped working" si imi da 2 warninguri:

Banuiesc ca stopped working da fiindca ar fi pe undeva prin script o paranteza care nu a fost inchisa/deschisa pe cealalta parte? Daca e asa, ma dau batut, scriptul e prea mare sa pot gasi asa ceva. Ciudat e ca developer-ul a spus ca n-ar trebui sa afiseze absolut niciun warning sau eroare.

Pentru primul warning, adauga:

#define SCM SendClientMessage

Pentru al doilea warning, adauga:

#define YSI_MAYBE_HEALP_MALLOC

Acestea doua le adaugi undeva langa celelalte definitii.

 

Iar compiler-ul iti da crash, datorita unei paranteze uitate.

logo.png

sig-1-1907976

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.

  • Similar Content

    • By R4zvyy
      C:\Users\R4zvyy\Desktop\moon-times (noua)\pawno\include\YSI\y_hooks.inc(64) : fatal error 111: user error: Did you do <YSI/y_hooks> instead of the required <YSI\y_hooks>?
      Compilation aborted.
      Pawn compiler 3.10.8              Copyright (c) 1997-2006, ITB CompuPhase

      1 Error.
      ===========
      #include        <YSI\y_hooks>
      #include         <YSI\y_iterate>
      #include        <YSI\y_stringhash>
      #include         <YSI\y_commands>
      #include         <YSI\y_master>
      #include         <YSI\y_timers>
    • By GamerulFOX
      Salut ! Cine ma poate ajuta cu erorile astea ? am folosit acest tutorial 

    • By BaDB0y95
      Am si eu aceste erori si se da crash pe server 
       
      [12:02:08] [debug] Run time error 4: "Array index out of bounds"
      [12:02:08] [debug]  Accessing element at negative index -1
      [12:02:08] [debug] AMX backtrace:
      [12:02:08] [debug] #0 001bf4f4 in public OnPlayerKeyStateChange (0, 65536, 0) from gamemode.amx
      [12:02:12] [debug] Run time error 4: "Array index out of bounds"
      [12:02:12] [debug]  Accessing element at negative index -1
      [12:02:12] [debug] AMX backtrace:
       
    • By Alexandru Mihalescu
      Primesc eroriile aste dintr-un fisier YSI, am intrat in fisierul ala si nu stiu exact ce sa ii fac...

    • By CyberNeticK
      salut, sunt nou in scripting cum credeti ca as putea sa rezolv eroare asta fratilor 
       
      C:\Users\crist\Desktop\New folder\gamemodes\fox.pwn(3379) : error 017: undefined symbol "PlayerInfo"
      C:\Users\crist\Desktop\New folder\gamemodes\fox.pwn(3379) : error 029: invalid expression, assumed zero
      C:\Users\crist\Desktop\New folder\gamemodes\fox.pwn(3379) : warning 215: expression has no effect
      C:\Users\crist\Desktop\New folder\gamemodes\fox.pwn(3379) : error 001: expected token: ";", but found "]"
      C:\Users\crist\Desktop\New folder\gamemodes\fox.pwn(3379) : 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.
       
      iar linia 3379 este asta : if(PlayerInfo[playerid][pCarVipColors][idcar] == 0) format(string, sizeof(string), "{FFFFFF}%s", CarVipName[playerid][idcar]);
       
      asa arata intregul script: 
      public SetVipText(playerid, idcar)
      {
          new string[128];
          if(strlen(CarVipName[playerid][idcar]) > 0)
          {
              if(PlayerInfo[playerid][pCarVipColors][idcar] == 0) format(string, sizeof(string), "{FFFFFF}%s", CarVipName[playerid][idcar]);
              else if(PlayerInfo[playerid][pCarVipColors][idcar] == 1) format(string, sizeof(string), "{FF0000}%s", CarVipName[playerid][idcar]);
              else if(PlayerInfo[playerid][pCarVipColors][idcar] == 2) format(string, sizeof(string), "{640000}%s", CarVipName[playerid][idcar]);
              else if(PlayerInfo[playerid][pCarVipColors][idcar] == 3) format(string, sizeof(string), "{00FF00}%s", CarVipName[playerid][idcar]);
              else if(PlayerInfo[playerid][pCarVipColors][idcar] == 4) format(string, sizeof(string), "{004B01}%s", CarVipName[playerid][idcar]);
              else if(PlayerInfo[playerid][pCarVipColors][idcar] == 5) format(string, sizeof(string), "{008DFF}%s", CarVipName[playerid][idcar]);
              else if(PlayerInfo[playerid][pCarVipColors][idcar] == 6) format(string, sizeof(string), "{001AFF}%s", CarVipName[playerid][idcar]);
              else if(PlayerInfo[playerid][pCarVipColors][idcar] == 7) format(string, sizeof(string), "{FFFF00}%s", CarVipName[playerid][idcar]);
              else if(PlayerInfo[playerid][pCarVipColors][idcar] == 😎 format(string, sizeof(string), "{FF6B00}%s", CarVipName[playerid][idcar]);
              else if(PlayerInfo[playerid][pCarVipColors][idcar] == 9) format(string, sizeof(string), "{EB00FF}%s", CarVipName[playerid][idcar]);
              else if(PlayerInfo[playerid][pCarVipColors][idcar] == 10) format(string, sizeof(string), "{590056}%s", CarVipName[playerid][idcar]);
              else if(PlayerInfo[playerid][pCarVipColors][idcar] == 11) format(string, sizeof(string), "{8A8A8A}%s", CarVipName[playerid][idcar]);
              else if(PlayerInfo[playerid][pCarVipColors][idcar] == 12) format(string, sizeof(string), "{000000}%s", CarVipName[playerid][idcar]); //=
              else if(PlayerInfo[playerid][pCarVipColors][idcar] == 13) format(string, sizeof(string), "{28B2E0}%s", CarVipName[playerid][idcar]); //--- Adaugate de DrooM!
              else if(PlayerInfo[playerid][pCarVipColors][idcar] == 14) format(string, sizeof(string), "{F20C9A}%s", CarVipName[playerid][idcar]); //=
              DestroyObject(vObject[PlayerInfo[playerid][pCarID][idcar]]);
              vObject[PlayerInfo[playerid][pCarID][idcar]] = CreateObject(19327,0,0,-1000,0,0,0,100);
              SetObjectMaterialText(vObject[PlayerInfo[playerid][pCarID][idcar]], string, 0, OBJECT_MATERIAL_SIZE_256x128, "Comic Sans MS", 18, 1, 0xFFFFFFFF, 0, 1);
              if(PlayerInfo[playerid][pCarModel][idcar] == 411) AttachObjectToVehicle(vObject[PlayerInfo[playerid][pCarID][idcar]], PlayerInfo[playerid][pCarID][idcar], -0.029999, -1.974998, 0.233999, -84.824964, 0.000000, 0.000000);
              else if(PlayerInfo[playerid][pCarModel][idcar] == 541) AttachObjectToVehicle(vObject[PlayerInfo[playerid][pCarID][idcar]], PlayerInfo[playerid][pCarID][idcar], 0.000000, -1.649998, 0.390999, -76.379989, 0.000000, 0.000000);
              else if(PlayerInfo[playerid][pCarModel][idcar] == 560) AttachObjectToVehicle(vObject[PlayerInfo[playerid][pCarID][idcar]], PlayerInfo[playerid][pCarID][idcar], 0.000000, -0.614999, 0.799999, -88.439956, 0.000000, 0.000000);
              else if(PlayerInfo[playerid][pCarModel][idcar] == 451) AttachObjectToVehicle(vObject[PlayerInfo[playerid][pCarID][idcar]], PlayerInfo[playerid][pCarID][idcar], 0.000000, -0.6, 0.56, 270.0, 0.0, 0.0);
              else if(PlayerInfo[playerid][pCarModel][idcar] == 480) AttachObjectToVehicle(vObject[PlayerInfo[playerid][pCarID][idcar]], PlayerInfo[playerid][pCarID][idcar], 0.000000, -1.58, 0.27, 270.0, 0.0, 0.0);
          }
          return 1;
      }
       
  • 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.