Problem with scipting - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem with scipting (
/showthread.php?tid=249699)
Problem with scipting -
eRroR95 - 20.04.2011
Hei
I scripting my RolePlay server and i have a problem ...
I chanaged /ad script.
Old one is this.
Код:
//----------------------------------[advertise]-----------------------------------------------
if(strcmp(cmd, "/advertise", true) == 0 || strcmp(cmd, "/ad", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "** You havent logged in yet !");
return 1;
}
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "You cannot speak, you have been silenced");
return 1;
}
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, "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;
}
SafeGivePlayerMoney(playerid, -50);
format(string, sizeof(string), "ADVERTISEMENT: %s, contact %s (Phone: %d)", result, sendername ,PlayerInfo[playerid][pPnumber]);
SendClientMessageToAll(COLOR_ORANGE,string);
GameTextForPlayer(playerid, "~w~Advertisement ~n~~w~Price:~g~$50", 4321,1);
if (PlayerInfo[playerid][pAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;}
new y,m,d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string, sizeof(string), "[%d/%d/%d](%d:%d:%d) %s (Advertisement): %s",d,m,y,h,mi,s, sendername, result);
ChatLog(string);
}
return 1;
}
New one is this:
Код:
//----------------------------------[advertise]-----------------------------------------------
if(strcmp(cmd, "/advertise", true) == 0 || strcmp(cmd, "/ad", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You havent logged in yet !");
return 1;
}
if(PlayerInfo[playerid][pLevel] < 2)
{
SendClientMessage(playerid, COLOR_GREY, " You have to be level 2 to use this function !");
return 1;
}
if(!PlayerToPoint(3.0,playerid,359.6820,207.0294,1008.3828))
{
SendClientMessage(playerid, COLOR_GREY, " You are not at ABC studio !");
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;
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 $%d, you don't have enough.", offset, payout);
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
SafeGivePlayerMoney(playerid, - payout);
SBizzInfo[7][sbTill] += payout;
ExtortionSBiz(7, payout);
format(string, sizeof(string), "[Advert] %s, Phone: %d", result, 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;
}
So, when I press F5 and i wait when he convert then I get that error:
Код:
C:\Users\Hardo\Desktop\Fort Carsson\gamemodes\SRP.pwn(38613) : error 004: function "PlayerToPoint" is not implemented
Can somebody help me ? My idea is this like if I somebody want something to advert then he/she needs to go somevare like ABC studo to do his adver
Can somebody help me ? :/
Re: Problem with scipting -
BASITJALIL - 20.04.2011
Hey post 36613 line
Re: Problem with scipting -
SomebodyAndMe - 20.04.2011
Try to use this:
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Re: Problem with scipting -
eRroR95 - 20.04.2011
To: Somebodyandme
Thanks dude, it's work now
Thankyou
Re: Problem with scipting -
SomebodyAndMe - 21.04.2011
Np.