SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 29/12/2011, 11:14 PM   #11
Fj0rtizFredde
Gangsta
 
Fj0rtizFredde's Avatar
 
Join Date: Jun 2008
Location: Sweden
Posts: 888
Reputation: 120
Default Re: /changename /clearchat cmds

Quote:
Originally Posted by Notis123 View Post
OMFG then every play would change another player name without being admin duuuuuuuuuh
Mastermids those days
No he want it for admins only as Normal people do.
I know a few server's that allows every player to change their name thats why I'm asking.

pawn Code:
CMD:changename(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"You are not an admin!");
    new pID, pOldName[MAX_PLAYER_NAME], pNewName[MAX_PLAYER_NAME], string[128];
    if(sscanf(params, "us[24]", pID, pNewName)) return SendClientMessage(playerid,-1, "Usage: /changename ID NewName");
    GetPlayerName(pID,pOldName,sizeof(pOldName));
    SetPlayerName(pID,pNewName);
    format(string, sizeof(string), "You have set %s(%d) name to: %s", pOldName, pID, pNewName);
    SendClientMessage(playerid, -1, string);
    return 1;
}
Notice: The code above is not tested but it should work.
__________________
Latest crap I've made:
[Include]CleverBot - Never Be Alone Again!
Fj0rtizFredde is offline   Reply With Quote
Old 29/12/2011, 11:30 PM   #12
Gh05t_
Big Clucker
 
Gh05t_'s Avatar
 
Join Date: Dec 2011
Posts: 192
Reputation: 140
Default Re: Re : /changename /clearchat cmds

Quote:
Originally Posted by Amine_Mejrhirrou View Post
Code:
for( new i = 0; i < 25; i ++ )
		   	{
      			SendClientMessageToAll( 0x33FF33AA, " " );
		      	GameTextForAll("~b~Chat cleared!", 3, 1);
		   	}
this is faster
The looping instruction would output content within the compound statement until it has been fulfilled.

pawn Code:
for(new i;i<25;i++) SendClientMessageToAll(-1, " ");
GameTextForAll("~b~Chat cleared!", 3, 1);

Quote:
Originally Posted by Notis123 View Post
OMFG then every play would change another player name without being admin duuuuuuuuuh
Mastermids those days
No he want it for admins only as Normal people do.
The OP hasn't specified his purpose nor intentions for use of the command, just help regarding it's creation. If the command was to be used for this purpose (admins), Fj0rtizFredde post is valid.
Gh05t_ is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
/clearchat? Type-R Help Archive 10 06/05/2011 03:08 PM
Clearchat CMD Linus- Help Archive 29 02/01/2011 08:29 PM
/clearchat command for admins? Face9000 Help Archive 2 19/09/2010 02:07 PM
Clearchat Ihsan_Cingisiz Help Archive 6 04/06/2010 08:58 AM
/Cd & /ClearChat _System_ Help Archive 3 07/04/2009 12:36 PM


All times are GMT. The time now is 05:21 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.