HELP Cmd doesn't Work. - 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)
+--- Thread: HELP Cmd doesn't Work. (
/showthread.php?tid=527382)
HELP Cmd doesn't Work. -
dodowi - 22.07.2014
Код:
CMD:getcrate(playerid, params[])
{
if (PlayerInfo[playerid][pJob] != 14 && PlayerInfo[playerid][pJob2] != 14)
{
SendClientMessageEx(playerid,COLOR_GREY," You are not Drug Job!");
return 1;
}
new mypoint = -1;
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
for (new i=0; i<MAX_POINTS; i++)
{
if (IsPlayerInRangeOfPoint(playerid, 3.0, Points[i][Pointx], Points[i][Pointy], Points[i][Pointz]) && strcmp(Points[i][Name], "Drug Factory", true) == 0)
{
mypoint = i;
}
}
if (mypoint == -1)
{
SendClientMessageEx(playerid, COLOR_GREY, " You are not at the Drug Factory!");
return 1;
}
if(PlayerInfo[playerid][pCrates])
{
SendClientMessageEx(playerid, COLOR_GREY, " You can't Blablabla");
return 1;
}
if(GetPlayerCash(playerid) > 1000)
{
SendClientMessageEx(playerid, COLOR_LIGHTRED,"What type of drugs would you like to smuggle? (Type crack or pot)");
SetPVarInt(playerid, "ChoosingDrugs", 1);
return 1;
}
else
{
SendClientMessageEx(playerid, COLOR_GREY," You can't afford the $1000!");
return 1;
}
}
When i Go to That point and Type /Getcrate and that CMD said "You are not at the Drug Factory" I just entered Drug Factory Door and goto that Coordinates . Please help me.
Re: HELP Cmd doesn't Work. -
Shinta307 - 22.07.2014
Код:
if (IsPlayerInRangeOfPoint(playerid, 3.0, Points[i][Pointx], Points[i][Pointy], Points[i][Pointz]) && strcmp(Points[i][Name], "Drug Factory", true) == 0)
{
mypoint = i;
}
See ? Cordinates ?
For example
Код:
if (IsPlayerInRangeOfPoint(playerid,2205.76,1580.31,999.98,1.0) && strcmp(Points[i][Name], "Drug Factory", true) == 0)
{
mypoint = i;
}
Re: HELP Cmd doesn't Work. -
dodowi - 22.07.2014
Its Working now , But When he ask this "What type of drugs would you like to smuggle? (Type crack or pot)" I type "Crack" And he said "You Are not At Drug Factory " Agaainnn
Re: HELP Cmd doesn't Work. -
ShinichiKudou - 22.07.2014
pawn Код:
CMD:getcrate(playerid, params[])
{
if (PlayerInfo[playerid][pJob] != 14 && PlayerInfo[playerid][pJob2] != 14)
{
SendClientMessageEx(playerid,COLOR_GREY," You are not Drug Job!");
return 1;
}
new mypoint = -1;
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
for (new i=0; i<MAX_POINTS; i++)
{
if (IsPlayerInRangeOfPoint(playerid,2205.76,1580.31,999.98,1.0) && strcmp(Points[i][Name], "Drug Factory", true) == 0)
{
mypoint = i;
}
}
if(PlayerInfo[playerid][pCrates])
{
SendClientMessageEx(playerid, COLOR_GREY, " You can't Blablabla");
return 1;
}
if(GetPlayerCash(playerid) > 1000)
{
SendClientMessageEx(playerid, COLOR_LIGHTRED,"What type of drugs would you like to smuggle? (Type crack or pot)");
SetPVarInt(playerid, "ChoosingDrugs", 1);
return 1;
}
else
{
SendClientMessageEx(playerid, COLOR_GREY," You can't afford the $1000!");
return 1;
}
}
quick fix

he keeped bugging me on ******** (dont put comments for this code)
Re: HELP Cmd doesn't Work. -
dodowi - 22.07.2014
I got one Warning
Код:
warning 204: symbol is assigned a value that is never used: "mypoint"
And this Cmd still doesnt work , When i type CMD "/getcrate" And he asked " What type of drugs would you like to smuggle? (Type crack or pot)" And i type "Crack" And system said "You are not at Drug Factory"