[DUV] Dois %S Mesmo Cуdigos
#1

Estou Tentando Criar um Comando Seguinte:

pawn Код:
if(strcmp(cmd, "/adv", true) == 0)
{

new tmp[128];
tmp = strtok(cmdtext, idx);

if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "Uso do Comando: /advertencia");

SendClientMessage(playerid,0xAFAFAFAA,"Player Advertido com Sucesso");
GameTextForPlayer(strval(tmp), "~r~Nгo Repita Isso ou Serб Punido Severamente", 5000, 1);
new name[MAX_PLAYER_NAME], string[44];
GetPlayerName(strval(tmp), name, sizeof(name));
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), " %s Foi Avisado Pelo Admin: %s .",name);
SendClientMessageToAll(0xFFFF00AA, string);
return 1;
}
return 1;
}
Entгo Como Eu faзo para Fazer
- %s Foi Avisado Pelo Admin: %s Motivo %S
Reply
#2

Exemplo:
pawn Код:
GetPlayerName(...,name,...);
GetPlayerName(...,adm,...);
format(...,"%s (ID:%i) foi avisado pelo Admin %s (ID:%i) por: %s",name,id,adm,playerid,motivo);
Reply
#3

Tens Coomo me Explicar Melhor Sempre dб

Undefined Simbol "Admin"
Reply
#4

Quote:
Originally Posted by BurrodaZero
Tens Coomo me Explicar Melhor Sempre dб

Undefined Simbol "Admin"
Quando cria vбrios %s, como no exemplo: "%s foi banido pelo Admin %s", terб que explicar o quк й...

%s = String
%f = Float
%i = Numero (integerer)

Ou seja se criar a variavel do nome use: GetPlayerName(...,VARIAVEL,...);
Variavel do nome = string = %s

Ou seja, se sгo 2 %s serб depois do "...",VARIAVEL-DO-NOME,VARIAVEL2);

Comando exemplo:

pawn Код:
if(strcmp("/MeuNomeId", cmdtext, true, 10) == 0)
{
    new string[128];
    new meunome[MAX_PLAYER_NAME];
    GetPlayerName(playerid,meunome,sizeof(meunome));
    format(string,sizeof(string),"Meu nome й: %s e meu ID й: %i",meunome,playerid);
    SendClientMessage(playerid,COR_AQUI,string);
    return 1;
}
Reply
#5

Ponha Assim

Код:
if(strcmp(cmd, "/adv", true) == 0)
{

new tmp[128];
tmp = strtok(cmdtext, idx);

if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "Uso do Comando: /advertencia");

SendClientMessage(playerid,0xAFAFAFAA,"Player Advertido com Sucesso");
GameTextForPlayer(strval(tmp), "~r~Nгo Repita Isso ou Serб Punido Severamente", 5000, 1);
new name[MAX_PLAYER_NAME], string[44];
GetPlayerName(strval(tmp), name, sizeof(name));
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), " %s Foi Avisado Pelo Admin: %s .",name,name);
SendClientMessageToAll(0xFFFF00AA, string);
return 1;
}
return 1;
}
Se nao der certo me descupem estou comeзando no pawno faz pouco tempo
Reply
#6

Eu jб te avisei, cria tudo num tуpico sу, sу estбs aqui a fazer spam, daqui a pouco йs reportado e levas ban.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)