11.05.2010, 19:02
Hey i made a command to pickup packages from 2 locations, but in-game i goto those locations, do the command and it says i am not at the right place, i know i have put the right co-ords as i have tried them both with /gotocoord. But still i always get
Код:
You are not at a packages pickup!
pawn Код:
if(strcmp(cmd,"/getpackages",true)==0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You need to login first !");
return 1;
}
if(PlayerInfo[playerid][pJob] != 23)
{
SendClientMessage(playerid, COLOR_GREY, " You are not a Arms Dealer. ");
return 1;
}
if(!PlayerToPoint(2.0, playerid, 2392.6604,-2008.5042,13.5537) || !PlayerToPoint(2.0, playerid, 2392.6604,1423.0389,-1319.1559))
{
SendClientMessage(playerid, COLOR_RED, "You are not at a packages pickup!");
}
else
{
tmp = strtok(cmdtext, idx);
if(GetPlayerMoney(playerid) < 500)
{
SendClientMessage(playerid, COLOR_GREY, " You don't have enough money ! ");
return 1;
}
PlayerInfo[playerid][pPackages] += 10;
SafeGivePlayerMoney(playerid, - 500);
format(string, sizeof(string), " You have bought 10 Materials Packages for $500 !");
SendClientMessage(playerid, COLOR_GREY, string);
SendClientMessage(playerid, COLOR_GREY, "Take the packages to the Materials Factory");
if(PlayerToPoint(2.0, playerid, 2392.6604,-2008.5042,13.5537))
{
SetPlayerCheckpoint(playerid,2173.2195,-2264.8464,13.3527,8.0);
Package[playerid] = 1;
return 1;
}
else if(PlayerToPoint(2.0, playerid,2392.6604,1423.0389,-1319.1559))
{
SetPlayerCheckpoint(playerid,2287.9487,-1106.3082,37.9766,8.0);
Package[playerid] = 2;
return 1;
}
}
}
return 1;
}