C:\Users\James\Desktop\Server\gamemodes\gm.pwn(566 4) : error 017: undefined symbol "SkinOffSet" C:\Users\James\Desktop\Server\gamemodes\gm.pwn(566 4) : warning 215: expression has no effect C:\Users\James\Desktop\Server\gamemodes\gm.pwn(566 4) : error 001: expected token: ";", but found "]" C:\Users\James\Desktop\Server\gamemodes\gm.pwn(566 4) : error 029: invalid expression, assumed zero C:\Users\James\Desktop\Server\gamemodes\gm.pwn(566 4) : fatal error 107: too many error messages on one |
SetPlayerAttachedObject(playerid, slot, beret, 2, SkinOffSet[skin][0], SkinOffSet[skin][1], SkinOffSet[skin][2], SkinOffSet[skin][3], SkinOffSet[skin][4], SkinOffSet[skin][5]);
function PutHatOn(playerid)
{
new skin, id = random(13), beret, slot = GetEmptySlot(playerid), count;
skin = (GetPlayerSkin(playerid) - 1);
PInfo[playerid][oslothat] = slot;
switch(id)
{
case 1: beret = 18926;
case 2..10: beret = 18926 + id;
case 11: beret = 19099;
case 12: beret = 18964;//19098
}
do
{
if(skin == invalidskins[count]) return SendClientMessage(playerid, red, "» "cyellow"Your skin does not support a hat.");
count++;
}
while(count < sizeof invalidskins);
if(skin < 0) skin = 0;
SetPlayerAttachedObject(playerid, slot, beret, 2, SkinOffSet[skin][0], SkinOffSet[skin][1], SkinOffSet[skin][2], SkinOffSet[skin][3], SkinOffSet[skin][4], SkinOffSet[skin][5]);
return 1;
}
I have this included:
[QUOTE]#include <Hatsoffset>[/QUOTE]
In the include I have this:
[url]http://pastebin.com/TRbTPCey[/url]
https://sampforum.blast.hk/showthread.php?tid=289258
Pages 34 and 63. Also, I love re-reading pawn-lang.pdf, there's always something I didn't know! I just found out about state variables which have no default value! |
Did you go by PDF page number or document page number? The latter essentially starts at -1.
|
Originally Posted by 34
Notice how the two global variables stack and stackidx are declared as "static" variables; using the keyword static instead of new. Doing this makes the global variables "visible" in that file only. For all other files in a larger project, the symbols stack and stackidx are invisible and they cannot (accidentally) modify the variables. It also allows the other modules to declare their own private variables with these names, so it avoids name clashing.
|
Originally Posted by 63
Static global declarations
A static global variable behaves the same as a normal global variable, except that its scope is restricted to the file that the declaration resides in. To declare a global variable as static, replace the keyword new by static. |
I just noticed that I always used the version of 2007 from pawn-lang.pdf ^^"
Also to speed this up ![]() |