[Ajuda] Adicionar Comando
#1

Ola pessoal eu queria adicionar um comando ao meu gamemode que fizesse o seguint sistema.

Por exemplo o Player escrevia /ajuda e os admins/gms duty (apenas em duty se possivel) receberam um tipo de frase "O Jogador Joao_Carvalho (id:16) pediu ajuda."

Obrigado pessoal todas as respostas ajudarao muito.
Reply
#2

pawn Код:
CMD:ajuda(playerid){
    new snd[MAX_PLAYER_NAME],string[128];
    GetPlayerName(playerid,snd,sizeof snd);
    format(string,sizeof string,"O Player %s[ID:%d] digitou /ajuda",snd,playerid);
    MSGADM(0xFFFF00AA,string);
    return true;
}

stock MSGADM(cor,string[]){
    for(new i = 0; i < MAX_PLAYERS; i++){
        if(VARIAVEL ADMIN AQUI >= 1){SendClientMessage(i,cor,string);}
    }
    return 1;
}
Em VARIAVEL ADMIN AQUI vocк pхe a variavel que define o admin.
Reply
#3

Olha me deu um erro aqui:

Код:
C:\Users\Toshiba\Downloads\GameMode Carlitos\CRP\gamemodes\crp.pwn(16792) : warning 203: symbol is never used: "teste"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase

Header size:           6236 bytes
Code size:           561312 bytes
Data size:          1371916 bytes
Stack/heap size:      16384 bytes; estimated max. usage=4086 cells (16344 bytes)
Total requirements: 1955848 bytes

1 Warning.
Nao sei se й do comando pois o meu gamemode e feito em strcmp

obs: nao percebi o que quis dizer com a variabel do admin...

Mas obrigado pela tentantiva
Reply
#4

Olha me deu um erro aqui:

Код:
C:\Users\Toshiba\Downloads\GameMode Carlitos\CRP\gamemodes\crp.pwn(16792) : warning 203: symbol is never used: "teste"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase

Header size:           6236 bytes
Code size:           561312 bytes
Data size:          1371916 bytes
Stack/heap size:      16384 bytes; estimated max. usage=4086 cells (16344 bytes)
Total requirements: 1955848 bytes

1 Warning.
Nao sei se й do comando pois o meu gamemode e feito em strcmp

obs: nao percebi o que quis dizer com a variabel do admin...

Mas obrigado pela tentantiva
Reply
#5

strcmp:
pawn Код:
if(strcmp(cmdtext,"/ajuda",true)==0){
    new snd[MAX_PLAYER_NAME],string[128];
    GetPlayerName(playerid,snd,sizeof snd);
    format(string,sizeof string,"O Player %s[ID:%d] digitou /ajuda",snd,playerid);
    MSGADM(0xFFFF00AA,string);
    return true;
}
Poe a stock que citei no coment anterior, e onde falei da variavel.. й o que define o adminitrador exemplo:
PlayerInfo[playerid][Admin]
Reply
#6

Obrigo vlw
Reply
#7

Quote:
Originally Posted by brunoboy
Посмотреть сообщение
Obrigo vlw
Precisar so mandar pm
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)