My script got crazy
#1

okey scripters
so Im starting to learn zcmd and sscanf
and I got this command
Код:
	COMMAND:b2(playerid, params[])
	{
		if(PlayerInfo[playerid][pAdminLevel] > 1)
		{
		    new id;
		    if(sscanf(params,"u",id))
			{
			    if(IsPlayerConnected(id))
			    {
			    	SendClientMessage(id, 0x0259EAAA, "hey");
			    	return 1;
			    }
			    else return SendClientMessage(playerid, 0x0259EAAA, "Player is not connected");
			}
			else return SendClientMessage(playerid, 0x0259EAAA, "USAGE: /b2 [PlayerId/PartOfName]");
		}
		else return SendClientMessage(playerid, 0x0259EAAA, "You are not admin");
	}
okey so when i use /b2 it doesnt return me SendClientMessage(playerid,blablablalbl)
it returns me SendClientMessage(id, 0x0259EAAA, "hey");
okey
and not only that it doesnt work
because of this stupid thing
all of the commands in my server arent working !
why ?
Reply
#2

Try this

pawn Код:
COMMAND:b2(playerid, params[])
{
    if(PlayerInfo[playerid][pAdminLevel] < 1) return SendClientMessage(playerid, 0x0259EAAA, "You are not admin");
    new id;
    if(sscanf(params,"u",id)) return SendClientMessage(playerid, 0x0259EAAA, "USAGE: /b2 [PlayerId/PartOfName]");
    if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0x0259EAAA, "Player is not connected");
    {
        SendClientMessage(id, 0x0259EAAA, "hey");
    }
    return 1;
}
Reply
#3

I got the problem. The problem is with the include . when i remove the #include <zcmd> from my script everything is okey.
maybe its some old include ? Cuz I took it from ravens roleplay(the old one)
If so , can I have the new one ?
Reply
#4

Do you have strcmp cmds in your GM?
Reply
#5

yes i do
Reply
#6

Then it wont work. (At least it didnt for me)

You will need to convert all your cmds to zcmd
Reply
#7

omg
I got more then 45 command there
how can I do this ? I really mean how do I convert them ?
Reply
#8

Here are some nice tutorials

https://sampforum.blast.hk/showthread.php?tid=176372
https://sampforum.blast.hk/showthread.php?tid=225746
https://sampforum.blast.hk/showthread.php?tid=206237

Good luck to you
Reply
#9

Converting them one command at a time, :P
Reply
#10

omg
maybe I can just make an filterscript for zcmd commands and at the self GM I will use strcmp?will it work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)