Scripting Error(s)
#1

Hello, I am know a little bit scripting, and I was making a /commands command, but I keep getting this:

C:\Program Files (x86)\Rockstar Games\GTA San Andreas\pawno\Biohazard Death Match.pwn(202) : warning 217: loose indentation
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\pawno\Biohazard Death Match.pwn(206) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.


This is my script:

pawn Код:
}
    if (strcmp("/Commands", cmdtext, true, 10) == 0)

       SendClientMessage(playerid,0x33AA33AA,"/Teles");
       SendClientMessage(playerid,0x33AA33AA,"/Admins");
       SendClientMessage(playerid,0x33AA33AA,"/Credits");
       SendClientMessage(playerid,0x33AA33AA,"/Rules");
}
    return 1;
}
Can you guys help me? I have no idea what the fault is, I've checked everything.
Reply
#2

You need to align your code, such as
Код:
        if (strcmp("/Commands", cmdtext, true, 10) == 0)
	{
		SendClientMessage(playerid,0x33AA33AA,"/Teles");
		SendClientMessage(playerid,0x33AA33AA,"/Admins");
		SendClientMessage(playerid,0x33AA33AA,"/Credits");
		SendClientMessage(playerid,0x33AA33AA,"/Rules");
	}
	return 1;
Reply
#3

Thanks alot, Rep'd
Reply
#4

(Sorry for the double post)

I was looking for a few admin commands, (/kick /ban /mute etc) but I am not using sscanf or anything like that, Am I still able to create an admin command without them? if yes, How?
Reply
#5

Yes, but for these powerful commands, ZCMD is untouchable and still the best...Download ZCMD + sscanf 2 and you'll be able to script those commands in 5 minutes, it's really fast 'n easy!

For your command above your post:

This is not right, even though you don't get any errors:
pawn Код:
if (strcmp("/Commands", cmdtext, true, 10) == 0)
It's 9 characters long, and I wouldn't start with a big letter, try this:

pawn Код:
if (strcmp("/commands", cmdtext, true, 9) == 0)
Reply
#6

Alright, Thanks

about the ZCMD Sscanf 2, I really have no idea to use it, I just spotted ****** hes sscanf 2 release, and I've read the introduction, but I don't understand any word he said, lol.
Reply
#7

Simply search for some ZCMD-sscanf2 tutorials, there you'll understand way more! For the commands you need, just check out my tutorial in my signature!
Reply
#8

You may help me with the download link? I am abit scary with download links, I am not fan of them lol.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)