I have got a question -
Rufio - 21.07.2013
Hello guys. I am developing a construction system. Everything works just perfect.
But i need to take data from a dialog. Like if player wrote 7, the constructor will have to load his cement truck 7 times and unload it to the cknstruction area each time the truck gets loaded. Dialog and the other systems are ready. But i have to take the info about how many trucks of cement does he want. Is it possible ? If yes how ?
Re: I have got a question -
JimmyCh - 21.07.2013
I would say you can put it OnPlayerText, that if he types "7" and he's on the construction duty, then the rest of the code.
Example:
pawn Код:
if(text[0] == '7' && OnConstructionDuty(wtvr) == 1)
//
your code to load it 7 times
Re: I have got a question -
Rufio - 21.07.2013
Thank you very much ! It works !
But I have got another problem. When I go to cement truck and load and unload, my friend can't load it. It says your cement truck is being loaded but the success message appears on me.
Here is the codes:
pawn Код:
if(strcmp("/betonal", cmdtext, true, 10) == 0)
{
new State=GetPlayerState(playerid);
new playervehicleid = GetPlayerVehicleID(playerid);
if(IsABeton(playervehicleid) && State == PLAYER_STATE_DRIVER)
{
if(PlayerInfo[playerid][pFaction] == 15)
{
if(PlayerToPoint(4.0, playerid, -262.0264,-2175.5125,29.0102))
{
BilgiMesajiGonder(playerid, " Please wait while taking cement ! ");
GameTextForPlayer(playerid, " ~r~ Cement is ~g~ Being ~w~ Taken !", 20000, 3);
SetTimer("BetonAlirkene", 20000, true);
BetonVarMi[playerid] = 1;
TogglePlayerControllable(playerid, 0);
}
}
}
else if(!IsABeton(playervehicleid) && State == PLAYER_STATE_DRIVER)
{
HataMesajiGonder(playerid, " You aren't in a cement truck or you are not the driver !");
}
return 1;
}
and:
pawn Код:
new BetonVarMi[MAX_PLAYERS];
forward BetonDokerkene(playerid);
forward BetonAlirkene(playerid);
aaand:
pawn Код:
public BetonAlirkene(playerid)
{
TogglePlayerControllable(playerid, 1);
BilgiMesajiGonder(playerid, " Cement was successfully taken !");
return 1;
}
public BetonDokerkene(playerid)
{
TogglePlayerControllable(playerid, 1);
BilgiMesajiGonder(playerid, " Cement was succesfully unloaded !");
return 1;
}
and this is the unloading command which has the same bug:
pawn Код:
if(strcmp("/betondok", cmdtext, true, 10) == 0)
{
new State=GetPlayerState(playerid);
new playervehicleid = GetPlayerVehicleID(playerid);
if(IsABeton(playervehicleid) && State == PLAYER_STATE_DRIVER)
{
if(BetonVarMi[playerid] == 1)
{
SetTimer("BetonDokerkene", 20000, true);
TogglePlayerControllable(playerid, 0);
BilgiMesajiGonder(playerid, " Please wait while the cement is being unloaded ! ");
GameTextForPlayer(playerid, " ~r~ Cement is ~g~ Being ~w~ Unloaded!", 20000, 3);
BetonVarMi[playerid] = 0;
}
}
else if(BetonVarMi[playerid] == 0)
{
HataMesajiGonder(playerid, " Please load cement first ! ");
}
else if(!IsABeton(playervehicleid) && State == PLAYER_STATE_DRIVER)
{
HataMesajiGonder(playerid, " You are not in the cement truck or you are not the driver !");
}
return 1;
}
BTW HataMesajiGonder and BilgiMesajiGonder are scripted functions in my gamemode.
Re: I have got a question -
Rufio - 22.07.2013
Anybody.... ?
Re: I have got a question -
JimmyCh - 22.07.2013
I guess you can do the following:
pawn Код:
new BeingLoaded;
//Now under your cmd, where you load, put:
BeingLoaded = 1;
//After you're done loading,
BeingLoaded = 0;
//Also you can use this so if u start the cement job, u cant spam the cmd, u do BeingLoaded =1;
I hope you understand what I mean.