if (strcmp(cmd, "/umtestebrabo", true) == 0)
{
if(PlayerInfo[playerid][pExplosivos] > 0)
{
new string[128];
if(PlayerInfo[playerid][ComExplosivo])
SetPlayerAttachedObject(playerid, 0, 1252,6,0.032999,0.000000,-0.173999,-28.900001,-9.599999,5.199999,1.000000,1.000000,1.000000);
SetPlayerSpecialAction(playerid, 25);
format(string, sizeof(string), "%s Pegou um explosivo ", sendername);
ProxDetector(100.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return true;
}
{
if(PlayerInfo[playerid][pExplosivos] > 0)
{
pExplosivos |
O bacana й que vc nгo postou qual erro, apesar de ser obvio por ser somente isso, baseando-se pelo seu relato, mas nгo da pra ser preciso:
no enumerador coloque isso junto: |
if (strcmp(cmd, "/umtestebrabo", true) == 0) { if(PlayerInfo[playerid][pExplosivos] > 0) { new string[128]; if(PlayerInfo[playerid][ComExplosivo]) SetPlayerAttachedObject(playerid, 0, 1252,6,0.032999,0.000000,-0.173999,-28.900001,-9.599999,5.199999,1.000000,1.000000,1.000000); SetPlayerSpecialAction(playerid, 25); format(string, sizeof(string), "%s Pegou um explosivo ", sendername); ProxDetector(100.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); return true; }
Presta atenзгo nas chaves e na condiзгo.
Код:
if (strcmp(cmd, "/umtestebrabo", true) == 0) { if(PlayerInfo[playerid][pExplosivos] > 0) { new string[128]; if(PlayerInfo[playerid][ComExplosivo]) SetPlayerAttachedObject(playerid, 0, 1252,6,0.032999,0.000000,-0.173999,-28.900001,-9.599999,5.199999,1.000000,1.000000,1.000000); SetPlayerSpecialAction(playerid, 25); format(string, sizeof(string), "%s Pegou um explosivo ", sendername); ProxDetector(100.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); return true; } |
new string[128];
Sу queria saber se ai й o lugar certo do
pawn Код:
|
warning 219: local variable "string" shadows a variable at a preceding level
new string[128]; //vetor global
main()
{
new string[128]; //vetor local
print(string);
}
Funcao()
{
print(string);
}
new string[128]; //vetor global
main()
{
print(string);
}
Funcao()
{
print(string);
}
//ou
new string[128]; //vetor global
main()
{
new string1[128];//vetor local
print(string1);
}
Funcao()
{
print(string);
}
//ou
main()
{
new string[128]; //vetor local
print(string);
}
Funcao()
{
new string[128]; //vetor local
print(string);
}
//new string[128];