/cmd [playerid/playername] - 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: /cmd [playerid/playername] (
/showthread.php?tid=74210)
/cmd [playerid/playername] -
Outbreak - 20.04.2009
Hey,
How can i make a command that will either use a players id, or their name?
I want both to do totally different things, so if its /cmd [playerid] i would do something different to /cmd [playername]
But the same command..
So it would need to heck if i input playerid, then do what i want it to do,
or if its playername do something different that i want it to do...
Could someone tell me how its done.... not a great explanation i know, as im in a bit of a hurry...
Thanks.
Re: /cmd [playerid/playername] -
Rks25 - 20.04.2009
You need the functions IsNumeric and ReturnUser. And than just check if they wrote name(ReturnUser) or a number(IsNumeric).
Re: /cmd [playerid/playername] -
Daren_Jacobson - 20.04.2009
use sscanf (you don't have to use dcmd if you don't want)