Welcome, Guest |
You have to register before you can post on our site.
|
Online Users |
There are currently 365 online users. » 0 Member(s) | 362 Guest(s) Bing, Google, Yandex
|
Latest Threads |
Plan C: Protect The Presi...
Forum: Advertisements
Last Post: PipPo
Yesterday, 10:51 PM
» Replies: 0
» Views: 19
|
CODE5 GAMING COPS AND ROB...
Forum: Advertisements
Last Post: ryanthiago789
Yesterday, 03:02 AM
» Replies: 0
» Views: 30
|
SAMP RP project in 2024? ...
Forum: General Discussions
Last Post: tommchris
Yesterday, 02:05 AM
» Replies: 4
» Views: 2,465
|
Infekcja 2: Zombie Surviv...
Forum: Serwery
Last Post: tunnelrushgame3d
Yesterday, 01:50 AM
» Replies: 1
» Views: 192
|
FPS issues
Forum: General Discussions
Last Post: kourtneyroberts
2025-04-28, 04:53 AM
» Replies: 0
» Views: 23
|
How to make your GTA SA:M...
Forum: Tutorials
Last Post: NoxxeR
2025-04-27, 11:26 AM
» Replies: 1
» Views: 83
|
Problem about pawnbot
Forum: Pawn Scripting
Last Post: balkanspeed18
2025-04-26, 02:04 PM
» Replies: 0
» Views: 39
|
Error
Forum: Pawn Scripting
Last Post: -N0FeaR-
2025-04-25, 12:05 PM
» Replies: 0
» Views: 41
|
GTA Multigames [ MultiMod...
Forum: Advertisements
Last Post: Undead
2025-04-25, 07:37 AM
» Replies: 0
» Views: 52
|
Atlanta DeathMatch
Forum: Advertisements
Last Post: NixaSha
2025-04-25, 01:19 AM
» Replies: 0
» Views: 45
|
|
|
[include] Matrix Functions (Topic en Espa?ol) |
Posted by: Leonardo - 2021-01-27, 05:19 PM - Forum: Programaci?n
- No Replies
|
 |
Matrix Functions
Estas son funciones matrix, que se pueden usar para obtener la rotaci?n de euler de un veh?culo, o calcular el offset para usarlo en AttachObjectToVehicle/Player, tambi?n para crear un DetachObjectFromVehicle/Player, etc.
Functions:
- native Vector(Float:x, Float:y, Float:z);
- native Matrix(const right[VECTOR], const front[VECTOR], const up[VECTOR], const pos[VECTOR]);
- native Matrix_Invert(const matrix[MATRIX]);
- native Matrix_BuildUp(matrix[MATRIX]);
- native Matrix_SetRotation(matrix[MATRIX], Float:rx, Float:ry, Float:rz);
- native Float:Matrix_GetRotationX(const matrix[MATRIX]);
- native Float:Matrix_GetRotationY(const matrix[MATRIX]);
- native Float:Matrix_GetRotationZ(const matrix[MATRIX]);
- native Matrix_GetRotation(const matrix[MATRIX]);
- native Matrix_Multiply3x3(const matrix[MATRIX], const vector[VECTOR]);
- native Matrix_Multiply4x4(const matrix1[MATRIX], const matrix2[MATRIX]);
- native Matrix_GetOffsetPosition(const matrix[MATRIX], const vector[VECTOR]);
- native Matrix_GetOffsetRotation(const matrix[MATRIX], const vector[VECTOR], bool:invert = true);
Video
?ste es un video del filterscript de pruebas:
[Video: https://youtu.be/vSZyMilgcuU]
C?digo fuente
https://github.com/Leonardo541/matrix
|
|
|
Matrix Functions |
Posted by: Leonardo - 2021-01-27, 05:12 PM - Forum: Libraries
- No Replies
|
 |
Matrix Functions
These are matrix functions, which can be used to obtain the euler rotation of a vehicle, or calculate the offset position and offset rotation to be used in AttachObjectToVehicle/Player, also to create a DetachObjectFromVehicle/Player, etc.
Functions:
- native Vector(Float:x, Float:y, Float:z);
- native Matrix(const right[VECTOR], const front[VECTOR], const up[VECTOR], const pos[VECTOR]);
- native Matrix_Invert(const matrix[MATRIX]);
- native Matrix_BuildUp(matrix[MATRIX]);
- native Matrix_SetRotation(matrix[MATRIX], Float:rx, Float:ry, Float:rz);
- native Float:Matrix_GetRotationX(const matrix[MATRIX]);
- native Float:Matrix_GetRotationY(const matrix[MATRIX]);
- native Float:Matrix_GetRotationZ(const matrix[MATRIX]);
- native Matrix_GetRotation(const matrix[MATRIX]);
- native Matrix_Multiply3x3(const matrix[MATRIX], const vector[VECTOR]);
- native Matrix_Multiply4x4(const matrix1[MATRIX], const matrix2[MATRIX]);
- native Matrix_GetOffsetPosition(const matrix[MATRIX], const vector[VECTOR]);
- native Matrix_GetOffsetRotation(const matrix[MATRIX], const vector[VECTOR], bool:invert = true);
Video
This is a video of the test filterscript:
[Video: https://youtu.be/vSZyMilgcuU]
Source code
https://github.com/Leonardo541/matrix
|
|
|
Vehicle rotation | help with this? |
Posted by: Leonardo - 2021-01-26, 01:05 PM - Forum: Questions and Suggestions
- Replies (5)
|
 |
![[Image: vrot.jpg]](https://cdn.discordapp.com/attachments/683477745367646224/803610230243459142/vrot.jpg)
I was wondering if you need help with this, because it might help.
What I have done has been a function to obtain the euler rotation from a matrix.
In the unoccupied sync, the SA-MP client sends the right and front vectors to the server, so it is necessary to build the up vector to obtain the euler rotation, so I also made a function for that.
To test it, I converted the C code to Pawn, this would be the result:
[Video: https://youtu.be/_sBAISz_JMo]
00:00 incar testing
00:20 unoccupied testing
[Video: https://youtu.be/3mZZsGd-g0M]
00:00 airplane testing
Part of the Pawn code would look like this:
Code: forward test_timer();
public test_timer()
{
?? ?if(test_vehicleid != INVALID_VEHICLE_ID)
?? ?{
?? ???? new mat[MATRIX];
?? ???? new pos[VECTOR];
?? ???? new rot[VECTOR];
?? ????
?? ???? mat = GetVehicleMatrix(test_vehicleid);
?? ???? rot = Matrix_GetRotation(mat, Vector(-9999.0, -9999.0, -9999.0));
?? ???? pos = Matrix_Multiply3x3(mat, Vector(0.0, 12.0, 2.0));
?? ????
?? ???? pos[X] = mat[POS][X];
?? ???? pos[Y] = mat[POS][Y];
?? ???? pos[Z] = mat[POS][Z];
?? ????
?? ???? SetObjectPos(test_objectid, pos[X], pos[Y], pos[Z]);
?? ???? SetObjectRot(test_objectid, rot[X], rot[Y], rot[Z]);
?? ?}
}
I would not know who to talk to to discuss this issue, so I created this post. If you are interested in this, you can send me a private and I will send you the source code in C , including the Pawn code.
Note: Sorry for my English, I speak Spanish and I have translated this with google translate.
|
|
|
Lost Connection Randomly |
Posted by: tyrp - 2021-01-26, 12:23 PM - Forum: Support
- Replies (2)
|
 |
I have one problem with my RPG server, the server is installed on VPS with 0.3DL Version.
For two months the server did not have any problems but now it started at a certain time certain players to take lost connection automatically, but the server does not fall, about 10-15 players fall or even more, depending on how many are on the server. Is there a VPS problem or something? Should firewall be enabled or disabled?
|
|
|
[HELP ME] Creating function in Pawno |
Posted by: PedroWarlock - 2021-01-25, 04:06 PM - Forum: Questions and Suggestions
- Replies (2)
|
 |
(google translate)
I'm trying to pass the sqlite functions to a subfunction, in order to handle all query commands for sql/mysql,?but I am not able to create a simple function, I always have this type of error below, can someone help me with what I am missing?
thanks for listening!
Code: stock Mysql_Db_free_result(DB:dbd, string[]) {
?new Result = db_query(dbd, string);
?return Result;
}
new string2[150];
format(string2, sizeof(string2), "SELECT * FROM `account` WHERE `Name`='%s' AND `key`='%s'",DB_Escape(pName),DB_Escape(password));
Result?= Mysql_Db_free_result(Conection,string2);
BPR.pwn(49596) : warning 213: tag mismatch
BPR.pwn(49619) : warning 213: tag mismatch
Pawn compiler 3.2.3664 Copyright © 1997-2016, ITB CompuPhase
|
|
|
Is there any solution to prevent bike sprint? |
Posted by: Cada - 2021-01-25, 12:31 PM - Forum: Pawn Scripting
- Replies (1)
|
 |
Hello.
I`m devloping Role Playing server and wanna prevent bike sprint (bicycle = battering key w,?motorcycle = battering key?arrow UP).
I found that whether player press w or arrow up key in vehicle to sprint, but i dont know how to make speed lower of their vehicle or something.
If you guys have any solution, please make give me that! :>
thanks everyone.
|
|
|
TAXI CO. & BOATYARD |
Posted by: Name - 2021-01-25, 05:25 AM - Forum: Videos and Screenshots
- Replies (4)
|
 |
TAXI CO. & BOATYARD INTERIORS
(both maps are from my?old map?collection, some of you probably saw these in the past)
Name: Taxi Company
Map type: Interior
Author of map: MrName (me)
Number of objects: 613
Number of textures: 695
Removed SA objects: 0
Custom objects: 0
Location of map: unknow
Map editor used: MSR's mapping system?
Reference: GTA Vice City
About map: Interior for taxi company, idea was taken from Vice City, as you can see some stuff is similar to Vice City's taxi co. interior. Interior has 2 floors and contains 4 rooms, one is the main room where you park your vehicles which is like a garage room and three small rooms - under construction room, operators room and office room.
Screenshots:
|
|
|
[Help] issue with getgift command |
Posted by: Disretired - 2021-01-25, 01:53 AM - Forum: Pawn Scripting
- Replies (3)
|
 |
So our /getgift command is not working properly, it shows a /me but is not giving the gift and is allowing us to spam the command instead of telling us to wait 5 hours after entering it. if you need anymore info let me know. It was working fine when we started but now its acting up, and nobody even touched it
https://pastebin.com/55eSzcQH
Code: CMD:getgift(playerid, params[])
{
new string[128];
if(IsPlayerInRangeOfPoint(playerid, 3.0,2546.680908, 1403.430786, 7699.584472))
{
if(PlayerInfo[playerid][pDonateRank] >= 1)
{
if(VIPGifts == 0 && PlayerInfo[playerid][pDonateRank] < 4)
{
SendClientMessageEx(playerid, COLOR_GRAD2, "The safe is locked!");
return 1;
}
if(PlayerInfo[playerid][pGiftTime] > 0)
{
SendClientMessageEx(playerid, COLOR_GRAD2, "You have already received a gift in the last 5 hours!");
return 1;
}
format(string, sizeof(string), "* %s reaches inside the safe with his eyes closed.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GiftPlayer(500, playerid);
}
}
else if(dynamicgift != 0)
{
new Float:Position[3];
GetDynamicObjectPos(dynamicgift, Position[0], Position[1], Position[2]);
if(IsPlayerInRangeOfPoint(playerid, 5.0, Position[0], Position[1], Position[2]))
{
if(PlayerInfo[playerid][pLevel] >= 3)
{
if(PlayerInfo[playerid][pGiftTime] > 0)
{
SendClientMessageEx(playerid, COLOR_GRAD2, "You have already received a gift in the last 5 hours!");
return 1;
}
format(string, sizeof(string), "* %s reaches inside the bag of gifts with their eyes closed.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GiftPlayer(500, playerid);
}
else
{
SendClientMessageEx(playerid, COLOR_WHITE, "* You must be at least level 3 to use this, sorry!");
}
}
}
return 1;
}
PHP Code: stock GiftPlayer(playerid, giveplayerid) // playerid = Gifter.? giveplayerid = gift receiver
{
new string[128];
if(PlayerInfo[playerid][pAdmin] >= 2 || playerid == MAX_PLAYERS)
{
new randgift = Random(1, 100);
if(randgift >= 1 && randgift <= 83)
{
new gift = Random(1, 10);
if(gift == 1)
{
if(PlayerInfo[giveplayerid][pConnectTime] < 1 || PlayerInfo[giveplayerid][pWRestricted] > 0 || PlayerInfo[giveplayerid][pDonateRank] > 2) return GiftPlayer(playerid, giveplayerid);
GivePlayerValidWeapon(giveplayerid, 27, 60000);
GivePlayerValidWeapon(giveplayerid, 24, 60000);
GivePlayerValidWeapon(giveplayerid, 31, 60000);
GivePlayerValidWeapon(giveplayerid, 34, 60000);
GivePlayerValidWeapon(giveplayerid, 29, 60000);
SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won a full weapon set!");
format(string, sizeof(string), "* %s was just gifted a full weapon set, enjoy!", GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(gift == 2)
{
if(PlayerInfo[giveplayerid][pDonateRank] > 2) return GiftPlayer(playerid, giveplayerid);
PlayerInfo[giveplayerid][pFirstaid];
SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won a first aid kit!");
format(string, sizeof(string), "* %s was just gifted a first aid kit, enjoy!", GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(gift == 3)
{
PlayerInfo[giveplayerid][pMats] = 2000;
SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 2,000 materials!");
format(string, sizeof(string), "* %s was just gifted 2,000 materials, enjoy!", GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(gift == 4)
{
if(PlayerInfo[giveplayerid][pWarns] != 0)
{
PlayerInfo[giveplayerid][pWarns]--;
SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won a single warning removal!");
format(string, sizeof(string), "* %s was just gifted a single warning removal, enjoy!", GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else
{
SendClientMessageEx(giveplayerid, COLOR_GRAD2, "Random gift ended up in a removal of one warning - let's try again!");
GiftPlayer(playerid, giveplayerid);
return 1;
}
}
else if(gift == 5)
{
PlayerInfo[giveplayerid][pPot] = 50;
SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 50 grams of pot!");
format(string, sizeof(string), "* %s was just gifted 50 grams of pot, enjoy!", GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(gift == 6)
{
PlayerInfo[giveplayerid][pCrack] = 25;
SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 25 grams of crack!");
format(string, sizeof(string), "* %s was just gifted 25 grams of crack, enjoy!", GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(gift == 7)
{
GivePlayerCash(giveplayerid, 20000);
SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won $20,000!");
format(string, sizeof(string), "* %s was just gifted $20,000, enjoy!", GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(gift == 8)
{
PlayerInfo[giveplayerid][pPaintTokens] = 10;
SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 10 paintball tokens!");
format(string, sizeof(string), "* %s was just gifted 10 paintball tokens, enjoy!", GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(gift == 9)
{
if(PlayerInfo[giveplayerid][pDonateRank] < 1) return GiftPlayer(playerid, giveplayerid);
PlayerInfo[giveplayerid][pTokens] = 5;
SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 5 VIP tokens!");
format(string, sizeof(string), "* %s was just gifted 5 VIP tokens, enjoy!", GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(gift == 10)
{
PlayerInfo[giveplayerid][pExp] = 5;
SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 5 Respect Points!");
format(string, sizeof(string), "* %s was just gifted 5 Respect Points, enjoy!", GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
}
else if(randgift > 83 && randgift <= 98)
{
new gift = Random(1, 9);
if(gift == 1)
{
GivePlayerCash(giveplayerid, 150000);
SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won $150,000!");
format(string, sizeof(string), "* %s was just gifted $150,000, enjoy!", GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(gift == 2)
{
PlayerInfo[giveplayerid][pMats] = 15000;
SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 15,000 materials!");
format(string, sizeof(string), "* %s was just gifted 15,000 materials, enjoy!", GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(gift == 3)
{
PlayerInfo[giveplayerid][pExp] = 10;
SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 10 respect points!");
format(string, sizeof(string), "* %s was just gifted 10 respect points, enjoy!", GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(gift == 4)
{
SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won a free car!");
SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Note: This rare reward may take up to 48 hours to be rewarded, contact Shop Techs.");
format(PlayerInfo[giveplayerid][pFlag], 128, "Free Car (Gift)");
format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has just gifted %s and he won a free car.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
ABroadCast(COLOR_YELLOW, string, 4);
if(playerid != MAX_PLAYERS)
{
new year,month,day,log[128];
getdate(year, month, day);
format(log, sizeof(log), "AdmCmd: %s has just gifted %s and he won a free car(%d-%d-%d)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), month, day, year);
Log("logs/gifts.log", log);
} else {
new year,month,day,log[128];
getdate(year, month, day);
format(log, sizeof(log), "AdmCmd: %s was just gifted by the system and he won a free car(%d-%d-%d)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), month, day, year);
Log("logs/gifts.log", log);
}
format(string, sizeof(string), "* %s was just gifted a free car, enjoy!", GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(gift == 5)
{
if(PlayerInfo[giveplayerid][pDonateRank] > 0)
{
PlayerInfo[giveplayerid][pTokens] = 15;
SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 15 VIP tokens!");
format(string, sizeof(string), "* %s was just gifted 15 VIP tokens, enjoy!", GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else
{
PlayerInfo[giveplayerid][pDonateRank] = 1;
PlayerInfo[giveplayerid][pTempVIP] = 10800;
PlayerInfo[giveplayerid][pBuddyInvited] = 1;
format(string, sizeof(string), "You have been invited to become a Level 1 VIP for 3 hours. Enjoy!", GetPlayerNameEx(giveplayerid));
SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "BUDDY INVITE: %s has won a buddyinvite.", GetPlayerNameEx(giveplayerid));
Log("logs/setvip.log", string);
format(string, sizeof(string), "* %s was just gifted 3 hours of VIP, enjoy!", GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
}
else if(gift == 6)
{
PlayerToyInfo[giveplayerid][4][ptModelID] = 18643;
PlayerToyInfo[giveplayerid][4][ptBone] = 6;
PlayerToyInfo[giveplayerid][4][ptPosX] = 0.0;
PlayerToyInfo[giveplayerid][4][ptPosY] = 0.0;
PlayerToyInfo[giveplayerid][4][ptPosZ] = 0.0;
PlayerToyInfo[giveplayerid][4][ptRotX] = 0.0;
PlayerToyInfo[giveplayerid][4][ptRotY] = 0.0;
PlayerToyInfo[giveplayerid][4][ptRotZ] = 0.0;
SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won a Free Laser Pointer!");
format(string, sizeof(string), "* %s was just gifted a Free Laser Pointer, enjoy!", GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(gift == 7)
{
if(PlayerInfo[giveplayerid][pADMuteTotal] < 1) return GiftPlayer(playerid, giveplayerid);
PlayerInfo[giveplayerid][pADMuteTotal] = 0;
SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won a Free Admute Reset!");
format(string, sizeof(string), "* %s was just gifted a Free Admute Reset, enjoy!", GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(gift == 8)
{
if(PlayerInfo[giveplayerid][pNMuteTotal] < 1) return GiftPlayer(playerid, giveplayerid);
PlayerInfo[giveplayerid][pNMuteTotal] = 0;
SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won a Free Nmute Reset!");
format(string, sizeof(string), "* %s was just gifted a Free Nmute Reset, enjoy!", GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
}
else if(randgift > 98 && randgift <= 100)
{
new gift = Random(1, 6);
if(gift == 1 && PlayerInfo[giveplayerid][pDonateRank] <= 2) // Silver VIP can get it extended, I suppose
{
SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won one month of Silver VIP!");
SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Note: This rare reward may take up to 48 hours to be rewarded.");
format(PlayerInfo[giveplayerid][pFlag], 128, "Free Silver VIP (Gift)");
format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has just gifted %s and he won one month of Silver VIP.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
ABroadCast(COLOR_YELLOW, string, 2);
new year,month,day,log[128];
getdate(year, month, day);
format(log, sizeof(log), "AdmCmd: %s has just gifted %s and he won one month of Silver VIP(%d-%d-%d)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), month, day, year);
Log("logs/gifts.log", log);
format(string, sizeof(string), "* %s was just gifted one month of Silver VIP, enjoy!", GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(gift == 2)
{
if(playerid != MAX_PLAYERS)
{
new year,month,day,log[128];
getdate(year, month, day);
format(log, sizeof(log), "AdmCmd: %s has just gifted %s and he won a free house(%d-%d-%d)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), month, day, year);
Log("logs/gifts.log", log);
} else {
new year,month,day,log[128];
getdate(year, month, day);
format(log, sizeof(log), "AdmCmd: %s was just gifted by the system and he won a free house(%d-%d-%d)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), month, day, year);
Log("logs/gifts.log", log);
}
SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won a free house!");
SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Note: This rare reward may take up to 48 hours to be rewarded.");
format(PlayerInfo[giveplayerid][pFlag], 128, "Free House (Gift)");
format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has just gifted %s and he won a free house.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
ABroadCast(COLOR_YELLOW, string, 2);
format(string, sizeof(string), "* %s was just gifted a free house, enjoy!", GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(gift == 3)
{
if(PlayerInfo[giveplayerid][pDonateRank] < 1) return GiftPlayer(playerid, giveplayerid);
PlayerInfo[giveplayerid][pTokens] = 50;
SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won 50 VIP tokens!");
format(string, sizeof(string), "* %s was just gifted 50 VIP tokens, enjoy!", GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(gift == 4)
{
new year,month,day,log[128];
getdate(year, month, day);
format(log, sizeof(log), "AdmCmd: %s has just gifted %s and he won $500,000. (%d-%d-%d)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), month, day, year);
Log("logs/gifts.log", log);
GivePlayerCash(giveplayerid, 500000);
SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won $500,000!");
format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has just gifted %s and he won $500,000.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
ABroadCast(COLOR_YELLOW, string, 2);
format(string, sizeof(string), "* %s was just gifted $500,000, enjoy!", GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
else if(gift == 5)
{
SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Congratulations - you have won one month of Gold VIP!");
SendClientMessageEx(giveplayerid, COLOR_GRAD2, " Note: This rare reward may take up to 48 hours to be rewarded.");
format(PlayerInfo[giveplayerid][pFlag], 128, "Free Gold VIP (Gift)");
format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has just gifted %s and he won one month of Gold VIP.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
ABroadCast(COLOR_YELLOW, string, 2);
new year,month,day,log[128];
getdate(year, month, day);
format(log, sizeof(log), "AdmCmd: %s has just gifted %s and he won one month of Gold VIP(%d-%d-%d)", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), month, day, year);
Log("logs/gifts.log", log);
format(string, sizeof(string), "* %s was just gifted one month of Gold VIP, enjoy!", GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, giveplayerid, string, COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW,COLOR_YELLOW);
}
}
PlayerInfo[giveplayerid][pGiftTime] = 300;
}
return 1;
}
|
|
|
|