Command /locations does not work -
heNq - 08.06.2015
Script code:
COMMAND:locations(playerid, params[])
{
new user;
if(sscanf(params, "u", user))
if(user == INVALID_PLAYER_ID) sscanf(params, "i", user);
if(user > MAX_PLAYERS) user = DeterminePlayerID(user);
PlayerInfo[playerid][pShowtheway_ID] = user;
format(gVar3000, sizeof(gVar3000), "%s", EOS);
for(new i = 0; i != sizeof(Locs); i++)
{
if(isnull(gVar3000)) format(gVar3000, sizeof(gVar3000), "%s", Locs[i][locName]);
else format(gVar3000, sizeof(gVar3000), "%s\n%s", gVar3000, Locs[i][locName]);
}
ShowPlayerDialog(playerid, DIALOG_SHOW_LOCATIONS, DIALOG_STYLE_LIST, "{FF9900}Locatii", gVar3000, "Mark", "Cancel");
return format(gVar3000, sizeof(gVar3000), "%s", EOS);
}
When you give /locations, load everything but do not appear checkpoint on the map.
Re: Command /locations does not work -
JaydenJason - 08.06.2015
Use [code] tags, and show your OnDialogResponse code for this
Re: Command /locations does not work -
heNq - 08.06.2015
Код:
case DIALOG_LOCATIONS:
{
if(response)
{
new message[100];
format(message, 100, "You have successfully marked {FF6347}%s{FFFFFF} on your map.",Locs[listitem][locName]);
SendClientMessage(playerid, -1, message);
SendClientMessage(playerid, -1, "In order to remove the checkpoint, type {FF6347}/killcheckpoint{FFFFFF}.");
PlayerInfo[playerid][pLocations] = SetPlayerRaceCheckpoint(PlayerInfo[playerid][pShowtheway_ID], 2, Locs[listitem][locX], Locs[listitem][locY], Locs[listitem][locZ], 0, 0, 0, 3.0);
}
}
Re: Command /locations does not work -
heNq - 08.06.2015
PS: I have a command / showtheway showing someone Checkpoint, and it goes
Код:
COMMAND:showtheway(playerid, params[])
{
if(PlayerInfo[playerid][pAdminlevel] == 0 && PlayerInfo[playerid][pModLevel] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Trebuie sa fi un Moderator pentru a folosi aceasta comanda.");
new user;
if(sscanf(params, "u", user)) return SendClientMessage(playerid, COLOR_GREY, "FOLOSESTE: /showtheway [playerid]");
if(user == INVALID_PLAYER_ID) sscanf(params, "i", user);
if(user > MAX_PLAYERS) user = DeterminePlayerID(user);
if(!IsPlayerConnected(user)) return SendClientMessage(playerid, COLOR_GREY, "playerID invalid (playerID-ul solicitat de tine nu este conectat).");
if(IsPlayerNPC(user)) return SendClientMessage(playerid, COLOR_GREY, "playerID invalid (playerID-ul introdus de tine este un NCP).");
PlayerInfo[playerid][pShowtheway_ID] = user;
format(gVar3000, sizeof(gVar3000), "%s", EOS);
for(new i = 0; i != sizeof(Locs); i++)
{
if(isnull(gVar3000)) format(gVar3000, sizeof(gVar3000), "%s", Locs[i][locName]);
else format(gVar3000, sizeof(gVar3000), "%s\n%s", gVar3000, Locs[i][locName]);
}
ShowPlayerDialog(playerid, DIALOG_SHOW_LOCATIONS, DIALOG_STYLE_LIST, "{FF9900}Locatii", gVar3000, "Mark", "Cancel");
return format(gVar3000, sizeof(gVar3000), "%s", EOS);
}
Код:
else if(dialogid == DIALOG_SHOW_LOCATIONS && response)
{
new message[150];
format(message, 150, "%s %s{FFFFFF} successfully marked {FF6347}%s{FFFFFF} on your map.");
SendClientMessage(PlayerInfo[playerid][pShowtheway_ID], -1, message);
format(message, 150, "You have successfully marked {FF6347}%s{FFFFFF} on the player {FF6347}%s{FFFFFF}'s map.",Locs[listitem][locName], GetNameWithSpace(PlayerInfo[playerid][pShowtheway_ID]));
SendClientMessage(playerid, -1, message);
SendClientMessage(PlayerInfo[playerid][pShowtheway_ID], -1, "In order to remove the checkpoint, type {FF6347}/killcheckpoint{FFFFFF}.");
PlayerInfo[playerid][pLocations] = SetPlayerRaceCheckpoint(PlayerInfo[playerid][pShowtheway_ID], 2, Locs[listitem][locX], Locs[listitem][locY], Locs[listitem][locZ], 0, 0, 0, 3.0);
}
Re: Command /locations does not work -
JaydenJason - 08.06.2015
Try using just "playerid" instead of "PlayerInfo[playerid][pShowtheway_ID]"
edit; nvm just saw your second post, gimme a sec
Re: Command /locations does not work -
heNq - 08.06.2015
is not working