setting to player 0
#8

What Skimmer says is correct and you should use playerid as first parameter instead.

SetPlayerRaceCheckpoint also does not return any value so do:
pawn Код:
PlayerInfo[playerid][pLocations] = listitem;
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:
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).");
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
pawn Код:
SetPlayerRaceCheckpoint(PlayerInfo[playerid][pShowtheway_ID], 2, Locs[listitem][locX], Locs[listitem][locY], Locs[listitem][locZ], 0, 0, 0, 3.0);
and depending on whether the location should be saved to the player given or the admin, change the following:
pawn Код:
// admin's
PlayerInfo[playerid][pLocations] = listitem;
// given player's
PlayerInfo[PlayerInfo[playerid][pShowtheway_ID]][pLocations] = listitem;
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].
Reply


Messages In This Thread
setting to player 0 - by alexanderjb918 - 05.06.2016, 16:38
Re: setting to player 0 - by SickAttack - 05.06.2016, 16:41
Re: setting to player 0 - by alexanderjb918 - 05.06.2016, 16:42
Re: setting to player 0 - by Skimmer - 05.06.2016, 16:45
Re: setting to player 0 - by alexanderjb918 - 05.06.2016, 16:47
Re: setting to player 0 - by alexanderjb918 - 05.06.2016, 16:50
Re: setting to player 0 - by Skimmer - 05.06.2016, 16:51
Re: setting to player 0 - by Konstantinos - 05.06.2016, 16:52
Re: setting to player 0 - by alexanderjb918 - 05.06.2016, 17:02
Re: setting to player 0 - by alexanderjb918 - 05.06.2016, 17:12

Forum Jump:


Users browsing this thread: 1 Guest(s)