HElp with names.
#1

He i want to make a command like if a player types that command like /duty it makes his name WOLF and if player types DUTY OFF it makes him name back to old one can any one help?
Reply
#2

This topic is for you: https://sampforum.blast.hk/showthread.php?tid=187229 <--- Script Request Thread #5

Scripting Help is when you have codes and you need help with them, do not ask for a full script, try something and then come back.
Reply
#3

Try:

pawn Код:
CMD:duty(playerid) {
    if(isnull(params))
        return SendClientMessage(playerid, -1, "Type /duty [on/off]");
       
    static
        playerName[MAX_PLAYER_NAME];

    if(!strcmp(params, "on", true)) {
        GetPlayerName(playerid, playerName, sizeof playerName);
        SetPVarString(playerid, "name", playerName);
        SetPlayerName(playerid, "WOLF");
        return 1;
    }
    if(!strcmp(params, "off", true)) {
        if(GetPVarType(playerid, "name")) {
            GetPVarString(playerid, "name", playerName, sizeof playerName);
            SetPlayerName(playerid, playerName);
            return 1;
        }
    }
    return 1;
}
Reply
#4

Any help?
Код:
C:\Users\Osman Ali\Desktop\BC\gamemodes\COS-RP.pwn(1679) : error 017: undefined symbol "params"
C:\Users\Osman Ali\Desktop\BC\gamemodes\COS-RP.pwn(1679) : error 029: invalid expression, assumed zero
C:\Users\Osman Ali\Desktop\BC\gamemodes\COS-RP.pwn(1679) : error 017: undefined symbol "params"
C:\Users\Osman Ali\Desktop\BC\gamemodes\COS-RP.pwn(1679) : 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
#5

Quote:
Originally Posted by Dare Devil.....
Посмотреть сообщение
Any help?
Код:
C:\Users\Osman Ali\Desktop\BC\gamemodes\COS-RP.pwn(1679) : error 017: undefined symbol "params"
C:\Users\Osman Ali\Desktop\BC\gamemodes\COS-RP.pwn(1679) : error 029: invalid expression, assumed zero
C:\Users\Osman Ali\Desktop\BC\gamemodes\COS-RP.pwn(1679) : error 017: undefined symbol "params"
C:\Users\Osman Ali\Desktop\BC\gamemodes\COS-RP.pwn(1679) : fatal error 107: too many error messages on one line

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


4 Errors.
Change
PHP код:
CMD:duty(playerid) { 
Into

PHP код:
CMD:duty(playeridparams[]) { 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)