how i make shortcut? - 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 i make shortcut? (
/showthread.php?tid=339937)
how i make shortcut? -
TheDiscussionCafe - 05.05.2012
i am using zcmd and i want to make shortcut so when player type in "/y" (no quotes) it will say "Player Name: Yes." and when player types in /n it will say "Player Name: No."
how i can do this shortcut?
Re: how i make shortcut? -
newbienoob - 05.05.2012
Not tested.
pawn Код:
CMD:y(playerid,params[])
{
new str[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(str,sizeof(str),"%s:Yes",name);
SendClientMessageToAll(-1,str);
return 1;
}
CMD:n(playerid,params[])
{
new str[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(str,sizeof(str),"%s:No",name);
SendClientMessageToAll(-1,str);
return 1;
}
Re: how i make shortcut? -
doreto - 05.05.2012
pawn Код:
stock PlayerName(i)
{
new pname[MAX_PLAYER_NAME];
GetPlayerName(i,pname,MAX_PLAYER_NAME);
return pname;
}
pawn Код:
CMD:y(playerid,params[])
{
new y[100];
format(y,sizeof(y),"%s: Yes",PlayerName(playerid));
SendClientMessageToAll(-1,y);
return true;
}
CMD:n(playerid,params[])
{
new n[100];
format(n,sizeof(n),"%s: Yes",PlayerName(playerid));
SendClientMessageToAll(-1,n);
return true;
}
Edit:to late didnt refresh
Re: how i make shortcut? -
TheDiscussionCafe - 05.05.2012
Quote:
Originally Posted by newbienoob
Not tested.
pawn Код:
CMD:y(playerid,params[]) { new str[128], name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,sizeof(name)); format(str,sizeof(str),"%s:Yes",name); SendClientMessageToAll(-1,str); return 1; }
CMD:n(playerid,params[]) { new str[128], name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,sizeof(name)); format(str,sizeof(str),"%s:No",name); SendClientMessageToAll(-1,str); return 1; }
|
i tried this and this works. thanks you and also how i make it so player name will be in wanted level color? because wen i tested it, i join and my wanted was level 6 and when i type in /y or /n it will always show my name white.
Re: how i make shortcut? -
ReneG - 05.05.2012
Quote:
Originally Posted by TheDiscussionCafe
i tried this and this works. thanks you and also how i make it so player name will be in wanted level color? because wen i tested it, i join and my wanted was level 6 and when i type in /y or /n it will always show my name white.
|
SetPlayerColor the script doesn't do it for you...
Re: how i make shortcut? -
TheDiscussionCafe - 05.05.2012
Quote:
Originally Posted by VincentDunn
|
how i do by wanted level?