- 0
Problema getgift
-
Similar Content
-
- 2 answers
- 752 views
-
Problema turf
By Soryn.,
- 3 answers
- 434 views
-
- 0 replies
- 168 views
-
- 2 replies
- 342 views
-
- 1 reply
- 210 views
-
-
Recently Browsing 0 members
- No registered users viewing this page.
Question
ValyYouTube
Salut am o problema la/ getgift poti sa dai de cate ori vrei iar eu vreau sa o fac sa poti da odata la o zi cine ma poate ajuta?
#include <a_samp>
#include <streamer>
#include <sscanf2>
#include <zcmd>
#define COLOR_YELLOW 0xFFFFFFC8
#define COLOR_RED 0xFF0000C8
#define MAX_RANDOM_GIFTS 4
public OnFilterScriptInit()
{
return 1;
}
#pragma tabsize 0
stock RandomGift(playerid)
{
new randomgift = random(MAX_RANDOM_GIFTS) + 1;
switch (randomgift)
{
case 1:
{
GivePlayerMoney(playerid, 500000);
SendClientMessage(playerid, COLOR_YELLOW, "Ai primt de la gift 500000$!");
}
case 2:
{
GivePlayerMoney(playerid, 10000);
SendClientMessage(playerid, COLOR_YELLOW, "Ai primit de la gift 10000$!");
}
case 3:
{
SetPlayerScore(playerid, 4);
SendClientMessage(playerid, COLOR_YELLOW, "Ai primit level up +4");
}
case 4:
{
SendClientMessage(playerid, COLOR_YELLOW, "Nu ai primit nimic!imi pare rau.");
}
}
return 1;
}
new Float:giftPos[4];
new giftboxobject;
new giftboxcreated = 0;
new Text3D:giftbox3DText;
CMD:giftbox(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You are not an admin!");
if (isnull(params))
{
SendClientMessage(playerid, -1, "/giftbox [Option]");
SendClientMessage(playerid, COLOR_YELLOW, "[OPTIONS]: place, destroy");
return 1;
}
static
Float:X,
Float:Y,
Float:Z,
Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
if (!strcmp(params, "place", true))
{
if (IsPlayerInAnyVehicle(playerid))
return SendClientMessage(playerid, COLOR_RED, "You must be outside vehicle first.");
if(giftboxcreated == 1) return SendClientMessage(playerid, COLOR_RED, "Giftbox is already placed.");
giftPos[0] = X;
giftPos[1] = Y;
giftPos[2] = Z;
giftboxcreated = 1;
giftboxobject = CreateDynamicObject(19054, X, Y, Z - 0.4, 0.0, 0.0, A);
giftbox3DText = CreateDynamic3DTextLabel("/getgift\nTo get your gift.",0x10F441AA,X, Y, Z+0.25,8.0);
SendClientMessage(playerid, -1, "You have placed a giftbox");
return 1;
}
if (!strcmp(params, "destroy", true))
{
if(giftboxcreated == 0) return SendClientMessage(playerid, COLOR_RED, "Giftbox is not placed yet.");
DestroyDynamicObject(giftboxobject);
DestroyDynamic3DTextLabel(giftbox3DText);
giftboxcreated = 0;
SendClientMessage(playerid, -1, "You have destoryed the giftbox");
return 1;
}
return 1;
}
CMD:getgift(playerid)
{
if(!IsPlayerConnected(playerid))
return SendClientMessage(playerid, -1, "You must be logged in to do this.");
GetObjectPos(giftboxobject, giftPos[0], giftPos[1], giftPos[2]);
if(IsPlayerInRangeOfPoint(playerid, 5.0, giftPos[0], giftPos[1], giftPos[2]) && giftboxcreated == 1)
{
RandomGift(playerid);
}
return 1;
}
Link to comment
Share on other sites
14 answers to this question
Recommended Posts