2 strings in 1 command. - 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)
+--- Thread: 2 strings in 1 command. (
/showthread.php?tid=535909)
2 strings in 1 command. -
Krakuski - 06.09.2014
Howdy, I'd like to know if it is possible doing 2 strings in one command. If you don't know what I'm talkin' about, this is what I mean:
/command [id] [string1] [string2]
Then it would pop out like this for the other player (2 different lines):
[string1]
[string2]
If anyone knows, please help me out, Thanks!
Re: 2 strings in 1 command. -
AlTy - 06.09.2014
pawn Код:
CMD:bla(playerid, params[])
{
new id, string1[128],string2[128];
if(PlayerInfo [playerid][pAdmin] < 1)return SendClientMessage(playerid, COLOR_WHITE, "You need to be an admin lvl 3 to use that command!");
else if(sscanf(params, "uss", id, string1,string2))SendClientMessage(playerid, COLOR_WHITE, "Usage: /bla [id/name][string1][string2]");
else if (id==INVALID_PLAYER_ID)SendClientMessage(playerid,COLOR_WHITE,"Error: Player is not connected!");
else {
SendClientMessage(id,-1, string1);
SendClientMessage(id,-1, string2);
}
return 1;
}
not tested, probably works