#1

hey guys
i need cmd
type /apply
to setplayer name [xXx]
example:
My name is hab2ever
/apply
to set name [xXx]
hab2ever[xXx]
Reply
#2

Just use the function
pawn Код:
SetPlayerName(playerid, const name[]);
in
pawn Код:
OnPlayerCommandText(playerid, cmdtext[])
Reply
#3

error

C:\Documents and Settings\Sunny\Desktop\my server\gamemodes\SA-MP-GM.pwn(474) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Sunny\Desktop\my server\gamemodes\SA-MP-GM.pwn(474) : error 017: undefined symbol "name"
C:\Documents and Settings\Sunny\Desktop\my server\gamemodes\SA-MP-GM.pwn(474) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Sunny\Desktop\my server\gamemodes\SA-MP-GM.pwn(474) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#4

Quote:
Originally Posted by hab2ever
error

C:\Documents and Settings\Sunny\Desktop\my server\gamemodes\SA-MP-GM.pwn(474) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Sunny\Desktop\my server\gamemodes\SA-MP-GM.pwn(474) : error 017: undefined symbol "name"
C:\Documents and Settings\Sunny\Desktop\my server\gamemodes\SA-MP-GM.pwn(474) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Sunny\Desktop\my server\gamemodes\SA-MP-GM.pwn(474) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.
-_-
You are not supposed to just copy & paste that code, you should modify it for your needs...
Show your code.
Reply
#5

This:

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/apply", cmdtext, true, 10) == 0)
{
SetPlayerName(playerid, const name[]);
return 1;
}
return 0;
}
Reply
#6

Try something like this:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/apply", true) == 0)
    {
      new name[MAX_PLAYER_NAME], string[128];
      GetPlayerName(playerid, name, sizeof(name));
      format(string, sizeof(string),"%s[xXx]", name);
      SetPlayerName(playerid, string);
      return 1;
    }
    return 0;
}
Reply
#7

thank you so much
now work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)