CMD:findgiftbox(playerid, params[]) { if(CheckPointCheck(playerid)) { SendClientMessageEx(playerid, COLOR_WHITE, "Please ensure that your current checkpoint is destroyed first (you either have material packages, or another existing checkpoint)."); return 1; } if(dynamicgift != 0) { new Float:Position[3]; GetDynamicObjectPos(dynamicgift, Position[0], Position[1], Position[2]); SendClientMessageEx(playerid, COLOR_BLUE, " The giftbox is placed at [I NEED ZONE HERE]"); SetPlayerCheckpoint(playerid, Position[0], Position[1], Position[2], 5.0); } else { SendClientMessageEx(playerid, COLOR_BLUE, "Giftbox not placed yet"); } return 1; }
CMD:findgiftbox(playerid, params[]) { if(CheckPointCheck(playerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "Please ensure that your current checkpoint is destroyed first (you either have material packages, or another existing checkpoint)."); if(!dynamicgift) return SendClientMessageEx(playerid, COLOR_BLUE, "Giftbox not placed yet"); new Float:Position[3],string[64]; GetDynamicObjectPos(dynamicgift, Position[0], Position[1], Position[2]); for(new i = 0; i != sizeof(gSAZones); i++ ) { if(Position[0] >= gSAZones[i][SAZONE_AREA][0] && Position[0] <= gSAZones[i][SAZONE_AREA][3] && Position[1] >= gSAZones[i][SAZONE_AREA][1] && Position[1] <= gSAZones[i][SAZONE_AREA][4]) { format(string, 64, gSAZones[i][SAZONE_NAME], 0); break; } } format(string,sizeof string," The giftbox is placed at %s",string); SendClientMessage(playerid, COLOR_BLUE, string); SetPlayerCheckpoint(playerid, Position[0], Position[1], Position[2], 5.0); return 1; }
Take only the Array & enum from this: http://pastebin.com/f68e1a6ad
And then write the command like this: Код:
CMD:findgiftbox(playerid, params[]) { if(CheckPointCheck(playerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "Please ensure that your current checkpoint is destroyed first (you either have material packages, or another existing checkpoint)."); if(!dynamicgift) return SendClientMessageEx(playerid, COLOR_BLUE, "Giftbox not placed yet"); new Float:Position[3],string[64]; GetDynamicObjectPos(dynamicgift, Position[0], Position[1], Position[2]); for(new i = 0; i != sizeof(gSAZones); i++ ) { if(Position[0] >= gSAZones[i][SAZONE_AREA][0] && Position[0] <= gSAZones[i][SAZONE_AREA][3] && Position[1] >= gSAZones[i][SAZONE_AREA][1] && Position[1] <= gSAZones[i][SAZONE_AREA][4]) { format(string, 64, gSAZones[i][SAZONE_NAME], 0); break; } } format(string,sizeof string," The giftbox is placed at %s",string); SendClientMessage(playerid, COLOR_BLUE, string); SetPlayerCheckpoint(playerid, Position[0], Position[1], Position[2], 5.0); return 1; } |
format(string,sizeof string," The giftbox is at %s we have set checkpoint to the location of the giftbox! Go to it",string);
new Float:Position[3],string[64];
new Float:Position[3],string[128];
Yeah, mate when i do /findgiftbox it's giving my zone location
|
Thats impossible, when you used my Code...
This Code snippet you should copy: http://pastebin.com/whqXgF9y |