Command not working. - 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: Command not working. (
/showthread.php?tid=147359)
Command not working. -
ReactionGameServers - 11.05.2010
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;
}
Re: Command not working. -
Uninvited - 11.05.2010
The code isn't really "clean" you use playertopoint wrong u better remove the ! and switch it then it will work i think
Re: Command not working. -
ReactionGameServers - 11.05.2010
Edit : Doesnt matter i fixed it ! thanks for help
Re: Command not working. -
ReactionGameServers - 11.05.2010
edit : Sorry for double post i wasnt thinking
Re: Command not working. -
Uninvited - 11.05.2010
Ok nice