Drugs - The cmd i got here with errors -
Chivava - 22.01.2010
Hello i've put this into my gamemode but apparently it wont let me get it correctly added..
I dont actually get whats wrong since i've used playertopoint in /materials too and it worked well.
Код:
if(strcmp(cmd,"/get",true)==0)
{
if(IsPlayerConnected(playerid))
{
new x_job[256];
x_job = strtok(cmdtext, idx);
if(!strlen(x_job)) {
SendClientMessage(playerid, COLOR_WHITE, "|__________________ Get __________________|");
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /get [name]");
SendClientMessage(playerid, COLOR_GREY, "Available names: Drugs");
SendClientMessage(playerid, COLOR_GREEN, "|_________________________________________|");
return 1;
}
if(strcmp(x_job,"drugs",true) == 0)
{
if(PlayerInfo[playerid][pDrugs] > 15)
{
format(string, sizeof(string), " You still have %d grams with you, sell them first !", PlayerInfo[playerid][pDrugs]);
SendClientMessage(playerid, COLOR_GREY, string);
return 1;
}
new tel;
new price;
new ammount;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /get drugs [ammount]");
return 1;
}
new level = PlayerInfo[playerid][pDrugsSkill];
ammount = strval(tmp);
if(level >= 0 && level <= 50)
{ tel = 200; if(ammount < 1 || ammount > 6) { SendClientMessage(playerid, COLOR_GREY, " You cant go below 1 or above 6 at your Skill Level!"); return 1; } }
else if(level >= 51 && level <= 100)
{ tel = 150; if(ammount < 1 || ammount > 12) { SendClientMessage(playerid, COLOR_GREY, " You cant go below 1 or above 12 at your Skill Level!"); return 1; } }
else if(level >= 101 && level <= 200)
{ tel = 100; if(ammount < 1 || ammount > 20) { SendClientMessage(playerid, COLOR_GREY, " You cant go below 1 or above 20 at your Skill Level!"); return 1; } }
else if(level >= 201 && level <= 400)
{ tel = 50; if(ammount < 1 || ammount > 30) { SendClientMessage(playerid, COLOR_GREY, " You cant go below 1 or above 30 at your Skill Level!"); return 1; } }
else if(level >= 401)
{ tel = 10; if(ammount < 1 || ammount > 99) { SendClientMessage(playerid, COLOR_GREY, " You cant go below 1 or above 99 at your Skill Level!"); return 1; } }
if(PlayerToPoint(2.0, playerid, 323.0342,1118.5804,1083.8828))
{
price = ammount * tel;
if(GetPlayerMoney(playerid) > price)
{
format(string, sizeof(string), "* You bought %d grams for $%d.", ammount, price);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GivePlayerMoney(playerid, -price);
PlayerInfo[playerid][pDrugs] = ammount;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You cant afford the Drugs !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not a Drugs Dealer, or not at the Cracker House !");
return 1;
}
}
Errors
Код:
C:\Users\Simon\Desktop\GTA\GTARP\gamemodes\gtarp.pwn(1728) : error 004: function "SafeGivePlayerMoney" is not implemented
C:\Users\Simon\Desktop\GTA\GTARP\gamemodes\gtarp.pwn(1757) : error 004: function "SafeGivePlayerMoney" is not implemented
C:\Users\Simon\Desktop\GTA\GTARP\gamemodes\gtarp.pwn(1793) : error 004: function "SafeResetPlayerWeapons" is not implemented
C:\Users\Simon\Desktop\GTA\GTARP\gamemodes\gtarp.pwn(1794) : error 004: function "SafeGivePlayerWeapon" is not implemented
C:\Users\Simon\Desktop\GTA\GTARP\gamemodes\gtarp.pwn(1821) : error 004: function "SafeResetPlayerWeapons" is not implemented
C:\Users\Simon\Desktop\GTA\GTARP\gamemodes\gtarp.pwn(2292) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Simon\Desktop\GTA\GTARP\gamemodes\gtarp.pwn(2303) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Simon\Desktop\GTA\GTARP\gamemodes\gtarp.pwn(2315) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Simon\Desktop\GTA\GTARP\gamemodes\gtarp.pwn(2319) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Simon\Desktop\GTA\GTARP\gamemodes\gtarp.pwn(2331) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Simon\Desktop\GTA\GTARP\gamemodes\gtarp.pwn(2335) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Simon\Desktop\GTA\GTARP\gamemodes\gtarp.pwn(2339) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Simon\Desktop\GTA\GTARP\gamemodes\gtarp.pwn(2343) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Simon\Desktop\GTA\GTARP\gamemodes\gtarp.pwn(2347) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Simon\Desktop\GTA\GTARP\gamemodes\gtarp.pwn(2351) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Simon\Desktop\GTA\GTARP\gamemodes\gtarp.pwn(2355) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Simon\Desktop\GTA\GTARP\gamemodes\gtarp.pwn(2359) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Simon\Desktop\GTA\GTARP\gamemodes\gtarp.pwn(2371) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Simon\Desktop\GTA\GTARP\gamemodes\gtarp.pwn(2375) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Simon\Desktop\GTA\GTARP\gamemodes\gtarp.pwn(2379) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Simon\Desktop\GTA\GTARP\gamemodes\gtarp.pwn(2383) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Simon\Desktop\GTA\GTARP\gamemodes\gtarp.pwn(2387) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Simon\Desktop\GTA\GTARP\gamemodes\gtarp.pwn(2399) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Simon\Desktop\GTA\GTARP\gamemodes\gtarp.pwn(2403) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Simon\Desktop\GTA\GTARP\gamemodes\gtarp.pwn(2407) : error 004: function "PlayerToPoint" is not implemented
C:\Users\Simon\Desktop\GTA\GTARP\gamemodes\gtarp.pwn(2419) : error 004: function "PlayerToPoint" is not implemented
Re: Drugs - The cmd i got here with errors -
KnooL - 22.01.2010
IsPlayerInRangeOfPoint is faster then PlayerToPoint (
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint)
Also edit the following:
all SafeGivePlayerMoney to GivePlayerMoney (
https://sampwiki.blast.hk/wiki/GivePlayerMoney)
all SafeResetPlayerWeapons to ResetPlayerWeapons (
https://sampwiki.blast.hk/wiki/ResetPlayerWeapons)
all SafeGivePlayerWeapon to GivePlayerWeapon (
https://sampwiki.blast.hk/wiki/GivePlayerWeapon)
Re: Drugs - The cmd i got here with errors -
Chivava - 22.01.2010
When i do that, i just get 26 new errors + lots of warnings.
Re: Drugs - The cmd i got here with errors -
KnooL - 22.01.2010
If you looked at the links I gave you, you would know that you needed to change some things.
pawn Код:
IsPlayerInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z)
PlayerToPoint(Float:radius, playerid, Float:x, Float:y, Float:z)
In your script (THESE ARE JUST EXAMPLES):
pawn Код:
PlayerToPoint(2,playerid,0,0,0)
that must be
pawn Код:
IsPlayerInRageOfPoint(playerid,2,0,0,0)
also could you post me your errors and warnings?
Re: Drugs - The cmd i got here with errors -
Chivava - 22.01.2010
Okay i'll try what you just said and then post errors in a 5mins.
Re: Drugs - The cmd i got here with errors -
Chivava - 22.01.2010
Okay.. before i got the error:
undefined symbol "PlayerToPoint"
Now i get
function "IsPlayerInRageOfPoint" is not implemented
Re: Drugs - The cmd i got here with errors -
Nakash - 22.01.2010
It is not his problem,he did something wrong his his code.
He forgot a { or something like that,i am working on it..i will find it for you - i will edit this soon.
Re: Drugs - The cmd i got here with errors -
KnooL - 22.01.2010
Do you use 0.2 or 0.3?
Re: Drugs - The cmd i got here with errors -
JoeDaDude - 22.01.2010
-Cough- function "IsPlayerIn
RageOfPoint" is not implemented
Assuming you didnt write the error into sa-mp forums
Re: Drugs - The cmd i got here with errors -
KnooL - 22.01.2010
LOL Didn't even notice it, well noticed Joe.