SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 20/04/2011, 05:43 PM   #1
sMog.
Big Clucker
 
sMog.'s Avatar
 
Join Date: Feb 2011
Location: Finland, Ikaalinen
Posts: 129
Reputation: 0
Default How to make [Admin]Name. filterscript ?

Hello.. how to make function that changes player name lif he joins to server.
Like:
[Owner]sMog.
[Mapper]Hunter.
and so on... i just need cmd like /addtag ?
i am using Ladmin v4.2 .

I REALLY NEED IT .. i used searh i didnt found anything i even searched in ****** still nofting
It is good if it saves i user file...
SO PLEASE SAMP PIMP MY SERVER!
sMog. is offline  
Old 20/04/2011, 05:52 PM   #2
xir
Gangsta
 
Join Date: Aug 2010
Posts: 746
Reputation: 3
Default Re: How to make [Admin]Name. filterscript ?

nvmm
xir is offline  
Old 20/04/2011, 05:54 PM   #3
sMog.
Big Clucker
 
sMog.'s Avatar
 
Join Date: Feb 2011
Location: Finland, Ikaalinen
Posts: 129
Reputation: 0
Default Re: How to make [Admin]Name. filterscript ?

i will try but how to make command to add these ...
and what should i make if i have 6 level
Level 6 is Owner
but odhers what i full add there ?

EDIT: it wont work ....
Code:
smog.pwn(8167) : warning 219: local variable "name" shadows a variable at a preceding level
smog.pwn(8168) : error 035: argument type mismatch (argument 2)
smog.pwn(8167) : warning 204: symbol is assigned a value that is never used: "name"
PHP Code:
if(PlayerInfo[playerid][Level] < 6// change 5 to whatever the highest number is
    
{
        new 
name[MAX_PLAYER_NAME], newname[128], tag[32];
        
GetPlayerName (playeridnameMAX_PLAYER_NAME);
        
format (newnamesizeof(newname), "[OWNER]%s"tagname);
        
SetPlayerName(playeridnewname);
    } 
PHP Code:
8167 =         new name[MAX_PLAYER_NAME], newname[128], tag[32];
8168GetPlayerName (playeridnameMAX_PLAYER_NAME); 
sMog. is offline  
Old 20/04/2011, 06:05 PM   #4
Sinner
Gangsta
 
Sinner's Avatar
 
Join Date: Aug 2010
Location: On This Mortal Coil
Posts: 770
Reputation: 292
Default Re: How to make [Admin]Name. filterscript ?

PHP Code:
dcmd_addtag(playeridparams[])
{
    new 
playertagname[20];
    if(
sscanf(params"us"playertagname)) return SendClientMessage(playerid0xFFFFFF"USAGE: /Addtag [playerid] [tag]");
    new 
str[MAX_NAME_LEN], name[MAX_NAME_LEN];
    
GetPlayerName(playernamesizeof(name));
    
format(strsizeof(str), "[%s]%s"tagnamename);
    
SetPlayerName(playerstr);

For example, "/addtag 5 owner"
This requires sscanf and dcmd
__________________
Please use the search feature before asking a question.
Sinner is offline  
Old 20/04/2011, 06:07 PM   #5
sMog.
Big Clucker
 
sMog.'s Avatar
 
Join Date: Feb 2011
Location: Finland, Ikaalinen
Posts: 129
Reputation: 0
Default Re: How to make [Admin]Name. filterscript ?

i try but how to make it save
Thanks

EDIT: i get errors...
PHP Code:
CMD:addtag(playeridparams[]) 

    new 
playertagname[20]; 
    if(
sscanf(params"us"playertagname)) return SendClientMessage(playerid0xFFFFFF"USAGE: /Addtag [playerid] [tag]"); 
    new 
str[MAX_NAME_LEN], name[MAX_NAME_LEN]; //line 11244
    
GetPlayerName(playernamesizeof(name)); 
    
format(strsizeof(str), "[%s]%s"tagnamename); 
    
SetPlayerName(playerstr); 

PHP Code:
smog.pwn(11244) : error 017undefined symbol "MAX_NAME_LEN"
smog.pwn(11244) : error 029invalid expressionassumed zero
smog
.pwn(11244) : error 091ambiguous constanttag override is required (symbol "name")
smog.pwn(11244) : fatal error 107too many error messages on one line 
EDIT2: I changed MAX_NAME_LEN To 24 and still errors
PHP Code:
smog.pwn(11244) : warning 219local variable "name" shadows a variable at a preceding level
smog
.pwn(11245) : error 035argument type mismatch (argument 2)
smog.pwn(11245) : error 035argument type mismatch (argument 2)
smog.pwn(11244) : warning 204symbol is assigned a value that is never used"name"
smog.pwn(11244 -- 11248) : warning 209: function "cmd_addtag" should return a value 
sMog. is offline  
Old 20/04/2011, 06:12 PM   #6
xir
Gangsta
 
Join Date: Aug 2010
Posts: 746
Reputation: 3
Default Re: How to make [Admin]Name. filterscript ?

Change name[MAX_NAME_LEN] to

name[MAX_PLAYER_NAME]
xir is offline  
Old 20/04/2011, 06:19 PM   #7
sMog.
Big Clucker
 
sMog.'s Avatar
 
Join Date: Feb 2011
Location: Finland, Ikaalinen
Posts: 129
Reputation: 0
Default Re: How to make [Admin]Name. filterscript ?

still
pawn Code:
smog.pwn(11244) : warning 219: local variable "name" shadows a variable at a preceding level
smog.pwn(11245) : error 035: argument type mismatch (argument 2)
smog.pwn(11245) : error 035: argument type mismatch (argument 2)
smog.pwn(11244) : warning 204: symbol is assigned a value that is never used: "name"
sMog. is offline  
Old 20/04/2011, 06:41 PM   #8
Ricop522
High-roller
 
Ricop522's Avatar
 
Join Date: Feb 2010
Location: ES
Posts: 2,640
Reputation: 159
Default Re: How to make [Admin]Name. filterscript ?

pawn Code:
dcmd_addtag(playerid, params[])
{
    new player, tagname[20];
    if(sscanf(params, "us", player, tagname)) return SendClientMessage(playerid, 0xFFFFFF, "USAGE: /Addtag [playerid] [tag]");
    new str[128], name[MAX_PLAYER_NAME];
    GetPlayerName(player, name, sizeof(name));
    format(str, sizeof(str), "[%s]%s", tagname, name);
    SetPlayerName(player, str);
    return 1;
}
__________________
"Any fool can write code that a
computer can understand. Good
programmers write code that
humans can understand."

AJUDA! Programação
Github
Ricop522 is offline  
Old 20/04/2011, 06:54 PM   #9
sMog.
Big Clucker
 
sMog.'s Avatar
 
Join Date: Feb 2011
Location: Finland, Ikaalinen
Posts: 129
Reputation: 0
Default Re: How to make [Admin]Name. filterscript ?

hmm..
Quote:
smog.pwn(11245) : warning 219: local variable "name" shadows a variable at a preceding level
smog.pwn(11246) : error 035: argument type mismatch (argument 2)
smog.pwn(11246) : error 035: argument type mismatch (argument 2)
smog.pwn(11245) : warning 204: symbol is assigned a value that is never used: "name"
sMog. is offline  
Old 21/04/2011, 03:59 PM   #10
Sinner
Gangsta
 
Sinner's Avatar
 
Join Date: Aug 2010
Location: On This Mortal Coil
Posts: 770
Reputation: 292
Default Re: How to make [Admin]Name. filterscript ?

You probably already used "name" as a variable somewhere, try this:

PHP Code:
CMD:addtag(playeridparams[])
{
    new 
playertagname[20];
    if(
sscanf(params"us"playertagname)) return SendClientMessage(playerid0xFFFFFF"USAGE: /Addtag [playerid] [tag]");
    new 
str[128], __name[MAX_PLAYER_NAME];
    
GetPlayerName(player__namesizeof(__name));
    
format(strsizeof(str), "[%s]%s"tagname__name);
    
SetPlayerName(playerstr);
    return 
1;

__________________
Please use the search feature before asking a question.
Sinner is offline  
 

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
A-Admin FilterScript 1 Command [SFSF]Ali Filterscripts 10 08/03/2012 01:08 PM
Starting my admin filterscript ricardo178 Help Archive 2 13/03/2011 09:44 PM
[HELP] Lux Admin Filterscript Noss* Help Archive 3 25/10/2010 07:29 PM
Filterscript - Admin Help Portable Help Archive 3 13/07/2010 10:29 AM


All times are GMT. The time now is 04:58 AM.


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