Skripta koju koristim: Ravens
Detaljan opis problema: Pojavila su mi se 2 warninga, ne mogu da ih resim, pravio sam komandu za bande da uzimaju orzuje i da imaju heal
Dio skripte: if(strcmp(cmd, "/oruzje", true) == 0)
{
if (IsPlayerInRangeOfPoint(playerid,7,2342.8855,-1186.4288,1027.9766) || IsPlayerInRangeOfPoint(playerid,7,1270.4476,-795.1836,1084.1719) || IsPlayerInRangeOfPoint(playerid,7, 959.4613,-46.6776,1001.1172) || IsPlayerInRangeOfPoint(playerid,7, 458.2095,1418.4552,1084.3080))
{
new sendername[MAX_PLAYER_NAME]; // prvi warning
new string[256]; //drugi
GetPlayerName(playerid, sendername, sizeof(sendername));
GivePlayerMoney(playerid,-2000);
SafeGivePlayerWeapon(playerid, 24, 100);
SafeGivePlayerWeapon(playerid, 29, 100);
SafeGivePlayerWeapon(playerid, 30, 100);
format(string, sizeof(string), "* %s je uzeo oruzije..", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
return 1;
}
i heal
if(strcmp(cmd, "/snaga", true) == 0) //by Ralph
{
if (IsPlayerInRangeOfPoint(playerid,7,2342.8855,-1186.4288,1027.9766) || IsPlayerInRangeOfPoint(playerid,7,1270.4476,-795.1836,1084.1719) || IsPlayerInRangeOfPoint(playerid,7, 959.4613,-46.6776,1001.1172) || IsPlayerInRangeOfPoint(playerid,7, 458.2095,1418.4552,1084.3080))
{
new sendername[MAX_PLAYER_NAME]; //isto je i ovde ovako prvi //
new string[128]; // drugi...
GetPlayerName(playerid, sendername, sizeof(sendername));
GivePlayerMoney(playerid,-100);
SetPlayerHealth(playerid,100.0);
format(string, sizeof(string), "* %testtst..", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
return 1;
}
Neke slike/video za lakse dobivanje pomoci(neobavezno):
C:\Users\tt\Desktop\ttt\gamemodes\larp.pwn(33107) : warning 219: local variable "sendername" shadows a variable at a preceding level
C:\Users\ttc\Desktop\tttt\gamemodes\larp.pwn(33108) : warning 219: local variable "string" shadows a variable at a preceding level
to mi se pojavilo nakon toga kada sam dodao /stats u dijalog
Stavi liniju
(33107)
(33108)
Citat: Razer poslato Jun 25, 2011, 23:37:30 POSLE PODNE
Stavi liniju
(33107)
(33108)
prcitaj sta sam stavio kod komandi gde su warinzi ovako sotji //prvi varning
new sendername[MAX_PLAYER_NAME]; // prvi warning
new string[256]; //drugi
To znaci da si vec definirao string nemozes dva puta definirati samo obriši.
Citat: $--L84S--$ poslato Jun 26, 2011, 11:27:50 PRE PODNE
To znaci da si vec definirao string nemozes dva puta definirati samo obriši.
Kako onda treba da izgleda ta komanda..tj bez toga pokusavao sam brisati ali mi izbaci za one zagrade..onih 26 errora
Citat: Ralph poslato Jun 26, 2011, 13:09:29 POSLE PODNE
Citat: $--L84S--$ poslato Jun 26, 2011, 11:27:50 PRE PODNE
To znaci da si vec definirao string nemozes dva puta definirati samo obriši.
Kako onda treba da izgleda ta komanda..tj bez toga pokusavao sam brisati ali mi izbaci za one zagrade..onih 26 errora
if(strcmp(cmd, "/oruzje", true) == 0)
{
if (IsPlayerInRangeOfPoint(playerid,7,2342.8855,-1186.4288,1027.9766) || IsPlayerInRangeOfPoint(playerid,7,1270.4476,-795.1836,1084.1719) || IsPlayerInRangeOfPoint(playerid,7, 959.4613,-46.6776,1001.1172) || IsPlayerInRangeOfPoint(playerid,7, 458.2095,1418.4552,1084.3080))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GivePlayerMoney(playerid,-2000);
SafeGivePlayerWeapon(playerid, 24, 100);
SafeGivePlayerWeapon(playerid, 29, 100);
SafeGivePlayerWeapon(playerid, 30, 100);
format(string, sizeof(string), "* %s je uzeo oruzije..", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
return 1;
}
Hvala :) moze lock :)