09.03.2012, 19:57
When i try to make /ad "text 52+ characters" it dont show .. how can i make it to show when i type a text with 52+ characters ?
pawn Code:
if(strcmp(cmd, "/ad", true) == 0 || strcmp(cmd, "/advertise", true) == 0)//LS
{
if(IsPlayerConnected(playerid) && PlayerToPoint(3.0,playerid,844.7034,-1045.6367,25.4302))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "** You havent logged in yet !");
return 1;
}
if(PlayerInfo[playerid][pLevel] < 3)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "Trebuie sa ai level 3 ca sa poti folosi comanda /ad !");
return 1;
}
if(PlayerToPoint(3.0,playerid,848.9610,-1042.7968,25.5209))
{
SendClientMessage(playerid, COLOR_LIGHTRED, "Trebuie sa fi la CNN Studio sa poti da /ad !");
return 1;
}
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;
result[0] = toupper(result[0]);
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/ad)vertise [advert text]");
return 1;
}
if ((!adds) && (PlayerInfo[playerid][pAdmin] < 1))
{
format(string, sizeof(string), "** Please try again later %d seconds between Advertisements !", (addtimer/1000));
SendClientMessage(playerid, COLOR_GRAD2, string);
return 1;
}
new payout = idx * 5;
if(GetPlayerMoney(playerid) < payout)
{
format(string, sizeof(string), "** You used %d characters which cost $%s, you don't have enough.", offset, payout);
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
GivePlayerMoney(playerid, - payout);
SBizzInfo[7][sbTill] += payout;
ExtortionSBiz(7, payout);
format(string, sizeof(string), "{00D900}Advertisement: {FFFFFF}%s{00D900}, {00D900}Contact: {FFFFFF}%s {00D900}Tel: {FFFFFF}%d", result, sendername,PlayerInfo[playerid][pPnumber]);
OOCNews(TEAM_GROVE_COLOR,string);
format(string, sizeof(string), "~r~Paid $%d~n~~w~Message contained: %d Characters", payout, idx);
GameTextForPlayer(playerid, string, 5000, 1);
if (PlayerInfo[playerid][pAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;
}
}
return 1;
}