SA-MP Forums Archive
Question about variable - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Question about variable (/showthread.php?tid=452426)



Question about variable - FishyZ - 21.07.2013

Quote:

players++;
print(players);
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
players--;
print(players);
return 1;
}

Error :
Quote:

C:\Users\bosi\Desktop\lawl\Scripting 2\gamemodes\HotPursuit.pwn(337) : error 035: argument type mismatch (argument 1)
C:\Users\bosi\Desktop\lawl\Scripting 2\gamemodes\HotPursuit.pwn(344) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.




Re: Question about variable - FishyZ - 21.07.2013

Help please


Re: Question about variable - Th3_P4dr1n0 - 21.07.2013

You missing "" in print.

print("players"); or printf("%d", players);


Re: Question about variable - Scenario - 21.07.2013

Read the mutha' fuckin' forum rules before posting. http://forum.sa-mp.com/announcement.php?f=12

Now, had you of done a little research, you would of realized that the "print" function only handles strings. Since "players" is an integer and not a string, you cannot call print(players). However, you can use printf to format a string and print the value of the integer. The poster above me gave you an example of printf already.


Re: Question about variable - FishyZ - 21.07.2013

Quote:
Originally Posted by Th3_P4dr1n0
Посмотреть сообщение
You missing "" in print.

print("players"); or printf("%d", players);
Thanks!

Now I am getting another error

Quote:

C:\Users\bosi\Desktop\lawl\Scripting 2\gamemodes\HotPursuit.pwn(7) : fatal error 100: cannot read from file: "zcmd"

My zmcd fail is here.
Quote:

C:\Users\bosi\Desktop\lawl\Scripting 2\include

And should I write #include <zcmd> or #include <zcmd.inc>


Re: Question about variable - Scenario - 21.07.2013

Search and you'll find your answer.