08.10.2010, 12:25
(
Последний раз редактировалось Alex_Valde; 08.10.2010 в 12:41.
)
Hi, I need help with my script.
I made this so far...
This is when a player buys drug crate:
And this is when player arrives at checkpoint:
So when player arrives at checkpoint he should get money depending on his level.
But whenever I get to checkpoint it says: You have dropped off 0 Drug Packages for $0.
Why
EDIT: Nvm I didn't saw that I made big mistake.... :S
I made this so far...
This is when a player buys drug crate:
pawn Код:
COMMAND:buycrate(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 10.0, 348.1923, -115.6733, 1.2683))
if(PlayerInfo[playerid][Job] == 2)
{
if(GetPlayerMoney(playerid) < 1000)
{
SendClientMessage(playerid, COLOR_LIGHTRED, " You don't have a money to buy crate.");
SendClientMessage(playerid, COLOR_WHITE, "[HINT]: You need $1000 to buy crate.");
}
GivePlayerMoney(playerid, -1000);
GameTextForPlayer(playerid, "$ -1000", 5000, 1);
new name[128], file[128];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), "/users/%s.ini", name);
dini_IntSet(file, "Crates", PlayerInfo[playerid][Crates] = 1);
SendClientMessage(playerid, COLOR_WHITE, "** You bought Drug crates.");
PlayerInfo[playerid][Crates] = 1;
SetPlayerCheckpoint(playerid, 2760.5242, -1178.9475, 69.4001, 7.0);
IsSmuggling[playerid] = 1;
}
else { SendClientMessage(playerid, COLOR_LIGHTRED, "** You need to be Drug Smuggler.");
}
return 1;
}
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 7.0, 2760.5242,-1178.9475,69.4001))
{
if(IsSmuggling[playerid] == 1) {
/*GivePlayerMoney(playerid, 2000);
SendClientMessage(playerid,COLOR_YELLOW,"** Great Job! You got $2000 .");
*/IsSmuggling[playerid] = 0;
new name[128], file[128];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), "/users/%s.ini", name);
dini_IntSet(file, "Crates", PlayerInfo[playerid][Crates] = 0); // <------ This was the problem.... -.-"
DisablePlayerCheckpoint(playerid);
new payout, string[128];
PlayerInfo[playerid][SmuggleSkill] ++;
if(PlayerInfo[playerid][SmuggleSkill] == 50)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your Smuggling Skill is now Level 2, you will earn more Money when you drop off Smuggled Goods."); }
else if(PlayerInfo[playerid][SmuggleSkill] == 100)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your Smuggling Skill is now Level 3, you will earn more Money when you drop off Smuggled Goods."); }
else if(PlayerInfo[playerid][SmuggleSkill] == 200)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your Smuggling Skill is now Level 4, you will earn more Money when you drop off Smuggled Goods."); }
else if(PlayerInfo[playerid][SmuggleSkill] == 400)
{ SendClientMessage(playerid, COLOR_YELLOW, "* Your Smuggling Skill is now Level 5, you will earn more Money when you drop off Smuggled Goods."); }
new level = PlayerInfo[playerid][SmuggleSkill];
if(level >= 0 && level <= 50) {payout = (15)*(PlayerInfo[playerid][Crates]);}
if(level >= 51 && level <= 100) {payout = (18)*(PlayerInfo[playerid][Crates]);}
if(level >= 101 && level <= 200) {payout = (20)*(PlayerInfo[playerid][Crates]);}
if(level >= 201 && level <= 400) {payout = (23)*(PlayerInfo[playerid][Crates]);}
if(level >= 401 ) {payout = (28)*(PlayerInfo[playerid][Crates]);}
format(string, sizeof(string), "* You have dropped off %d Drug Packages for $%d.", PlayerInfo[playerid][Crates], payout);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GivePlayerMoney(playerid, payout);
PlayerInfo[playerid][Crates] = 0;
}
}
return 1;
}
But whenever I get to checkpoint it says: You have dropped off 0 Drug Packages for $0.
Why
EDIT: Nvm I didn't saw that I made big mistake.... :S