05.06.2016, 16:52
What Skimmer says is correct and you should use playerid as first parameter instead.
SetPlayerRaceCheckpoint also does not return any value so do:
EDIT:
Okay, you set the "user" to PlayerInfo[playerid][pShowtheway_ID] but some of your custom functions returns 0 if there is no correct player? Anyway, all those checks seems pointless since "u" specifier takes ID or part of name.
All you have to do is:
and reset PlayerInfo[playerid][pShowtheway_ID] to INVALID_PLAYER_ID on connect/disconnect and where needed.
The messages in dialog response are a bit misleading as the admin "shows" the way to a player but the admin gets the message about the marked checkpoint and how to remove it.
As you used but without storing to anything
and depending on whether the location should be saved to the player given or the admin, change the following:
Sorry it took me so long to reply.
EDIT 2: Since you have 2 commands, you will need to do the following. In the dialog response if PlayerInfo[playerid][pShowtheway_ID] is equal to INVALID_PLAYER_ID and set the checkpoint+messages to playerid. Otherwise, set them for PlayerInfo[playerid][pShowtheway_ID].
SetPlayerRaceCheckpoint also does not return any value so do:
pawn Код:
PlayerInfo[playerid][pLocations] = listitem;
Okay, you set the "user" to PlayerInfo[playerid][pShowtheway_ID] but some of your custom functions returns 0 if there is no correct player? Anyway, all those checks seems pointless since "u" specifier takes ID or part of name.
All you have to do is:
pawn Код:
if(sscanf(params, "u", user)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /showtheway [playerid]");
if(user == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "Invalid playerID (Submitted playerID is not connected).");
if(IsPlayerNPC(user)) return SendClientMessage(playerid, COLOR_GREY, "Invalid playerID (Submitted playerID points at NPC).");
The messages in dialog response are a bit misleading as the admin "shows" the way to a player but the admin gets the message about the marked checkpoint and how to remove it.
As you used but without storing to anything
pawn Код:
SetPlayerRaceCheckpoint(PlayerInfo[playerid][pShowtheway_ID], 2, Locs[listitem][locX], Locs[listitem][locY], Locs[listitem][locZ], 0, 0, 0, 3.0);
pawn Код:
// admin's
PlayerInfo[playerid][pLocations] = listitem;
// given player's
PlayerInfo[PlayerInfo[playerid][pShowtheway_ID]][pLocations] = listitem;
EDIT 2: Since you have 2 commands, you will need to do the following. In the dialog response if PlayerInfo[playerid][pShowtheway_ID] is equal to INVALID_PLAYER_ID and set the checkpoint+messages to playerid. Otherwise, set them for PlayerInfo[playerid][pShowtheway_ID].