Textdraw -
Arthenry - 16.07.2012
como eu tipo coloko uma textdraw em azul pra quando a pessoa for procurada algemada e presa apareзe no meio da tela PRESO, PROCURADO OU ALGEMAD0?
pawn Код:
if(strcmp(cmd, "/procurar", true) == 0 || strcmp(cmd, "/su", true) == 0)
{
new id[256],Pname[24],Sname[24],str[256],Sstr[256];
GetPlayerName(playerid, Pname, sizeof(Pname));
format(Sstr, sizeof(Sstr), "Contas/%s.ini", Pname);
new prof = dini_Int(Sstr, "Profissao");
new admm = dini_Int(Sstr, "pAdm01");
if(prof == Policial_C || prof == Policial_F || prof == Recruta || prof == Bope || prof == Swat || prof == Rotam || prof == Policial_M || prof == FBI || prof == Interpol || admm == 1)
{
id = strtok(cmdtext, idx);
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++;}
new offset = idx; new result[100];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; }
result[idx - offset] = EOS;
if(!strlen(id) || !strlen(result)) return SendClientMessage(playerid, 0xFFD39BAA, "Use: /procurar [id] [motivo]");
if(IsPlayerConnected(strval(id)))
{
GetPlayerName(strval(id), Sname, sizeof(Sname));
format(str, sizeof(str), "{2F7AFC} Vocк foi colocado na lista de procurados pelo policial %s. Motivo: %s", Pname, result);
SendClientMessage(strval(id), 0xFFD39BAA, str);
format(str, sizeof(str), "{2F7AFC}| PROCURADO | O policial %s colocou %s na lista de procurados pelo motivo: %s", Pname, Sname, result);
SendClientMessageToAll(0xFFD39BAA, str);
dini_IntSet(Sstr, "Procurado", dini_Int(Sstr, "Procurado")+1);
SetPlayerWantedLevel(strval(id), GetPlayerWantedLevel(strval(id))+1);
Procurados[strval(id)]++;
return 1;
}
else return SendClientMessage(playerid, 0xFFD39BAA, "(ERRO) Jogador nгo conectado no momento!");
}
else return SendClientMessage(playerid, 0xFFD39BAA, "(ERRO) Vocк nгo pode usar esse comando!");
}
pawn Код:
if(strcmp(cmd, "/algemar", true) == 0) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), P_CONTAS, aname);
if(dini_Int(file, "Profissao") == Policial_M || dini_Int(file, "Profissao") == Policial_C || dini_Int(file, "Profissao") == Policial_F || dini_Int(file, "Profissao") == Recruta || dini_Int(file, "Profissao") == Bope || dini_Int(file, "Profissao") == Swat || dini_Int(file, "Profissao") == Rotam || dini_Int(file, "Profissao") == FBI || dini_Int(file, "Profissao") == Interpol ||dini_Int(file, "Profissao") == LSPD || dini_Int(file, "pAdm01") == 1){
new tmp[256];
new plid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){
SendClientMessage(playerid, Vermelho, "{0099FF}[x]{CCCCFF} Use: /algemar [id]");
return 1;
}
plid = strval(tmp);
if(IsPlayerInAnyVehicle(plid) == 1 || IsPlayerInAnyVehicle(playerid) == 1){
SendClientMessage(playerid, Vermelho, "{0099FF}[x]{CCCCFF} Alguem estб dentro de um carro.");
return 1 ;
}
if(plid == playerid){
SendClientMessage(playerid, Vermelho, "{0099FF}[x]{CCCCFF} Vocк nгo pode algemar vocк mesmo.");
return 1 ;
}
if(!IsPlayerConnected(plid)){
SendClientMessage(playerid, Vermelho, "{0099FF}[x]{CCCCFF} O jogador nгo estб conectado");
return 1;
} else {
if(GetDistanceBetweenPlayers(plid,playerid) < 10){
format(string, sizeof(string), "{0099FF}[x]{CCCCFF} O Policial %s te algemou.", aname);
SendClientMessage(plid, AzuL4, string);
TogglePlayerControllable(plid, 0);
SendClientMessage(playerid, COLOR_GREEN, "{0099FF}[x]{CCCCFF} Algemado com sucesso.");
algemado[plid] = 1;
return 1;
} else {
SendClientMessage(playerid,Vermelho,"{0099FF}[x]{CCCCFF} Chegue mais perto para algemar.");
return 1;
}
}
} else {
SendClientMessage(playerid,Vermelho,"{0099FF}[x]{CCCCFF} Apenas policiais podem usar este comando.");
return 1;
}
}
pawn Код:
if(strcmp(cmd, "/prender", true) == 0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), P_CONTAS, aname);
if(dini_Int(file, "Profissao") == Policial_C || dini_Int(file, "Profissao") == Policial_F || dini_Int(file, "Profissao") == Recruta || dini_Int(file, "Profissao") == Bope || dini_Int(file, "Profissao") == Swat || dini_Int(file, "Profissao") == Rotam || dini_Int(file, "Profissao") == Policial_M || dini_Int(file, "Profissao") == FBI || dini_Int(file, "Profissao") == Interpol || dini_Int(file, "pAdm01") == 1)
{
new tmp[256];
new plid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, Vermelho, "{0099FF}[x]{CCCCFF} Use: /prender [id] [motivo]");
return 1;
}
plid = strval(tmp);
if(GetPlayerWantedLevel(plid) == 0)
{
return SendClientMessage(playerid, -1, "{2F7AFC} Esse jogador nгo estб sendo procurado, portanto nгo poderб ser preso!");
}
if(IsPlayerInAnyVehicle(plid) == 1 || IsPlayerInAnyVehicle(playerid) == 1)
{
SendClientMessage(playerid, Vermelho, "{0099FF}[x]{CCCCFF} O Player estб dentro de um carro e nгo pode ser preso.");
return 1 ;
}
if(plid == playerid)
{
SendClientMessage(playerid, Vermelho, "{0099FF}[x]{CCCCFF} Vocк nгo pode fazer isto com si mesmo.");
return 1 ;
}
if(!IsPlayerConnected(plid))
{
SendClientMessage(playerid, Vermelho, "{0099FF}[x]{CCCCFF} O jogador nгo estб conectado");
return 1;
}
else
{
if(GetDistanceBetweenPlayers(plid,playerid) < 10)
{
//AQUI VAI LER O MOTIVO
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[100];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
//--------------------------------------------
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), P_CONTAS, pname);
format(string, sizeof(string), "[x] O policial %s te prendeu.", aname);
SendClientMessage(plid, AzuL4, string);
SetPlayerPos(plid, 263.8820,77.4002,1001.0391);
SetPlayerInterior(plid, 6);
SetPlayerHealth(plid, 99999);
ResetPlayerWeapons(plid);
dini_IntSet(file2, "Preso", 1);
SendClientMessage(playerid, COLOR_GREEN, "{0099FF}[x]{CCCCFF} Preso com sucesso.");
SetPlayerWantedLevel(plid, 0);
preso[plid] = 1;
TogglePlayerControllable(plid, 1);
//MENSAGEM PARA TODOS
format(string, sizeof(string), "{2F7AFC} | PRISГO | O policial %s prendeu o procurado %s pelo motivo: %s!", aname, pname, (result));
SendClientMessageToAll(-1 ,string);
if(Procurados[plid] == 1)
{
GivePlayerGrana(playerid,60);
Procurados[plid] = 0;
SendClientMessage(playerid, Verde, "{0099FF}[x]{CCCCFF} Vocк ganhou uns trocados por ter prendido um procurado!");
dini_IntSet(file2, "Procurado", 0);
}
return 1;
}
else
{
SendClientMessage(playerid,Vermelho,"{0099FF}[x]{CCCCFF} Chegue mais perto para prender!");
return 1;
}
}
}
else
{
SendClientMessage(playerid,Vermelho,"{0099FF}[x]{CCCCFF} Apenas policiais podem usar este comando!");
return 1;
}
}
Re: Textdraw -
@Riichard - 16.07.2012
pawn Код:
GameTextForPlayer(plid, "~w~PRESO", 2000,3); // Manda uma mensagem na tela por alguns segundos
// Para a textdraw,vocк tem q criar.
This forum requires that you wait 120 seconds between posts. Please try again in 47 seconds.
AW: Textdraw -
RedBulL_x - 16.07.2012
Aconselho usar GameTextForPlayer, mais simples.
https://sampwiki.blast.hk/wiki/GameTextForPlayer
Re: Textdraw -
Arthenry - 16.07.2012
Ta mais qual й a fonte que apareзe ?
AW: Textdraw -
RedBulL_x - 16.07.2012
Sу vocк editar o code com os estilos do link abaixo!
https://sampwiki.blast.hk/wiki/GameTextStyle#Text_Styles
Re: Textdraw -
Arthenry - 17.07.2012
Valeu vou tentar jaja retorno '-'
Mais como onde eu coloko a fonte? tem como fazer sу o algemar pra mim pegar o jeito ?
Re: Textdraw -
dPlaYer_ - 17.07.2012
pawn Код:
GameTextForPlayer(playerid, string, 3000, 1);// 1 = Fonte | 3000 = Segundos que vгo aparecer o texto... no caso 3000 й 3 segundos.
Veja as fontes aqui:
https://sampwiki.blast.hk/wiki/GameTextStyle#Text_Styles
Re: Textdraw -
Arthenry - 17.07.2012
Deu erro ''=''
pawn Код:
C:\Documents and Settings\Vinнcius\Desktop\New Virtual City\gamemodes\NVC.pwn(10286) : error 017: undefined symbol "plid"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
Linha:
Код:
if(strcmp(cmd, "/procurar", true) == 0 || strcmp(cmd, "/su", true) == 0)
{
new id[256],Pname[24],Sname[24],str[256],Sstr[256];
GetPlayerName(playerid, Pname, sizeof(Pname));
format(Sstr, sizeof(Sstr), "Contas/%s.ini", Pname);
new prof = dini_Int(Sstr, "Profissao");
new admm = dini_Int(Sstr, "pAdm01");
if(prof == Policial_C || prof == Policial_F || prof == Recruta || prof == Bope || prof == Swat || prof == Rotam || prof == Policial_M || prof == FBI || prof == Interpol || admm == 1)
{
id = strtok(cmdtext, idx);
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++;}
new offset = idx; new result[100];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; }
result[idx - offset] = EOS;
if(!strlen(id) || !strlen(result)) return SendClientMessage(playerid, 0xFFD39BAA, "Use: /procurar [id] [motivo]");
if(IsPlayerConnected(strval(id)))
{
GetPlayerName(strval(id), Sname, sizeof(Sname));
format(str, sizeof(str), "{2F7AFC} Vocк foi colocado na lista de procurados pelo policial %s. Motivo: %s", Pname, result);
SendClientMessage(strval(id), 0xFFD39BAA, str);
format(str, sizeof(str), "{2F7AFC}| PROCURADO | O policial %s colocou %s na lista de procurados pelo motivo: %s", Pname, Sname, result);
SendClientMessageToAll(0xFFD39BAA, str);
dini_IntSet(Sstr, "Procurado", dini_Int(Sstr, "Procurado")+1);
SetPlayerWantedLevel(strval(id), GetPlayerWantedLevel(strval(id))+1);
GameTextForPlayer(plid, "~b~Procurado", 3000,0);
Procurados[strval(id)]++;
return 1;
}
else return SendClientMessage(playerid, 0xFFD39BAA, "(ERRO) Jogador nгo conectado no momento!");
}
else return SendClientMessage(playerid, 0xFFD39BAA, "(ERRO) Vocк nгo pode usar esse comando!");
}
Re: Textdraw -
@Riichard - 17.07.2012
pawn Код:
if(strcmp(cmd, "/procurar", true) == 0 || strcmp(cmd, "/su", true) == 0)
{
new id[256],Pname[24],Sname[24],str[256],Sstr[256];
GetPlayerName(playerid, Pname, sizeof(Pname));
format(Sstr, sizeof(Sstr), "Contas/%s.ini", Pname);
new prof = dini_Int(Sstr, "Profissao");
new admm = dini_Int(Sstr, "pAdm01");
if(prof == Policial_C || prof == Policial_F || prof == Recruta || prof == Bope || prof == Swat || prof == Rotam || prof == Policial_M || prof == FBI || prof == Interpol || admm == 1)
{
id = strtok(cmdtext, idx);
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++;}
new offset = idx; new result[100];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; }
result[idx - offset] = EOS;
if(!strlen(id) || !strlen(result)) return SendClientMessage(playerid, 0xFFD39BAA, "Use: /procurar [id] [motivo]");
if(IsPlayerConnected(strval(id)))
{
GetPlayerName(strval(id), Sname, sizeof(Sname));
format(str, sizeof(str), "{2F7AFC} Vocк foi colocado na lista de procurados pelo policial %s. Motivo: %s", Pname, result);
SendClientMessage(strval(id), 0xFFD39BAA, str);
format(str, sizeof(str), "{2F7AFC}| PROCURADO | O policial %s colocou %s na lista de procurados pelo motivo: %s", Pname, Sname, result);
SendClientMessageToAll(0xFFD39BAA, str);
dini_IntSet(Sstr, "Procurado", dini_Int(Sstr, "Procurado")+1);
SetPlayerWantedLevel(strval(id), GetPlayerWantedLevel(strval(id))+1);
GameTextForPlayer(id, "~b~Procurado", 3000,0);
Procurados[strval(id)]++;
return 1;
}
else return SendClientMessage(playerid, 0xFFD39BAA, "(ERRO) Jogador nгo conectado no momento!");
}
else return SendClientMessage(playerid, 0xFFD39BAA, "(ERRO) Vocк nгo pode usar esse comando!");
}
AW: Textdraw -
RedBulL_x - 17.07.2012
pawn Код:
if(strcmp(cmd, "/algemar", true) == 0) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), P_CONTAS, aname);
if(dini_Int(file, "Profissao") == Policial_M || dini_Int(file, "Profissao") == Policial_C || dini_Int(file, "Profissao") == Policial_F || dini_Int(file, "Profissao") == Recruta || dini_Int(file, "Profissao") == Bope || dini_Int(file, "Profissao") == Swat || dini_Int(file, "Profissao") == Rotam || dini_Int(file, "Profissao") == FBI || dini_Int(file, "Profissao") == Interpol ||dini_Int(file, "Profissao") == LSPD || dini_Int(file, "pAdm01") == 1){
new tmp[256];
new plid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){
SendClientMessage(playerid, Vermelho, "{0099FF}[x]{CCCCFF} Use: /algemar [id]");
return 1;
}
plid = strval(tmp);
if(IsPlayerInAnyVehicle(plid) == 1 || IsPlayerInAnyVehicle(playerid) == 1){
SendClientMessage(playerid, Vermelho, "{0099FF}[x]{CCCCFF} Alguem estб dentro de um carro.");
return 1 ;
}
if(plid == playerid){
SendClientMessage(playerid, Vermelho, "{0099FF}[x]{CCCCFF} Vocк nгo pode algemar vocк mesmo.");
return 1 ;
}
if(!IsPlayerConnected(plid)){
SendClientMessage(playerid, Vermelho, "{0099FF}[x]{CCCCFF} O jogador nгo estб conectado");
return 1;
} else {
if(GetDistanceBetweenPlayers(plid,playerid) < 10){
format(string, sizeof(string), "{0099FF}[x]{CCCCFF} O Policial %s te algemou.", aname);
SendClientMessage(plid, AzuL4, string);
GameTextForPlayer(plid,"~w~ [ ALGEMADO ]", 5000, 1);// 5000 = 5 Segundos, 1 = Estilo da fonte.
TogglePlayerControllable(plid, 0);
SendClientMessage(playerid, COLOR_GREEN, "{0099FF}[x]{CCCCFF} Algemado com sucesso.");
algemado[plid] = 1;
return 1;
} else {
SendClientMessage(playerid,Vermelho,"{0099FF}[x]{CCCCFF} Chegue mais perto para algemar.");
return 1;
}
}
} else {
SendClientMessage(playerid,Vermelho,"{0099FF}[x]{CCCCFF} Apenas policiais podem usar este comando.");
return 1;
}
}
Tб aew seu comando /agelmar cara.
Ajudei ? +REP