very very verrryy small [question]
#1

Hello,

just a small mindtwist while im scripting to make some random coordinates

if i do this...lets say in a command

pawn Code:
pickup = CreatePickup(1279,1,RandomDelivery[randD][0],RandomDelivery[randD][1],RandomDelivery[randD][2],0);
SetPlayerMapIcon( playerid, 12, RandomDelivery[randD][0],RandomDelivery[randD][1],RandomDelivery[randD][2], 52, 0, MAPICON_GLOBAL);

will both show the same random ? Oo
if not then how should i do that?
Reply
#2

Here is one way, at least that's how it looks like, haven't tested it;
BTW, the _SetPlayerMapIcon stock should be on top since I defined it as regular one.
pawn Code:
#define MAX_MAPICON 100
pawn Code:
enum mIcon {
    Float:mx,
    Float:my,
    Float:mz
}
new
    MapIcon[MAX_PLAYERS][MAX_MAPICON][mIcon],
    Icon1;
pawn Code:
stock _SetPlayerMapIcon(playerid, iconid, Float:x, Float:y, Float:z, markertype, color, style) {
    MapIcon[playerid][iconid][mx] = x;
    MapIcon[playerid][iconid][my] = y;
    MapIcon[playerid][iconid][mz] = z;
    return SetPlayerMapIcon(playerid, iconid, x, y, z, markertype, color, style);
}
#define SetPlayerMapIcon _SetPlayerMapIcon
pawn Code:
stock GetPlayerMapIcon(playerid, iconid, Float:x, Float:y, Float:z) {
    x = MapIcon[playerid][iconid][mx];
    y = MapIcon[playerid][iconid][my];
    z = MapIcon[playerid][iconid][mz];
    return 1;
}
pawn Code:
new Float:C[3];
Icon1 = SetPlayerMapIcon(playerid, 12, RandomDelivery[randD][0],RandomDelivery[randD][1],RandomDelivery[randD][2], 52, 0, MAPICON_GLOBAL);
GetPlayerMapIcon(playerid, Icon1, C[0], C[1], C[2]);
pickup = CreatePickup(1279,1, C[0], C[1], C[2],0);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)