How to make this into a 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: How to make this into a command? (
/showthread.php?tid=452971)
How to make this into a command? -
Grooty - 23.07.2013
I want the command to be "/i"
Код:
if(TalkingLive[playerid] != INVALID_PLAYER_ID) {
if(PlayerInfo[playerid][pFaction] == 9 || PlayerInfo[playerid][pLeader] == 9) {
format(string, sizeof(string), "Live News Reporter %s: %s", GetPlayerNameEx(playerid), text);
ICNews(COLOR_LIGHTGREEN,string);
} else {
format(string, sizeof(string), "Live Interview Guest %s: %s", GetPlayerNameEx(playerid), text);
ICNews(COLOR_LIGHTGREEN,string);
}
return 0;
}
Re: How to make this into a command? -
JimmyCh - 23.07.2013
Just making this a command?
pawn Код:
// With ZCMD: (( #include <zcmd> ))
CMD:i(playerid, params[])
{
if(TalkingLive[playerid] != INVALID_PLAYER_ID)
{
if(PlayerInfo[playerid][pFaction] == 9 || PlayerInfo[playerid][pLeader] == 9)
{
format(string, sizeof(string), "Live News Reporter %s: %s", GetPlayerNameEx(playerid), text);
ICNews(COLOR_LIGHTGREEN,string);
}
else
{
format(string, sizeof(string), "Live Interview Guest %s: %s", GetPlayerNameEx(playerid), text);
ICNews(COLOR_LIGHTGREEN,string);
}
return 0;
}
return 1;
}
Re: How to make this into a command? -
Grooty - 23.07.2013
Quote:
Originally Posted by JimmyCh
Just making this a command?
pawn Код:
// With ZCMD: (( #include <zcmd> )) CMD:i(playerid, params[]) { if(TalkingLive[playerid] != INVALID_PLAYER_ID) { if(PlayerInfo[playerid][pFaction] == 9 || PlayerInfo[playerid][pLeader] == 9) { format(string, sizeof(string), "Live News Reporter %s: %s", GetPlayerNameEx(playerid), text); ICNews(COLOR_LIGHTGREEN,string); } else { format(string, sizeof(string), "Live Interview Guest %s: %s", GetPlayerNameEx(playerid), text); ICNews(COLOR_LIGHTGREEN,string); } return 0; } return 1; }
|
Thanks!