03.02.2013, 13:47
Now i tried like this... But nothing
Or can someone post me an example how to do if is player near some vehicle to be able to type some command ?
pawn Код:
if(strcmp(cmd, "/news", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9)
{
// for(new i = 1; i < sizeof(mtvkoli); i++)
// {
// new Float:vehx, Float:vehy, Float:vehz;
// GetVehiclePos(i, vehx, vehy, vehz);
// if(IsPlayerInRangeOfPoint(playerid, 7.0, vehx,vehy,vehz))
// {
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, BLCRVENA, "{37F906}CMD INFO:{FFFFFF} /news [Text]");
return 1;
}
new rtext[64];
if(PlayerInfo[playerid][pRank] == 1) { rtext = "Kamerman"; }
else if(PlayerInfo[playerid][pRank] == 2) { rtext = "Reporter"; }
else if(PlayerInfo[playerid][pRank] == 3) { rtext = "Paparaco"; }
else if(PlayerInfo[playerid][pRank] == 4) { rtext = "Urednik"; }
else if(PlayerInfo[playerid][pRank] == 5) { rtext = "Producent"; }
else { rtext = "Kamerman"; }
format(string, sizeof(string), "[MTV Vesti] %s %s: %s", rtext, sendername, result);
OOCNews(COLOR_NEWS,string);
PlayerInfo[playerid][pNewsSkill] ++;
if(PlayerInfo[playerid][pNewsSkill] == 50)
{ SendClientMessage(playerid, BLCRVENA, "{E87A4A}* Vaseto iskustvo kako novinar se pokaci na nivo 2, nabrzo ke mozete da letate so helikopter i da pravite intervju."); }
else if(PlayerInfo[playerid][pNewsSkill] == 100)
{ SendClientMessage(playerid, BLCRVENA, "{E87A4A}* Vaseto iskustvo kako novinar se pokaci na nivo 3, nabrzo ke mozete da letate so helikopter i da pravite intervju."); }
else if(PlayerInfo[playerid][pNewsSkill] == 200)
{ SendClientMessage(playerid, BLCRVENA, "{E87A4A}* Vaseto iskustvo kako novinar se pokaci na nivo 2, sega mozete da letate so novinarskiot helikopter."); }
else if(PlayerInfo[playerid][pNewsSkill] == 400)
{ SendClientMessage(playerid, BLCRVENA, "{E87A4A}* Vaseto iskustvo kako novinar se pokaci na nivo 2, sega mozete da vodite intervju."); }
}
}
}
else
{
SendClientMessage(playerid, COLOR_YELLOW, "{F20000}GRESKA: {FFFFFF}Ne ste novinar !");
}
}//not connected
return 1;
}