Guten tag liebe sa-mp.de Community, ich hätte eine kleine Frage bezüglich meines code!
Der code:
if(IsPlayerInRangeOfPoint(playerid,0.0, 2787.9729,-2436.3223,13.6336,269.3639))
Mir ist alles klar nur das eine "0.0,"
Das vor den Koordinaten, wollte mal fragen was das ist, was es bedeutet?
Könnte mir das jemand sagen?
(Um den zusammenhang zu sehen, ganzer Command:)
if(strcmp(cmd, "/buyprods", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new tmpcar = GetPlayerVehicleID(playerid);
new compcost = 50;
if(IsPlayerInRangeOfPoint(playerid,0.0, 2787.9729,-2436.3223,13.6336,269.3639))
{
if(!IsATruck(tmpcar))
{
if(PlayerHaul[tmpcar][pLoad] < PlayerHaul[tmpcar][pCapasity])
{
new amount;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "FEHLER: /buyprods [Menge]");
return 1;
}
amount = strval(tmp);
if(amount < 1 || amount > 500)
{
SendClientMessage(playerid, COLOR_GREY, " Die Menge muss zwischen 1 und 100 sein !");
return 1;
}
new check= PlayerHaul[tmpcar][pLoad] + amount;
if(check > PlayerHaul[tmpcar][pCapasity])
{
format(string, sizeof(string), " Du hast das Limit mit %d Prods erreicht, Produkte: %d.",PlayerHaul[tmpcar][pCapasity],PlayerHaul[tmpcar][pLoad]);
SendClientMessage(playerid, COLOR_GREY, string);
return 1;
}
new cost = amount*compcost;
if(GetPlayerMoney(playerid) >= cost)
{
PlayerHaul[tmpcar][pLoad] += amount;
format(string, sizeof(string), "Produkte: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "Du hast %d Produkte für $%d gekauft.", amount,cost);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
GivePlayerMoney(playerid,-cost);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
return 1;
}
else
{
format(string, sizeof(string), "Du kannst nicht %d Produkte für $%d anfordern!", amount,cost);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
}
else
{
format(string, sizeof(string), "Produkte: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
}
else
{
SendClientMessage(playerid, TEAM_GROVE_COLOR, "Dieses Fahrzeug kann keine Produkte ausliefern.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Du bist nicht an den LS Docks!");
return 1;
}
}
return 1;
}
{
if(IsPlayerConnected(playerid))
{
new tmpcar = GetPlayerVehicleID(playerid);
new compcost = 50;
if(IsPlayerInRangeOfPoint(playerid,0.0, 2787.9729,-2436.3223,13.6336,269.3639))
{
if(!IsATruck(tmpcar))
{
if(PlayerHaul[tmpcar][pLoad] < PlayerHaul[tmpcar][pCapasity])
{
new amount;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "FEHLER: /buyprods [Menge]");
return 1;
}
amount = strval(tmp);
if(amount < 1 || amount > 500)
{
SendClientMessage(playerid, COLOR_GREY, " Die Menge muss zwischen 1 und 100 sein !");
return 1;
}
new check= PlayerHaul[tmpcar][pLoad] + amount;
if(check > PlayerHaul[tmpcar][pCapasity])
{
format(string, sizeof(string), " Du hast das Limit mit %d Prods erreicht, Produkte: %d.",PlayerHaul[tmpcar][pCapasity],PlayerHaul[tmpcar][pLoad]);
SendClientMessage(playerid, COLOR_GREY, string);
return 1;
}
new cost = amount*compcost;
if(GetPlayerMoney(playerid) >= cost)
{
PlayerHaul[tmpcar][pLoad] += amount;
format(string, sizeof(string), "Produkte: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "Du hast %d Produkte für $%d gekauft.", amount,cost);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
GivePlayerMoney(playerid,-cost);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
return 1;
}
else
{
format(string, sizeof(string), "Du kannst nicht %d Produkte für $%d anfordern!", amount,cost);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
}
else
{
format(string, sizeof(string), "Produkte: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
return 1;
}
}
else
{
SendClientMessage(playerid, TEAM_GROVE_COLOR, "Dieses Fahrzeug kann keine Produkte ausliefern.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Du bist nicht an den LS Docks!");
return 1;
}
}
return 1;
}
MfG,
FabianLP!