SA-MP Forums Archive
My script got crazy - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: My script got crazy (/showthread.php?tid=243180)



My script got crazy - bijoyekuza - 21.03.2011

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 ?


Re: My script got crazy - xir - 21.03.2011

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;
}



Re: My script got crazy - bijoyekuza - 21.03.2011

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 ?



Re: My script got crazy - xir - 21.03.2011

Do you have strcmp cmds in your GM?


Re: My script got crazy - bijoyekuza - 21.03.2011

yes i do


Re: My script got crazy - xir - 21.03.2011

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

You will need to convert all your cmds to zcmd


Re: My script got crazy - bijoyekuza - 21.03.2011

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


Re: My script got crazy - xir - 21.03.2011

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


Re: My script got crazy - -Rebel Son- - 21.03.2011

Converting them one command at a time, :P


Re: My script got crazy - bijoyekuza - 22.03.2011

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