SA-MP Forums Archive
I am new to www.sa-mp.com - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: I am new to www.sa-mp.com (/showthread.php?tid=277954)



I am new to www.sa-mp.com - $India$ - 20.08.2011

Hello,

Well first of all my Intro.

I live in India and i am an Indian. I am making a new Server, I know Scripting but need a person to join and make a Server with me and script together.

Well i want that, How can we remove the "_" from Names and How can we get the First name of the Person Only in Some things. Please help me.

Sorry For my Bad English.


Re: I am new to www.sa-mp.com - =WoR=G4M3Ov3r - 20.08.2011

wiki.sa-mp.com, Teaches you everything you need to know about the basics.. etc

About someone scripting with/for you, You won't find that unless you got $


Re: I am new to www.sa-mp.com - linuxthefish - 20.08.2011

Sorry, you have to have over 100 posts, and 2 reputation to start a RP server. Welcome to SA-MP though!


Re: I am new to www.sa-mp.com - $India$ - 20.08.2011

But i know Scripting but i am not a Professtional in it. And can you tell me how to Remove the "_" from Names?

And how to get only First name?


Re: I am new to www.sa-mp.com - Lorenc_ - 20.08.2011

pawn Code:
stock strreplacechar(string[], oldchar, newchar)
{
    new matches;
    if(ispacked(string)) {
        if(newchar == '\0') {
            for(new i; string{i} != '\0'; i++) {
                if(string{i} == oldchar) {
                    strdel(string, i, i + 1);
                    matches++;
                }
            }
        } else {
            for(new i; string{i} != '\0'; i++) {
                if(string{i} == oldchar) {
                    string{i} = newchar;
                    matches++;
                }
            }
        }
    } else {
        if(newchar == '\0') {
            for(new i; string[i] != '\0'; i++) {
                if(string[i] == oldchar) {
                    strdel(string, i, i + 1);
                    matches++;
                }
            }
        } else {
            for(new i; string[i] != '\0'; i++) {
                if(string[i] == oldchar) {
                    string[i] = newchar;
                    matches++;
                }
            }
        }
    }
    return matches;
}
To be used:

pawn Code:
strreplacechar(playername, '_', ' ');
Very useful Util.


Re: I am new to www.sa-mp.com - $India$ - 20.08.2011

Its for removing "_"??


Re: I am new to www.sa-mp.com - Kush - 20.08.2011

Quote:
Originally Posted by $India$
View Post
Its for removing "_"??
PHP Code:
stock GetPlayerRPNameplayeridname[ ], len )
{
    
GetPlayerNameplayeridnamelen );
    for(new 
0leni++ )
    {
        if ( 
name] == '_' )
        
name] = ' ';
    }




Re: I am new to www.sa-mp.com - $India$ - 20.08.2011

Code:

F:\My Server\Server\gamemodes\Gamemode.pwn(240) : error 029: invalid expression, assumed zero
F:\My Server\Server\gamemodes\Gamemode.pwn(614) : warning 209: function "GetPlayerRPName" should return a value
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
I am getting these errors


Re: I am new to www.sa-mp.com - Retardedwolf - 20.08.2011

Quote:
Originally Posted by $India$
View Post
I know Scripting


If you do, why do you need help with something easy?


Re: I am new to www.sa-mp.com - $India$ - 20.08.2011

Because i am not so Good and please tell me to Fix Those Errors?