- 0
Moveobject , no move
-
Recently Browsing 0 members
- No registered users viewing this page.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.
Question
shean
salut!Am facut o vama dar , cand scriu /barriera nu se misca bariera nici una dintre cele 2 . Ma puteti ajuta ?Este ceva gresit in cea ce am facut?
[pawn] #include <a_samp>
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_BLUE 0x2641FEAA
#define COLOR_1GREEN 0x6BD700FF
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_1BLUE 0x0080FFFF
#define PTP PlayerToPoint
forward CustomPickups();
forward vamaClose(playerid);
forward vama1Close(playerid);
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
enum pInfo
{
pKey[128],
pPassport,
};
new PlayerInfo[MAX_PLAYERS][pInfo];
new vama;
new vama1;
new pickupvama;
new pickupvama1;
public OnGameModeInit()
{
pickupvama = CreatePickup(1239, 23, 600.9317,-1184.7410,20.7388);
pickupvama1 = CreatePickup(1239, 23, 628.9692,-1188.7152,18.5387);
CreateObject(983,630.80212402344,-1178.0334472656,19.312618255615,0,0,298);
CreateObject(967,626.9765625,-1179.220703125,18.510345458984,0,0,297.99865722656);
CreateObject(966,626.1513671875,-1180.0009765625,18.480548858643,0,0,31.997680664063);
CreateObject(983,617.24328613281,-1185.6096191406,19.38306427002,0,0,121.99816894531);
CreateObject(8843,621.68365478516,-1181.9276123047,18.565780639648,5.7999877929688,0,30);
CreateObject(983,610.38177490234,-1186.4262695313,19.752365112305,0,0,298);
CreateObject(967,600.36328125,-1192.0660400391,18.816455841064,0,0,117.99868774414);
CreateObject(983,597.22235107422,-1194.6226806641,19.610870361328,0,0,299.99865722656);
CreateObject(966,601.13464355469,-1191.4663085938,18.833299636841,0,0,207.99768066406);
CreateObject(8843,598.78491210938,-1178.6994628906,20.723304748535,352.29998779297,0,215.99816894531);
vama = CreateObject(968,625.95745849609,-1180.1488037109,19.134094238281,0,90,212);
vama1 = CreateObject(968,601.28918457031,-1191.2478027344,19.628963470459,0,90,27.997680664063);
return 1;
}
public OnFilterScriptInit()
{
return 1;
}
public vamaClose()
{
MoveObject(vama, 625.95745849609,-1180.1488037109,19.134094238281, 3.5);
return 1;
}
public vama1Close()
{
MoveObject(vama1, 601.28918457031,-1191.2478027344,19.628963470459, 3.5);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
//------------------------------------Barrier--------------------------------------
if(strcmp(cmdtext, "/barriera", true) == 0)
{
if(PlayerToPoint(3.0, playerid, 624.9478,-1187.1923,18.8808))
{
if(PlayerInfo[playerid][pPassport] == 1)
{
MoveObject(vama,625.94976806641,-1180.1370849609,19.118846893311 , 5.5);
SetTimer("vamaClose", 3000, 0);
SendClientMessage(playerid, COLOR_1GREEN, "Ai platit vamei 100$ pentru a putea trece..Vama se va inchide in 3 secunde");
GivePlayerMoney(playerid,-100);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "* You don't have an Passport, go in the City Hall and buy one.");
return 1;
}
}
else if(PlayerToPoint(5.0, playerid, 600.8569,-1184.5107,20.7767))
{
if(PlayerInfo[playerid][pPassport] == 1)
{
MoveObject(vama1,601.30047607422,-1191.2603759766,19.598106384277 , 5.5);
SetTimer("vama1Close", 3000, 0);
SendClientMessage(playerid, COLOR_1GREEN, "Ai platit vamei 100$ pentru a putea trece..Vama se va inchide in 3 secunde");
GivePlayerMoney(playerid,-100);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "* You don't have an Passport, go in the City Hall and buy one.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You are not at Barrier.");
return 1;
}
}
return 0;
}
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
if(IsPlayerConnected(playerid))
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x);
tempposy = (oldposy -y);
tempposz = (oldposz -z);
//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
}
return 0;
}
public OnPlayerConnect(playerid)
{
PlayerInfo[playerid][pPassport] = 1;
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == pickupvama)
{
GameTextForPlayer(playerid,"~w~Scrie ~r~/barriera ~w~pentru a deskide barriera",3000,5);
}
if(pickupid == pickupvama1)
{
GameTextForPlayer(playerid,"~w~Scrie ~r~/barriera ~w~pentru a deskide barriera",3000,5);
}
return 1;
}
[/pawn]
1 answer to this question
Recommended Posts