some help - 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: some help (
/showthread.php?tid=378824)
some help -
adelmika - 19.09.2012
Hello iwant to start With add cmds it's Easy just want to know how so
can some one help me on it ineed to add /me and /do and /n (Newibe)
Re: some help -
gtakillerIV - 19.09.2012
These tutorials will help you :-
https://sampforum.blast.hk/showthread.php?tid=319000
https://sampforum.blast.hk/showthread.php?tid=348307
You will need ZCMD(These tutorials will help you learn the basics)
* gtakillerIV Command using ZCMD:-
Код:
CMD:me(playerid, params[])
{
new sendername[MAX_PLAYER_NAME], string[56];
GetPlayerName(playerid, sendername, sizeof(sendername));
if(isnull(params)) return SendClientMessage(playerid, 0xFFFFFFF,"Syntax error.Correct usage: /me [text]");
format(string, sizeof(string), "%s %s", sendername, params);
SendClientMessageToAll(Yellow, string);
return 1;
}
Re: some help -
Badr_Hari - 19.09.2012
Yeah just this gtakillerIV said...
Re: some help -
BlueGames - 19.09.2012
* BlueGames CMD ...
PHP код:
if(strcmp(cmd, "/me", true)==0){
if(PlayerTemp[playerid][muted]==0){
new tmp[256];
tmp = strrest(cmdtext,idx);
if(!strlen(tmp)){
SendClientUsage(playerid, cmd, "[msg]");
return 1;
}
if(FindIP(tmp))
{
KickReas("[SERVER]",playerid,"Attempting to advertise IP's!");
return 1;
}
else{
new mestr[256],sender[MAX_STRING];
if(PlayerTemp[playerid][hname]==1) myStrcpy(sender,"Stranger");
else myStrcpy(sender,NameEx(playerid));
format(mestr,sizeof(mestr),"%s %s",sender,tmp);
SetPlayerChatBubble(playerid, mestr, COLOR_ME2, 100.0, 10000);
NearMessage(playerid,mestr,COLOR_ME2);
return 1;
}
}
else
{
SendClientError(playerid,"You have been muted");
}
return 1;
}
/do CMD ...
PHP код:
if(strcmp(cmd, "/do", true)==0){
if(PlayerTemp[playerid][muted]==0){
new tmp[256];
tmp = strrest(cmdtext,idx);
if(!strlen(tmp)){
SendClientUsage(playerid, cmd, "[msg]");
return 1;
}
if(FindIP(tmp))
{
KickReas("[SERVER]",playerid,"Attempting to advertise IP's!");
return 1;
}
else{
new mestr[256],sender[MAX_STRING];
if(PlayerTemp[playerid][hname]==1) myStrcpy(sender,"Stranger");
else myStrcpy(sender,NameEx(playerid));
format(mestr,sizeof(mestr),"((%s)) %s",sender,tmp);
SetPlayerChatBubble(playerid, mestr, COLOR_ME2, 100.0, 10000);
NearMessage(playerid,mestr,COLOR_ME2);
return 1;
}
}
else
{
SendClientError(playerid,"You have been muted");
}
return 1;
}
Next time use wiki or something.