MissionText - 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: MissionText (
/showthread.php?tid=654336)
MissionText -
KamilPolska - 26.05.2018
I have a problem. After reaching the checkpoint. I get the message "The player KamilPolska delivered the unloading to the H". Why does it show one letter "H"? And not "Hospital LV"
Код:
enum MissionLocationData
{
ID_Mission,
NamePoint[128],
Float:UnloadX,
Float:UnloadY,
Float:UnloadZ,
Pay,
PayScore
}
new MissionLocation[][MissionLocationData] =
{
{0, "Hospital LV", 1632.0656, 1825.9324, 10.8203, 2750, 10},
};
Код:
new i_Pay[MAX_PLAYERS], i_PayScore[MAX_PLAYERS], MissionStatus[MAX_PLAYERS], i_MissionText[MAX_PLAYERS];
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch (dialogid)
{
case DIALOG_MISSIONS1:
{
if(response)
{
MissionStatus[playerid] = 1;
new Float:x, Float:y, Float:z;
x = MissionLocation[0][UnloadX];
y = MissionLocation[0][UnloadY];
z = MissionLocation[0][UnloadZ];
i_Pay[playerid] = MissionLocation[0][Pay];
i_PayScore[playerid] = MissionLocation[0][PayScore];
i_MissionText[playerid] = MissionLocation[0][NamePoint];
SetPlayerCheckpoint(playerid, x, y, z, 5);
SendClientMessage(playerid, COLOR_BLACK, "{FFFFFF}Go to point!");
}
else
{
return Mission_Cancel(playerid);
}
}
default: return 0;
}
return 1;
}
Код:
stock CheckpointEntered(playerid)
{
new vID = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vID) == 403 || GetVehicleModel(vID) == 515 || GetVehicleModel(vID) == 514)
{
if(IsTrailerAttachedToVehicle(vID))
{
if(MissionStatus[playerid] == 1)
{
DisablePlayerCheckpoint(playerid);
TogglePlayerControllable(playerid, 0);
SetTimerEx("unloading", 10000, 0, "i", playerid);
}
}
else
{
SendClientMessage(playerid, COLOR_BLACK, "");
}
}
else
{
SendClientMessage(playerid, COLOR_BLACK, "");
}
return 1;
}
forward unloading(playerid);
public unloading(playerid)
{
new vID = GetPlayerVehicleID(playerid);
new TrailerID = GetVehicleTrailer(vID);
new string_mission[300];
TogglePlayerControllable(playerid, true);
SucessMission(playerid);
SetVehicleToRespawn(TrailerID);
return 1;
}
Код:
SucessMission(playerid)
{
new string_msg[300];
format(string_msg, 300, "{FFFFFF}The player %s delivered the unloading to the %s", PlayerName(playerid), i_MissionText[playerid]);
SendClientMessageToAll(COLOR_BLACK, string_msg);
return 1;
}
Re: MissionText -
TadePoleMG - 26.05.2018
Hi
Use as this-
PHP код:
new string_msg[300];
format(string_msg, 300, "{FFFFFF}The player %s delivered the unloading to the %s", PlayerName(playerid), MissionLocation[0][NamePoint]);
SendClientMessageToAll(COLOR_BLACK, string_msg);
Re: MissionText -
KamilPolska - 26.05.2018
Yes. But it will be a lot of lines. And I would like to shorten it somehow.
Re: MissionText -
TadePoleMG - 26.05.2018
Make it in single string and use where you want.