//CNN
CNN = TextDrawCreate(184.5 ,351 , "cnn");
TextDrawFont(CNN , 1);
TextDrawLetterSize(CNN,0.2999, 1.4);
TextDrawColor(CNN , 0xffffffFF);
TextDrawSetOutline(CNN , false);
TextDrawSetProportional(CNN , true);
TextDrawSetShadow(CNN , 1);
if(strcmp(cmdtext,"/cnn",true))
{
if(IsPlayerAdmin(playerid)){
new str[256],nome[MAX_PLAYER_NAME];
GetPlayerName(playerid,nome,sizeof(nome));
format(str, sizeof(str), "~y~%s: ~w~%s",nome,cmdtext[5]);
TextDrawShowForAll(CNN);
SetTimer("apagarcnn",5000,false);
}else{
SendClientMessage(playerid,-1,"[ERRO]: Vocк nгo tem permissгo");
}
return 1;
}
if(strcmp(cmdtext,"/cnn",true))
{
if(!IsPlayerAdmin(playerid))
return SendClientMessage(playerid,-1,"[ERRO]: Vocк nгo tem permissгo");
new cnntextpt[80], str[128];
if(sscanf(cmdtext, "s[5]s[80]", cmdtext, cnntextpt))
return SendClientMessage(playerid, -1, "uso: /cnn [texto]");
GetPlayerName(playerid,str,sizeof(str));
format(str, sizeof(str), "~y~%s: ~w~%s", str, cmdtext[5]);
TextDrawSetString(CNN, str);
TextDrawShowForAll(CNN);
SetTimer("apagarcnn",5000,false);
return 1;
}
|
testa isso:
pawn Код:
|
if(strcmp(cmdtext,"/cnn",true))
{
if(!IsPlayerAdmin(playerid))
return SendClientMessage(playerid,-1,"[ERRO]: Vocк nгo tem permissгo");
new cnntextpt[80], str[128];
if(sscanf(cmdtext, "s[80]", cnntextpt))
return SendClientMessage(playerid, -1, "uso: /cnn [texto]");
GetPlayerName(playerid,str,sizeof(str));
format(str, sizeof(str), "~y~%s: ~w~%s", str, cmdtext[5]);
TextDrawSetString(CNN, str);
TextDrawShowForAll(CNN);
SetTimer("apagarcnn",5000,false);
return 1;
}
|
tenta so assim:
pawn Код:
|
if(strcmp("/cnn", cmd, true) == 0)
{
if(pAdmin[playerid] > 0)
{
new texto[64];
if(sscanf(cmdtext, "s[5]s[64]", cmd, texto))
{
SendClientMessage(playerid, Vermelho, "Digite: /cnn [texto]");
return 1;
}
format(string, sizeof(string), "%s diz:~n~~g~] ~w~%s ~g~]", GetPlayerNameEx(playerid), texto);
GameTextForAll(string, 5000, 3);
}
else
{
SendClientMessage(playerid, Vermelho, "Vocк nгo tem permissгo para usar este comando!");
}
return 1;
}
C:\Documents and Settings\caio junior\Desktop\OFICIAL Truck Lifer\gamemodes\roleplay.pwn(307) : error 017: undefined symbol "cmd"
C:\Documents and Settings\caio junior\Desktop\OFICIAL Truck Lifer\gamemodes\roleplay.pwn(309) : error 017: undefined symbol "pAdmin"
C:\Documents and Settings\caio junior\Desktop\OFICIAL Truck Lifer\gamemodes\roleplay.pwn(309) : warning 215: expression has no effect
C:\Documents and Settings\caio junior\Desktop\OFICIAL Truck Lifer\gamemodes\roleplay.pwn(309) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\caio junior\Desktop\OFICIAL Truck Lifer\gamemodes\roleplay.pwn(309) : error 029: invalid expression, assumed zero
C:\Documents and Settings\caio junior\Desktop\OFICIAL Truck Lifer\gamemodes\roleplay.pwn(309) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
5 Errors.