SA-MP Forums Archive
/Getpizza - Crashing my server? - 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: /Getpizza - Crashing my server? (/showthread.php?tid=317638)



/Getpizza - Crashing my server? - RLGaming - 12.02.2012

Okay, here's the code:

CODE 1:
Quote:

Float:GetPizzaDistance(houseid)
{
new Float: pDistance;
pDistance = GetDistance(-1713.961425, 1348.545166, 7.180452, HouseInfo[houseid][hExteriorX], HouseInfo[houseid][hExteriorY], HouseInfo[houseid][hExteriorZ]);
return pDistance;
}

CODE 2:
Quote:

CMD:getpizza(playerid, params[])
{
if (PlayerInfo[playerid][pJob] != 21 && PlayerInfo[playerid][pJob2] != 21)
{
SendClientMessageEx(playerid,COLOR_GREY," You are not a Pizza Boy!");
return 1;
}
new vehicleid = GetPlayerVehicleID(playerid);
if(!(IsAPizzaCar(vehicleid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER))
{
SendClientMessageEx(playerid,COLOR_GREY," You need to be driving a pizzaboy found at the side of the Pizza Stack!");
return 1;
}
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
if (!IsPlayerInRangeOfPoint(playerid, 3.0, -1713.961425, 1348.545166, 7.180452))
{
SendClientMessageEx(playerid,COLOR_GREY," You are not at the Pizza Stack pickup!");
return 1;
}
if(GetPVarInt(playerid, "Pizza") > 0)
{
SendClientMessageEx(playerid, COLOR_GREY, " You are already delivering pizzas!");
return 1;
}

new rand = random(MAX_HOUSES - 1);
while(!(HouseInfo[rand][hExteriorZ] <= 100 && HouseInfo[rand][hExteriorX] > -2802.389648 && HouseInfo[rand][hExteriorX] < -1523.710327 && HouseInfo[rand][hExteriorY] < 1334.343750 && HouseInfo[rand][hExteriorY] > -216.298019))
{
rand++;
if(rand == 1400) {
rand = 1;
}
}
SetPVarInt(playerid, "tpPizzaTimer", floatround((GetPizzaDistance(rand) / 80), floatround_round));
SetPVarInt(playerid, "pizzaTotal", floatround((GetPizzaDistance(rand) / 10), floatround_round));
SetPVarInt(playerid, "pizzaTimer", GetPVarInt(playerid, "pizzaTotal"));
SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_TPPIZZARUNTIMER);
SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_PIZZATIMER);
new szMessage[128];
format(szMessage, sizeof(szMessage), "You have picked up a pizza for %s. You have %d seconds to deliver it!", HouseInfo[rand][hOwner], GetPVarInt(playerid, "pizzaTotal"));
SendClientMessageEx(playerid, COLOR_WHITE, szMessage);
SetPVarInt(playerid, "Pizza", rand);
PizzaBar[playerid] = CreateProgressBar(258.00, 137.00, 131.50, 3.19, COLOR_GREEN, 100.0);
SetProgressBarValue(PizzaBar[playerid], 100.0);
ShowProgressBarForPlayer(playerid, PizzaBar[playerid]);
SetPlayerCheckpoint(playerid, HouseInfo[rand][hExteriorX], HouseInfo[rand][hExteriorY], HouseInfo[rand][hExteriorZ], 5);
return 1;
}

Any help, someone?

It crashes's my server.. When i do /getpizza it says im not on the bike or haven't got the job but when i have the job and im on the pizza bike and at the point the server crashes..

Help!


Re: /Getpizza - Crashing my server? - Scenario - 12.02.2012

Quit using the NGG/NGRP script!


Re: /Getpizza - Crashing my server? - RLGaming - 12.02.2012

Mine's heavily edited, so no, go away, NG aren't bothered about anyone using it.

OT: Anyone got any ideas?


Re: /Getpizza - Crashing my server? - Dr.Heinz - 12.02.2012

stop using NGRP script. you will get negative answer. don't waste your time kiddo


Re: /Getpizza - Crashing my server? - RLGaming - 12.02.2012

Im not that good at scripting, hence why im using the NG script, just like most of the servers now a days, please, stop going on about it for god sake, if you want to rant PM me.

OT: Anyone!?


Re: /Getpizza - Crashing my server? - [HK]Ryder[AN] - 12.02.2012

You have already created a thread in server support.
And using ngrp script = ban


Re: /Getpizza - Crashing my server? - Scenario - 12.02.2012

Quote:
Originally Posted by RLGaming
Посмотреть сообщение
Mine's heavily edited, so no, go away, NG aren't bothered about anyone using it.

OT: Anyone got any ideas?
Actually, they do. The script was leaked by some immature ex-developers of NGG and they don't want people using it. Just so you know, using the script will get your server blacklisted from the master-list.


Re: /Getpizza - Crashing my server? - ReneG - 12.02.2012

First of all, stop using their script for the following reasons.
NGRP's script was created by geniuses. It is a large complex piece of code that was not meant for one person such as yourself to handle. That is why there are multiple scripters. You're new, go download a base RP script and just use the NGRP one as a reference. Stop fooling yourself, this script isn't a piece of cake.


Re: /Getpizza - Crashing my server? - Lynn - 12.02.2012

Quote:
Originally Posted by RLGaming
Посмотреть сообщение
Mine's heavily edited, so no, go away, NG aren't bothered about anyone using it.

OT: Anyone got any ideas?
Actually, we are bothered by it.
Our script was leaked by someone(Won't say who.) that use to be on the team for us(NGG).
Although the script is very out-dated, it's still not yours to use.
As you contributed nothing to the development of it.

Quote:
Originally Posted by RLGaming
Посмотреть сообщение
Im not that good at scripting, hence why im using the NG script, just like most of the servers now a days, please, stop going on about it for god sake, if you want to rant PM me.

OT: Anyone!?
If you're new to scripting, this is not the script to start off.
It's actually a very-complex script(I know, as I'm one of the original developers of it.)
By using it you're not learning anything, since you can't examine a simple command to figure out your problem.
I suggest you delete the script, and use a released script(From SAMP forums, that is actually allowed.) before you get black-listed from SAMP(Your server.) for using what is technically stolen material.


Re: /Getpizza - Crashing my server? - nguyenquynh - 29.01.2013

CMD:getpizza(playerid, params[]) {
if(PlayerInfo[playerid][pJob] != 21 && PlayerInfo[playerid][pJob2] != 21) {
SendClientMessageEx(playerid,COLOR_GREY," You are not a Pizza Boy!");
}
else if(!IsAPizzaCar(GetPlayerVehicleID(playerid))) {
SendClientMessageEx(playerid,COLOR_GREY," You need to be driving a pizzaboy found at the side of the Pizza Stack!");
}
else if(GetPlayerSkin(playerid) != 155) {
SendClientMessageEx(playerid,COLOR_GREY," You need to be in the Pizza Stack uniform!");
}
else if(GetPVarType(playerid, "Pizza")) {
SendClientMessageEx(playerid, COLOR_GREY, " You are already delivering pizzas!");
}
else if(!IsPlayerInRangeOfPoint(playerid, 3.0, -1713.961425, 1348.545166, 7.180452)) {
SendClientMessageEx(playerid,COLOR_GREY," You are not at the Pizza Stack pickup!");
}
else {

new rand = random(MAX_HOUSES - 1);
while(!(HouseInfo[rand][hOwned] && HouseInfo[rand][hExteriorZ] <= 100 && HouseInfo[rand][hExteriorX] > -2802.389648 && HouseInfo[rand][hExteriorX] < -1400.710327 && HouseInfo[rand][hExteriorY] < 2800 && HouseInfo[rand][hExteriorY] > -216.298019)) {
if(++rand >= MAX_HOUSES) {
rand = 0;
}
}

new
iDist = floatround(GetPlayerDistanceFromPoint(playerid, HouseInfo[rand][hExteriorX], HouseInfo[rand][hExteriorY], HouseInfo[rand][hExteriorZ])),
szMessage[86];

SetPVarInt(playerid, "tpPizzaTimer", iDist / 80);
SetPVarInt(playerid, "pizzaTotal", iDist / 10);
SetPVarInt(playerid, "pizzaTimer", iDist / 10);
SetPVarInt(playerid, "Pizza", rand);

SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_TPPIZZARUNTIMER);
SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_PIZZATIMER);

format(szMessage, sizeof(szMessage), "Ban da chon mot Pizza cho %s. Ban co %d giay de giao!", HouseInfo[rand][hOwner], iDist / 10);
SendClientMessageEx(playerid, COLOR_WHITE, szMessage);

SetPlayerCheckpoint(playerid, HouseInfo[rand][hExteriorX], HouseInfo[rand][hExteriorY], HouseInfo[rand][hExteriorZ], 5);
}
return 1;
} Please Help My