Skripta koju koristim: LARP
Detaljan opis problema: ja sam radio vozila na principu ovog tut-a http://balkan-samp.com/forum/index.php?topic=18121.0
Ovaj crveni dio od news mi treba da nije na id auta vec na ovaj tut
Dio skripte:
if(strcmp(cmd, "/news", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9)
{
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Nemozes pricati,usutkan si");
return 1;
}
new counter = 0;
[color=red]for(new i = 119; i <= 119; i++)[/color]
{
new dist = CheckPlayerDistanceToVehicle(7, playerid, i);
if(dist)
{
counter++;
}
}
if(counter == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You're not near/in your news van/chopper !");
return 1;
}
else
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /news [newstext]");
return 1;
}
new rtext[64];
if(PlayerInfo[playerid][pRank] == 1) { rtext = "Intern Worker"; }
else if(PlayerInfo[playerid][pRank] == 2) { rtext = "Journalist"; }
else if(PlayerInfo[playerid][pRank] == 3) { rtext = "Head Journalist"; }
else if(PlayerInfo[playerid][pRank] == 4) { rtext = "Company Secretary"; }
else if(PlayerInfo[playerid][pRank] == 5) { rtext = "ABC Manager"; }
else if(PlayerInfo[playerid][pRank] == 6) { rtext = "Network Producer"; }
else { rtext = "Intern Worker"; }
format(string, sizeof(string), "[ABC Vijesti] %s %s: %s", rtext, sendername, result);
OOCNews(COLOR_NEWS,string);
PlayerInfo[playerid][pNewsSkill] ++;
if(PlayerInfo[playerid][pNewsSkill] == 50)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 2, soon you are able to Fly the News Chopper and talk Live."); }
else if(PlayerInfo[playerid][pNewsSkill] == 100)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 3, soon you are able to Fly the News Chopper and talk Live."); }
else if(PlayerInfo[playerid][pNewsSkill] == 200)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 4, you can fly the News Chopper now."); }
else if(PlayerInfo[playerid][pNewsSkill] == 400)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 5, you can now talk Live with any person you want."); }
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Nisi novinar !");
}
}//not connected
return 1;
}
Moderator:
Ja neznam sto je toliko tesko staviti "[","]"? Sledeci put stavljaj kode u [ code ][ /code ]!
Kako su ti definirana vozila od CNN.
Citat: FireMan poslato Jun 28, 2011, 12:42:23 POSLE PODNE
Kako su ti definirana vozila od CNN.
new cnnauto[10];
forward IsAcnnauto(carid);
public IsAcnnauto(carid)
{
for(new i = 0; i < sizeof(cnnauto); i++)
{
if(carid == cnnauto
) return 1;
}
return 0;
}
Eto tako sam definira
imas li sada kod vozila
cnnauto [0] = Addstatic....
krenes od 0 pa povecas za 1 kako dodajes novo vozilo
Citat: [A]Ricky poslato Jun 28, 2011, 23:04:24 POSLE PODNE
imas li sada kod vozila
cnnauto [0] = Addstatic....
krenes od 0 pa povecas za 1 kako dodajes novo vozilo
Ja tebe nista nekontam pitao sam za /news komandu ne izradu vozila za org/bande(bez id-a)
if(strcmp(cmd, "/news", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9)
{
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "You cannot speak, you have been silenced");
return 1;
}
new newcar = GetPlayerVehicleID(playerid);
new playa;
playa = ReturnUser(tmp);
if(IsAcnnauto(newcar))
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GREY, "Koristi: /news [newstext]");
return 1;
}
new rtext[64];
if(PlayerInfo[playerid][pRank] == 1) { rtext = "Mladi Novinar"; }
else if(PlayerInfo[playerid][pRank] == 2) { rtext = "Novinar"; }
else if(PlayerInfo[playerid][pRank] == 3) { rtext = "Reporter"; }
else if(PlayerInfo[playerid][pRank] == 4) { rtext = "Stariji Novinar"; }
else if(PlayerInfo[playerid][pRank] == 5) { rtext = "Urednik"; }
else if(PlayerInfo[playerid][pRank] == 6) { rtext = "Glavni Urednik"; }
else { rtext = "Intern Worker"; }
format(string, sizeof(string), "Vijesti | %s %s |: %s", rtext, sendername, result);
OOCNews(COLOR_ORANGE,string);
PlayerInfo[playerid][pNewsSkill] ++;
if(PlayerInfo[playerid][pNewsSkill] == 50)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 2, soon you are able to Fly the News Chopper and talk Live."); }
else if(PlayerInfo[playerid][pNewsSkill] == 100)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 3, soon you are able to Fly the News Chopper and talk Live."); }
else if(PlayerInfo[playerid][pNewsSkill] == 200)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 4, you can fly the News Chopper now."); }
else if(PlayerInfo[playerid][pNewsSkill] == 400)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 5, you can now talk Live with any person you want."); }
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not a News Reporter !");
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Nisi u vozilu CNN-a");
}
}//not connected
return 1;
}
Eror:error 029: invalid expression, assumed zero
Warning:warning 204: symbol is assigned a value that is never used: "playa"
Daj linije!!
Citat: Ante_Street poslato Jun 29, 2011, 11:50:46 PRE PODNE
Eror:error 029: invalid expression, assumed zero
Warning:warning 204: symbol is assigned a value that is never used: "playa"
ta vrijednost nije uopce koristena ili je moras negdje koristiti ili delete.
daj liniju na kojoj ti izbaci taj error
Evo cijela komanda izbacuje na linijama oznacenim crvenom bojom....
if(strcmp(cmd, "/news", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9)
{
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "You cannot speak, you have been silenced");
return 1;
}
new newcar = GetPlayerVehicleID(playerid);
new playa;
playa = ReturnUser(tmp);
if(IsAcnnauto(newcar))
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GREY, "Koristi: /news [newstext]");
return 1;
}
new rtext[64];
if(PlayerInfo[playerid][pRank] == 1) { rtext = "Mladi Novinar"; }
else if(PlayerInfo[playerid][pRank] == 2) { rtext = "Novinar"; }
else if(PlayerInfo[playerid][pRank] == 3) { rtext = "Reporter"; }
else if(PlayerInfo[playerid][pRank] == 4) { rtext = "Stariji Novinar"; }
else if(PlayerInfo[playerid][pRank] == 5) { rtext = "Urednik"; }
else if(PlayerInfo[playerid][pRank] == 6) { rtext = "Glavni Urednik"; }
else { rtext = "Intern Worker"; }
format(string, sizeof(string), "Vijesti | %s %s |: %s", rtext, sendername, result);
OOCNews(COLOR_ORANGE,string);
PlayerInfo[playerid][pNewsSkill] ++;
if(PlayerInfo[playerid][pNewsSkill] == 50)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 2, soon you are able to Fly the News Chopper and talk Live."); }
else if(PlayerInfo[playerid][pNewsSkill] == 100)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 3, soon you are able to Fly the News Chopper and talk Live."); }
else if(PlayerInfo[playerid][pNewsSkill] == 200)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 4, you can fly the News Chopper now."); }
else if(PlayerInfo[playerid][pNewsSkill] == 400)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 5, you can now talk Live with any person you want."); }
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not a News Reporter !");
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Nisi u vozilu CNN-a");
}
}//not connected
return 1;
}
if(strcmp(cmd, "/news", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9)
{
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "You cannot speak, you have been silenced");
return 1;
}
new newcar = GetPlayerVehicleID(playerid);
if(IsAcnnauto(newcar))
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GREY, "Koristi: /news [newstext]");
return 1;
}
new rtext[64];
if(PlayerInfo[playerid][pRank] == 1) { rtext = "Mladi Novinar"; }
else if(PlayerInfo[playerid][pRank] == 2) { rtext = "Novinar"; }
else if(PlayerInfo[playerid][pRank] == 3) { rtext = "Reporter"; }
else if(PlayerInfo[playerid][pRank] == 4) { rtext = "Stariji Novinar"; }
else if(PlayerInfo[playerid][pRank] == 5) { rtext = "Urednik"; }
else if(PlayerInfo[playerid][pRank] == 6) { rtext = "Glavni Urednik"; }
else { rtext = "Intern Worker"; }
format(string, sizeof(string), "Vijesti | %s %s |: %s", rtext, sendername, result);
OOCNews(COLOR_ORANGE,string);
PlayerInfo[playerid][pNewsSkill] ++;
if(PlayerInfo[playerid][pNewsSkill] == 50)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 2, soon you are able to Fly the News Chopper and talk Live."); }
else if(PlayerInfo[playerid][pNewsSkill] == 100)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 3, soon you are able to Fly the News Chopper and talk Live."); }
else if(PlayerInfo[playerid][pNewsSkill] == 200)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 4, you can fly the News Chopper now."); }
else if(PlayerInfo[playerid][pNewsSkill] == 400)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 5, you can now talk Live with any person you want."); }
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not a News Reporter !");
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Nisi u vozilu CNN-a");
}
}//not connected
return 1;
}