I need help with drug smuggling checkpoint -
William1122 - 20.01.2013
After the smuggler gets his crates he needs to head to checkpoint and usually you should get money when you arrive at the checkpoint. But instead.. the checkpoint dissappears and you get no money and you keep the crate does anyone know how to fix that? Here is the code:
If you need anything else just reply, Thanks for your help.
Код:
if(GetPVarInt(playerid, "ChoosingDrugs") == 1)
{
if (strcmp("pot", text, true) == 0)
{
new mypoint = -1;
for (new i=0; i<MAX_POINTS; i++)
{
if (IsPlayerInRangeOfPoint(playerid, 10.0, 2205.6875,1582.8101,999.9766))
{
mypoint = i;
}
}
if (mypoint == -1)
{
SendClientMessageEx(playerid, COLOR_GREY, " You are not at the Drug Factory!");
return 0;
}
if(PlayerInfo[playerid][pCrates])
{
SendClientMessageEx(playerid, COLOR_GREY, " You can't hold any more Drug Crates!");
SetPVarInt(playerid, "ChoosingDrugs", 0);
return 0;
}
if(GetPlayerCash(playerid) > 1000)
{
SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You bought some Drug Crates for $1000.");
GivePlayerCash(playerid, -1000);
PlayerInfo[playerid][pCrates] = 1;
SetPVarInt(playerid, "CrateDeliver", 1);
SetPVarInt(playerid, "ChoosingDrugs", 0);
SetPVarInt(playerid, "tpDrugRunTimer", 45);
SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_TPDRUGRUNTIMER);
SetPlayerCheckpoint(playerid, 2166.3772,-1675.3829,15.0859, 3);
for(new i = 0; i < sizeof(FamilyInfo); i++)
{
if(strcmp(Points[mypoint][Owner], FamilyInfo[i][FamilyName], true) == 0)
{
FamilyInfo[i][FamilyBank] += 500;
}
}
return 0;
}
else
{
SendClientMessageEx(playerid, COLOR_GREY," You can't afford the $1000!");
SetPVarInt(playerid, "ChoosingDrugs", 0);
return 0;
}
}
else if (strcmp("crack", text, true) == 0)
{
new mypoint = -1;
for (new i=0; i<MAX_POINTS; i++)
{
if (IsPlayerInRangeOfPoint(playerid, 10.0, 2205.6875,1582.8101,999.9766))
{
mypoint = i;
}
}
if (mypoint == -1)
{
SendClientMessageEx(playerid, COLOR_GREY, " You are not at the Drug Factory!");
return 0;
}
if(PlayerInfo[playerid][pCrates])
{
SendClientMessageEx(playerid, COLOR_GREY, " You can't hold any more drug crates!");
SetPVarInt(playerid, "ChoosingDrugs", 0);
return 0;
}
if(GetPlayerCash(playerid) > 1000)
{
SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You bought some drug crates for $1000.");
GivePlayerCash(playerid, -1000);
PlayerInfo[playerid][pCrates] = 1;
SetPVarInt(playerid, "CrateDeliver", 2);
SetPVarInt(playerid, "ChoosingDrugs", 0);
SetPVarInt(playerid, "tpDrugRunTimer", 45);
SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_TPDRUGRUNTIMER);
SetPlayerCheckpoint(playerid, 2354.2808,-1169.2959,28.0066, 3);
for(new i = 0; i < sizeof(FamilyInfo); i++)
{
if(strcmp(Points[mypoint][Owner], FamilyInfo[i][FamilyName], true) == 0)
{
FamilyInfo[i][FamilyBank] += 500;
}
}
return 0;
}
else
{
SendClientMessageEx(playerid, COLOR_GREY," You can't afford the $1000!");
SetPVarInt(playerid, "ChoosingDrugs", 0);
return 0;
}
}
else
{
SendClientMessageEx(playerid, COLOR_LIGHTRED,"What type of drugs would you like to smuggle? Type 'crack' or 'pot'.");
return 0;
Respuesta: I need help with drug smuggling checkpoint -
William1122 - 20.01.2013
No one got any solution?
Re: I need help with drug smuggling checkpoint -
Scrillex - 20.01.2013
GivePlayerMoney(playerid,yourmoneyamount); (do it in check point!
Respuesta: I need help with drug smuggling checkpoint -
William1122 - 20.01.2013
Ok thanks iknow how to give money now but how do i make it to give him money when he arrives at the checkpoint
Respuesta: I need help with drug smuggling checkpoint -
William1122 - 20.01.2013
I also found this :
Код:
if(Points[h][Type] == 3 && GetPVarInt(playerid, "CrateDeliver") == 1 && IsPlayerInRangeOfPoint(playerid, 6.0, 2166.3772,-1675.3829,15.0859))
{
new string[128];
if(GetPVarInt(playerid, "tpDrugRunTimer") != 0)
{
format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) is possibly teleport drugrunning.", GetPlayerNameEx(playerid), playerid);
ABroadCast( COLOR_YELLOW, string, 2 );
format(string, sizeof(string), "%s (ID %d) is possibly teleport drugrunning.", GetPlayerNameEx(playerid), playerid);
Log("logs/hack.log", string);
}
DisablePlayerCheckpoint(playerid);
new level = PlayerInfo[playerid][pSmugSkill];
if(level >= 0 && level <= 20)
{
SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You received $1250 for delivering the Drug Crates.");
GivePlayerCash(playerid, 1250);
}
else if(level >= 21 && level <= 50)
{
SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You received $1500 for delivering the Drug Crates.");
GivePlayerCash(playerid, 1500);
}
else if(level >= 51 && level <= 100)
{
SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You received $2000 for delivering the Drug Crates.");
GivePlayerCash(playerid, 2000);
}
else if(level >= 101 && level <= 200)
{
SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You received $3000 for delivering the Drug Crates.");
GivePlayerCash(playerid, 3000);
}
else if(level >= 201)
{
SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You received $4000 for delivering the Drug Crates.");
GivePlayerCash(playerid, 4000);
}
DeletePVar(playerid, "CrateDeliver");
PlayerInfo[playerid][pCrates] = 0;
Points[h][Stock] += 10;
PlayerInfo[playerid][pSmugSkill]++;
format(string, sizeof(string), " POT AVAILABLE: %d/1000.", Points[h][Stock]);
UpdateDynamic3DTextLabelText(Points[h][TextLabel], COLOR_YELLOW, string);
return 1;
}
else if(Points[h][Type] == 4 && GetPVarInt(playerid, "CrateDeliver") == 2 && IsPlayerInRangeOfPoint(playerid, 6.0, 2354.2808,-1169.2959,28.0066))
{
new string[128];
if(GetPVarInt(playerid, "tpDrugRunTimer") != 0)
{
format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) is possibly teleport drugrunning.", GetPlayerNameEx(playerid), playerid);
ABroadCast( COLOR_YELLOW, string, 2 );
format(string, sizeof(string), "%s (ID %d) is possibly teleport drugrunning.", GetPlayerNameEx(playerid), playerid);
Log("logs/hack.log", string);
}
DisablePlayerCheckpoint(playerid);
new level = PlayerInfo[playerid][pSmugSkill];
if(level >= 0 && level <= 20)
{
SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You received $1250 for delivering the Drug Crates.");
GivePlayerCash(playerid, 1250);
}
else if(level >= 21 && level <= 50)
{
SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You received $1500 for delivering the Drug Crates.");
GivePlayerCash(playerid, 1500);
}
else if(level >= 51 && level <= 100)
{
SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You received $2000 for delivering the Drug Crates.");
GivePlayerCash(playerid, 2000);
}
else if(level >= 101 && level <= 200)
{
SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You received $3000 for delivering the Drug Crates.");
GivePlayerCash(playerid, 3000);
}
else if(level >= 201)
{
SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"* You received $4000 for delivering the Drug Crates.");
GivePlayerCash(playerid, 4000);
}
DeletePVar(playerid, "CrateDeliver");
PlayerInfo[playerid][pCrates] = 0;
Points[h][Stock] += 10;
PlayerInfo[playerid][pSmugSkill]++;
format(string, sizeof(string), " CRACK AVAILABLE: %d/1000.", Points[h][Stock]);
UpdateDynamic3DTextLabelText(Points[h][TextLabel], COLOR_YELLOW, string);
return 1;
}
But when you arrive at the checkpoint nothing happens
Re: I need help with drug smuggling checkpoint -
Scrillex - 20.01.2013
if (IsPlayerInRangeOfPoint(playerid, 10.0, 2205.6875,1582.8101,999.9766))
{
mypoint = i;
GivePlayerMoney(playerid,yourmoneyamount);
}
EDIT:maybe you are using [pMoney] on player data saving.
Respuesta: I need help with drug smuggling checkpoint -
William1122 - 21.01.2013
The only thing that does is give you money after you buy the crates not when you deliver them? I think the last code has something to do with it theres something wrong in there anyone that can find what?
Re: I need help with drug smuggling checkpoint -
Scrillex - 21.01.2013
You see if player isinrangeofpoint so it will give the player money +your amount...
Respuesta: I need help with drug smuggling checkpoint -
William1122 - 21.01.2013
Well I tought maybe the problem was that instead of(in the last code) using GivePlayerCash it's GivePlayerMoney but that didn't really help me out
Respuesta: I need help with drug smuggling checkpoint -
William1122 - 21.01.2013
What I need is that if you reach the checkpoint you get X amount of money and you lose the crate.
I appreciate the help ofcourse, But what I want is to see the problem there is in the last code, I mean I can't really put my finger on it everything seems right cause I want that each players gets a different amount of money despiting their drug smuggler level.