25.07.2012, 16:45
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?
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;
}
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.
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. |
CMD:duty(playerid) {
CMD:duty(playerid, params[]) {