SA-MP Forums Archive
HElp with names. - 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)
+--- Thread: HElp with names. (/showthread.php?tid=362792)



HElp with names. - Dare Devil..... - 25.07.2012

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?


Re : HElp with names. - lelemaster - 25.07.2012

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.


Re: HElp with names. - Jason` - 25.07.2012

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;
}



Re: HElp with names. - Dare Devil..... - 25.07.2012

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.



Re: HElp with names. - Alexis1999 - 25.07.2012

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[]) {