Jump to content
  • 0

Problema compilare.


KiNGzOR

Question

Update(playerid, pCashx);


C:\Users\Adrian-Bianca PC\Desktop\samp03\filterscripts\vacar.pwn(987) : error 012: invalid function call, not a valid address
C:\Users\Adrian-Bianca PC\Desktop\samp03\filterscripts\vacar.pwn(987) : warning 215: expression has no effect
C:\Users\Adrian-Bianca PC\Desktop\samp03\filterscripts\vacar.pwn(987) : warning 215: expression has no effect
C:\Users\Adrian-Bianca PC\Desktop\samp03\filterscripts\vacar.pwn(987) : error 001: expected token: ";", but found ")"
C:\Users\Adrian-Bianca PC\Desktop\samp03\filterscripts\vacar.pwn(987) : error 029: invalid expression, assumed zero
C:\Users\Adrian-Bianca PC\Desktop\samp03\filterscripts\vacar.pwn(987) : 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

4 answers to this question

Recommended Posts

  • 0

Asta e problema, acel Update nu e o variabila este o functie

Update(playerid, int)
{
	//Ce face functia
}

Dar e posibil sa nu functioneze cum te astepti daca o vei lua din gm si o vei pune in filterscript

2 posibilitati:

1. Implementezi filterscriptu in gm

2. Folosesti https://wiki.sa-mp.com/wiki/CallRemoteFunction pentru a chema functia din GM si ii pasezi argumentele necesare (asta daca functia din gm Update este de tip public)

Doar ca vei avea o problema, chiar daca vei face asta banii dati in filterscript nu sunt pasati in gm deci in concluzie nu se vor actualiza

 

Cea mai simpla solutie este de a crea tu query de a actualiza banii in baza de date

new query[144];
mysql_format(SQL, query, sizeof(query), "UPDATE users SET money = money + %i WHERE playername = '%s'", money, name);
mysql_tquery(SQL, query);

Doar ca ramane o problema, playerul nu va avea banii respectivi la el pana la relog. Ce poti face este sa te duci in GM sa faci functia GivePlayerCash public

forward GivePlayerCash(playerid, cash);
public GivePlayerCash(playerid, cash)
{
	//ce face functia GivePlayerCash in gm
}

Si sa o chemi din filterscript cu CallRemoteFunction

CallRemoteFunction("GivePlayerCash", "ii", playerid, money);

 

Link to comment
Share on other sites

  • 0
14 minutes ago, Banditul said:

Asta e problema, acel Update nu e o variabila este o functie

Update(playerid, int)
{
	//Ce face functia
}

Dar e posibil sa nu functioneze cum te astepti daca o vei lua din gm si o vei pune in filterscript

2 posibilitati:

1. Implementezi filterscriptu in gm

2. Folosesti https://wiki.sa-mp.com/wiki/CallRemoteFunction pentru a chema functia din GM si ii pasezi argumentele necesare (asta daca functia din gm Update este de tip public)

Doar ca vei avea o problema, chiar daca vei face asta banii dati in filterscript nu sunt pasati in gm deci in concluzie nu se vor actualiza

 

Cea mai simpla solutie este de a crea tu query de a actualiza banii in baza de date

new query[144];
mysql_format(SQL, query, sizeof(query), "UPDATE users SET money = money + %i WHERE playername = '%s'", money, name);
mysql_tquery(SQL, query);

Doar ca ramane o problema, playerul nu va avea banii respectivi la el pana la relog. Ce poti face este sa te duci in GM sa faci functia GivePlayerCash public

forward GivePlayerCash(playerid, cash);
public GivePlayerCash(playerid, cash)
{
	//ce face functia GivePlayerCash in gm
}

Si sa o chemi din filterscript cu CallRemoteFunction

CallRemoteFunction("GivePlayerCash", "ii", playerid, money);

 

Nu stiu sa fac asta,ma poti ajuta? Daca da,ai discord?

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.