Sweeper again - 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: Sweeper again (
/showthread.php?tid=184218)
Sweeper again -
geerdinho8 - 18.10.2010
They can join every marker just without an sweeper and at the end the dont get the money + exp.
Please hlep
pawn Code:
if(sweepercp[playerid] == 34)
{
for(new i; i < sizeof(sweeper); i++)
{
if(vehicleid == sweeper[i])
{
GivePlayerMoney(playerid, 5000);
PlayerInfo[i][pExp] ++;
SendClientMessage(playerid, COLOR_GREEN, "Well done buddy, you have cleaned some streets!");
SendClientMessage(playerid, COLOR_GREEN, "You have received $ 5000 and 1 exp.");
break;
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
}
return 1;
}
Re: Sweeper again -
JaTochNietDan - 18.10.2010
pawn Code:
if(sweepercp[playerid] == 34)
{
if(GetVehicleModel(vehicleid) == modelid) // Where modelid = model ID of sweeper vehicle in San Andreas, would be a lot more sufficient than that loop you have.
{
GivePlayerMoney(playerid, 5000);
PlayerInfo[i][pExp] ++;
SendClientMessage(playerid, COLOR_GREEN, "Well done buddy, you have cleaned some streets!");
SendClientMessage(playerid, COLOR_GREEN, "You have received $ 5000 and 1 exp.");
break; // Why?
}
else
{
SendClientMessage(playerid, COLOR_RED, "You need to be in a sweeper!");
SendClientMessage(playerid, COLOR_RED, "Type /stopjob if you want to stop with cleaning the city.");
}
return 1;
}
Hopefully that helps.
Re: Sweeper again -
geerdinho8 - 18.10.2010
Nope, that didnt help D:
Re: Sweeper again -
JaTochNietDan - 18.10.2010
Quote:
Originally Posted by geerdinho8
Nope, that didnt help D:
|
Why didn't it help? What went wrong and what do you need?
Re: Sweeper again -
geerdinho8 - 18.10.2010
When i just do the model(574), the same thing happens..
Re: Sweeper again -
JaTochNietDan - 18.10.2010
Quote:
Originally Posted by geerdinho8
When i just do the model(574), the same thing happens..
|
Did you take out the break;? And is the vehicleid actually gotten through some sort of method? Like GetPlayerVehicleID?
Re: Sweeper again -
geerdinho8 - 19.10.2010
everything will bug then.
Re: Sweeper again -
JaTochNietDan - 19.10.2010
Quote:
Originally Posted by geerdinho8
everything will bug then.
|
Why will it bug? Can we see more code? You're not really helping us help you.