cmdtext, playerid - 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: cmdtext, playerid (
/showthread.php?tid=79070)
cmdtext, playerid -
user226 - 25.05.2009
How do I make that I wrote /ggg [playerid], and Playerid used SetPlayerSpecialAction
For example:
/ggg 5
and
The player with the id 5 started SetPlayerSpecialAction
Re: cmdtext, playerid -
Correlli - 25.05.2009
https://sampwiki.blast.hk/wiki/OnPlayerCommandText
https://sampwiki.blast.hk/wiki/SetPlayerSpecialAction
It's all at the Wiki.
Re: cmdtext, playerid -
MenaceX^ - 25.05.2009
pawn Код:
if(!strcmp(cmdtext,"/ggg",true))
{
new cmd[128];
cmd=strtok(cmdtext,idx);
if(!strlen(cmd)) return SendClientMessage(playerid,color,"USAGE: /ggg [number]");
SetPlayerSpecialAction(playerid,strval(cmd));
return 1;
}
Should work.
Re: cmdtext, playerid -
Weirdosport - 25.05.2009
or:
pawn Код:
dcmd_ggg(playerid, params[])
{
new id;
if (sscanf(params, "d", id)) SendClientMessage(playerid,color,"USAGE: /ggg [number]");
else SetPlayerSpecialAction(playerid,id);
return 1;
}
You'll need the DCMD define and SSCANF stock for this to work. They can both be found
here
Re: cmdtext, playerid -
member - 25.05.2009
One thing to add to MenaceX and Weirdosport's - you could have added a check to see if the ID is an invalid ID?
Re: cmdtext, playerid -
Weirdosport - 25.05.2009
Gotta let him do some of it himself, this aint' the script request thread.
Re: cmdtext, playerid -
MenaceX^ - 25.05.2009
He could make a stock, though this would take some time to check all valid/invalid animations.
Re: cmdtext, playerid -
user226 - 25.05.2009
Sorry for my bluntness
One example
pawn Код:
if (strcmp(cmd, "/ggg,true) == 0)
{
SetPlayerSpecialAction(playerid, 68);
return 1;
}
I need that I wrote "/ggg [playerid]"
and the player (playerid) has fulfilled the function command
and check whether there ID in the game
Help me please, I very need..
Re: cmdtext, playerid -
Think - 25.05.2009
Quote:
Originally Posted by kruts
Sorry for my bluntness
One example
pawn Код:
if (strcmp(cmd, "/ggg,true) == 0) { SetPlayerSpecialAction(playerid, 68); return 1; }
I need that I wrote "/ggg [playerid]"
and the player (playerid) has fulfilled the function command
and check whether there ID in the game
Help me please, I very need..
|
pawn Код:
if (strcmp(cmdtext, "/ggg,true) == 0)
{
if(cmdtext[5] == 0) {
SendClientMessage(playerid, RED, "Fill something in?");
}
if(IsPlayerConnected(cmdtext[5]) {
SetPlayerSpecialAction(cmdtext[5], 68);
}
else { SendClientMessage(playerid, RED, "Offline"); }
return 1;
}
Re: cmdtext, playerid -
member - 25.05.2009
Whilst i was typing this, Pandabeer1337 responded before me. I might as well finish off what i was doing. Use whatever one you want.
pawn Код:
if(!strcmp(cmdtext, "/ggg", true, 4))
{
if(!strlen(cmdtext[4])) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /ggg [playerid]");
new otherid = strval(cmdtext[5]);
if(!IsPlayerConnected(otherid)) return SendClientMessage(playerid, 0xFF0000AA, "That player isnt connected");
new string[128];
new adminname[MAX_PLAYER_NAME], otherguysname[MAX_PLAYER_NAME];
GetPlayerName(otherid, otherguysname, sizeof(otherguysname));
GetPlayerName(playerid, adminname, sizeof(adminname));
format(string,STR,">> Hi %s , %s has made you piss :D", otherguysname, adminname);
SendClientMessage(playerid, 0xFFFFFF00, string);
SetPlayerSpecialAction(otherid, 68);
return 1;
}