Gun Seller [Good for RP servers] -
gangsterm - 07.07.2012
Hello and Welcome to one of my filterscripts.
I dont use this one anymore so you all can have it. I will trade it for some rep points.
Enjoy yourself
Greeting Malik AKA New York City Roleplay
//#define FILTERSCRIPT
forward Float:GetDistanceBetweenPlayers(p1,p2);
#include <a_samp> // Default Samp Include
#include <dutils> // Dutlis Addon Include
#include <dudb> // Dudb Addon Include
#include <float> // Default Float Include
#define GREY 0xAFAFAFAA
#define GREEN 0x33AA33AA
#define YELLOW 0xFFFF00AA
#define WHITE 0xFFFFFFAA
#define LIGHTBLUE 0x33CCFFAA
#define ORANGE 0xFF9900AA
#define RED 0xAA3333AA
#define COLOR_RED1 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_CYAN 0x00BFF3AA
#define COLOR_BLACK 0x000000AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_LIGHTGREEN 0x5BC476FF
#define COLOR_PINK1 0xFFA6FFFF
#if defined FILTERSCRIPT
#endif
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" All credits go to malik server ip 82.169.88.57:7777");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);
new sendername[MAX_PLAYER_NAME];
new string [256];
new tmp[256];
new giveplayer[MAX_PLAYER_NAME];
if (strcmp("/gdfac", cmdtext, true) == 0)
{
SetPlayerPos(playerid, 2151.0154, -2265.7639, 13.3060);
SendClientMessage(playerid, 0x33AA33AA, "Welcome to the Gun Dealer Factory!");
SetPlayerInterior(playerid,0);
return 1;
}
if (strcmp("/grovestreet", cmdtext, true) == 0)
{
SetPlayerPos(playerid, 2491.1365,-1685.7610,13.5106);
SendClientMessage(playerid, 0x00BFF3AA, "Welcome to Grovestreet!");
SetPlayerInterior(playerid,0);
return 1;
}
if (strcmp("/gdhq", cmdtext, true) == 0)
{
SetPlayerPos(playerid, 2151.068, -1867.854, 13.114);
SendClientMessage(playerid, 0x00BFF3AA, "Welcome to the gun dealer factory!");
SetPlayerInterior(playerid,0);
return 1;
}
if (strcmp("/varios", cmdtext, true) == 0)
{
SetPlayerPos(playerid, 1883.994, -2015.324, 13.110);
SendClientMessage(playerid, 0x00BFF3AA, "Welcome to the Surside Surenos Hood!");
SetPlayerInterior(playerid,0);
return 1;
}
if(strcmp(cmd, "/selldeagle", true) == 0 || strcmp(cmd, "/givedeagle", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) { SendClientMessage(playerid, WHITE, "Correct Usage: /selldeagle [playerid] [ammo]"); return 1;
}
new playa;
new otherplayer = strval(tmp);
playa = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!IsPlayerConnected(playa)) return SendClientMessage(playerid, WHITE, "SERVER MESSAGE: Incorrect ID.");
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if (GetDistanceBetweenPlayers(playerid,playa) > 2.00)
{
SendClientMessage(playerid,COLOR_RED1,"You are too far away!!");
return 1;
}
new ammo = strval(tmp);
if (ammo < 1 || ammo > 500) return SendClientMessage(playerid,RED," * The ammo limits are 1-500 for a Guns!");
GivePlayerWeapon(playa,24,ammo);
new pname[MAX_PLAYER_NAME], pname2[MAX_PLAYER_NAME];
GetPlayerName(otherplayer,pname,sizeof(pname));
GetPlayerName(playerid,pname2,sizeof(pname2));
format(string,sizeof(string),"%s has passed you a Deagle with (Ammo: %d).", pname2,ammo);
SendClientMessage(otherplayer,COLOR_RED1,string);
format(string,sizeof(string),"You passed a Deagle with (Ammo: %d) to %s.", ammo, pname);
SendClientMessage(playerid,COLOR_RED1,string);
return 1;
}
if(strcmp(cmd, "/selluzi", true) == 0 || strcmp(cmd, "/giveuzi", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) { SendClientMessage(playerid, WHITE, "Correct Usage: /selluzi [playerid] [ammo]"); return 1; }
new playa;
new otherplayer = strval(tmp);
playa = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!IsPlayerConnected(playa)) return SendClientMessage(playerid, WHITE, "SERVER MESSAGE: Incorrect ID.");
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if (GetDistanceBetweenPlayers(playerid,playa) > 2.00)
{
SendClientMessage(playerid,COLOR_RED1,"You are too far away!!");
return 1;
}
else if(otherplayer == playerid)
{
SendClientMessage(playerid, RED, "You can't sell yourself!");
return 1;
}
new ammo = strval(tmp);
if (ammo < 1 || ammo > 500) return SendClientMessage(playerid,RED," * The ammo limits are 1-500 for a Guns!");
GivePlayerWeapon(playa,28,ammo);
new pname[MAX_PLAYER_NAME], pname2[MAX_PLAYER_NAME];
GetPlayerName(otherplayer,pname,sizeof(pname));
GetPlayerName(playerid,pname2,sizeof(pname2));
format(string,sizeof(string),"%s has passed you an Uzi with (Ammo: %d).", pname2,ammo);
SendClientMessage(otherplayer,COLOR_RED1,string);
format(string,sizeof(string),"You passed a Uzi with (Ammo: %d) to %s.", ammo, pname);
SendClientMessage(playerid,COLOR_RED1,string);
return 1;
}
if(strcmp(cmd, "/selltec9", true) == 0 || strcmp(cmd, "/givetec9", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) { SendClientMessage(playerid, WHITE, "Correct Usage: /selltec9 [playerid] [ammo]"); return 1; }
new playa;
new otherplayer = strval(tmp);
playa = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!IsPlayerConnected(playa)) return SendClientMessage(playerid, WHITE, "SERVER MESSAGE: Incorrect ID.");
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if (GetDistanceBetweenPlayers(playerid,playa) > 2.00)
{
SendClientMessage(playerid,COLOR_RED1,"You are too far away!!");
return 1;
}
else if(otherplayer == playerid)
{
SendClientMessage(playerid, RED, "You can't sell yourself!");
return 1;
}
new ammo = strval(tmp);
if (ammo < 1 || ammo > 500) return SendClientMessage(playerid,RED," * The ammo limits are 1-500 for a Guns!");
GivePlayerWeapon(playa,32,ammo);
new pname[MAX_PLAYER_NAME], pname2[MAX_PLAYER_NAME];
GetPlayerName(otherplayer,pname,sizeof(pname));
GetPlayerName(playerid,pname2,sizeof(pname2));
format(string,sizeof(string),"%s has passed you a tec9 with (Ammo: %d).", pname2,ammo);
SendClientMessage(otherplayer,COLOR_RED1,string);
format(string,sizeof(string),"You passed a tec9 with (Ammo: %d) to %s.", ammo, pname);
SendClientMessage(playerid,COLOR_RED1,string);
return 1;
}
if(strcmp(cmd, "/sellak47", true) == 0 || strcmp(cmd, "/giveak47", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) { SendClientMessage(playerid, WHITE, "Correct Usage: /sellak47 [playerid] [ammo]"); return 1; }
new playa;
new otherplayer = strval(tmp);
playa = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!IsPlayerConnected(playa)) return SendClientMessage(playerid, WHITE, "SERVER MESSAGE: Incorrect ID.");
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if (GetDistanceBetweenPlayers(playerid,playa) > 2.00)
{
SendClientMessage(playerid,COLOR_RED1,"You are too far away!!");
return 1;
}
new ammo = strval(tmp);
if (ammo < 1 || ammo > 500) return SendClientMessage(playerid,RED," * The ammo limits are 1-500 for a Guns!");
GivePlayerWeapon(playa,30,ammo);
new pname[MAX_PLAYER_NAME], pname2[MAX_PLAYER_NAME];
GetPlayerName(otherplayer,pname,sizeof(pname));
GetPlayerName(playerid,pname2,sizeof(pname2));
format(string,sizeof(string),"%s has passed you an ak47 with (Ammo: %d).", pname2,ammo);
SendClientMessage(otherplayer,COLOR_RED1,string);
format(string,sizeof(string),"You passed an ak47 with (Ammo: %d) to %s.", ammo, pname);
SendClientMessage(playerid,COLOR_RED1,string);
return 1;
}
if(strcmp(cmd, "/sellm4", true) == 0 || strcmp(cmd, "/givem4", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) { SendClientMessage(playerid, WHITE, "Correct Usage: /sellm4 [playerid] [ammo]"); return 1; }
new playa;
new otherplayer = strval(tmp);
playa = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!IsPlayerConnected(playa)) return SendClientMessage(playerid, WHITE, "SERVER MESSAGE: Incorrect ID.");
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if (GetDistanceBetweenPlayers(playerid,playa) > 2.00)
{
SendClientMessage(playerid,COLOR_RED1,"You are too far away!!");
return 1;
}
new ammo = strval(tmp);
if (ammo < 1 || ammo > 500) return SendClientMessage(playerid,RED," * The ammo limits are 1-500 for a Guns!");
GivePlayerWeapon(playa,31,ammo);
new pname[MAX_PLAYER_NAME], pname2[MAX_PLAYER_NAME];
GetPlayerName(otherplayer,pname,sizeof(pname));
GetPlayerName(playerid,pname2,sizeof(pname2));
format(string,sizeof(string),"%s has passed you a m4 with (Ammo: %d).", pname2,ammo);
SendClientMessage(otherplayer,COLOR_RED1,string);
format(string,sizeof(string),"You passed a m4 with (Ammo: %d) to %s.", ammo, pname);
SendClientMessage(playerid,COLOR_RED1,string);
return 1;
}
if(strcmp(cmd, "/sellshotgun", true) == 0 || strcmp(cmd, "/giveshotgun", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) { SendClientMessage(playerid, WHITE, "Correct Usage: /sellshotgun [playerid] [ammo]"); return 1; }
new playa;
new otherplayer = strval(tmp);
playa = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!IsPlayerConnected(playa)) return SendClientMessage(playerid, WHITE, "SERVER MESSAGE: Incorrect ID.");
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if (GetDistanceBetweenPlayers(playerid,playa) > 2.00)
{
SendClientMessage(playerid,COLOR_RED1,"You are too far away!!");
return 1;
}
new ammo = strval(tmp);
if (ammo < 1 || ammo > 20) return SendClientMessage(playerid,RED," * The ammo limits are 1-20 for a shotGuns!");
GivePlayerWeapon(playa,25,ammo);
new pname[MAX_PLAYER_NAME], pname2[MAX_PLAYER_NAME];
GetPlayerName(otherplayer,pname,sizeof(pname));
GetPlayerName(playerid,pname2,sizeof(pname2));
format(string,sizeof(string),"%s has passed you a shotgun with (Ammo: %d).", pname2,ammo);
SendClientMessage(otherplayer,COLOR_RED1,string);
format(string,sizeof(string),"You passed a shotgun with (Ammo: %d) to %s.", ammo, pname);
SendClientMessage(playerid,COLOR_RED1,string);
return 1;
}
return 0;
}
public Float:GetDistanceBetweenPlayers(p1,p2)
{
new Float
1,Float:y1,Float:z1,Float
2,Float:y2,Float :z2;
if (!IsPlayerConnected(p1) || !IsPlayerConnected(p2)){
return -1.00;
}
GetPlayerPos(p1,x1,y1,z1);
GetPlayerPos(p2,x2,y2,z2);
return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2 )+floatpower(floatabs(floatsub(y2,y1)),2)+floatpow er(floatabs(floatsub(z2,z1)),2));
}
Re: Gun Seller [Good for RP servers] -
Isaac Mofujohn - 07.07.2012
seems like some a job for roleplay ok, and hey can u add screenshots?
(location etc)
Re: Gun Seller [Good for RP servers] -
shayan122 - 07.07.2012
nice
better to edit post and use or paste here:
www.pastebin.com!
any screens videos?
Re: Gun Seller [Good for RP servers] -
sherlock - 07.07.2012
There is this really great tool called
pastebin. It means you do not have to clog up your post with the whole script!
Re: Gun Seller [Good for RP servers] -
coole210 - 07.07.2012
Just like everyone else said, use pastebin for your scripts. This is also not a server advertisement section.
Re: Gun Seller [Good for RP servers] -
miikeyy45 - 07.07.2012
Man, use pastebim, its just a waste of space for your damn post.
Re: Gun Seller [Good for RP servers] -
gangsterm - 08.07.2012
chill
Re: Gun Seller [Good for RP servers] -
Inverse - 08.07.2012
Please post some screenshots. And next time, pleae upload your script somewhere or just use pastebin.
Re: Gun Seller [Good for RP servers] -
RoW001 - 07.04.2013
hello gay exist (pawn)xD
Re: Gun Seller [Good for RP servers] -
dakata994 - 07.04.2013
Quote:
Originally Posted by RoW001
hello gay exist (pawn)xD
|
Lol,why did you Insult he?
He maybe is new ?? or didn't know
?