Pickup followed by /command and get rid of blue business house! - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Pickup followed by /command and get rid of blue business house! (
/showthread.php?tid=250882)
Pickup followed by /command and get rid of blue business house! -
Pancake - 24.04.2011
First of all i want to greet everyone on here(first post on here)!
And now to the topic:
Код:
new Bodyguard1;
public OnGameModeInit()
{
Bodyguard1 = CreatePickup(1239, 23,1367.1448,-1290.2589,13.5469, 0);
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid==Bodyguard1)
{
//here i want to be able to type in a command like /getjob
}
return 1;
}
How to do so? i hope its clear enough...
Second Problem:
How to get rid of the blue houses(business) in front of the gun shop for Example?
Pancake
Re: Pickup followed by /command and get rid of blue business house! -
Raimis_R - 24.04.2011
Like this?
pawn Код:
if(pickupid==Bodyguard1)
{
pInfo[playerid][Job]=1;
SendClientMessage(playerid,-1,"You Entered Bodyguard1, your Job it's 1");
}
AW: Re: Pickup followed by /command and get rid of blue business house! -
Pancake - 24.04.2011
Quote:
Originally Posted by Raimis_R
Like this?
pawn Код:
if(pickupid==Bodyguard1) { pInfo[playerid][Job]=1; SendClientMessage(playerid,-1,"You Entered Bodyguard1, your Job it's 1"); }
|
Wouldnt this directly give me the bodyguard job?? i guess it would!
I will get the possibility to type in /getjob when pickupid==Bodyguard1!
but still thanks
Re: Pickup followed by /command and get rid of blue business house! -
Anteino - 24.04.2011
pawn Код:
#include <a_samp>
#include "../include/gl_common.inc"
#include <string>
#define FILTERSCRIPT
#define COLOR_WHITE 0xFFFFFFFF
new Bodyguard1, Float:X, Float:Y, Float:Z;
public OnGameModeInit()
{
Bodyguard1 = CreatePickup(1239, 23,1367.1448,-1290.2589,13.5469, 0);
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == Bodyguard1)
{
SendClientMessage(playerid, COLOR_WHITE, "SERVER: type /getjob to become a bodyguard.");
GetPlayerPos(playerid, X, Y, Z);
return 1;
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new idx;
new cmd[256];
cmd = strtok(cmdtext, idx);
if(strcmp("/getjob", cmd, true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 1 ,X, Y, Z)){
SendClientMessage(playerid, COLOR_WHITE, "SERVER: You have just become a bodyguard!");
// do the job activation thing here
return 1;
}
}
return 0;
}
Let me know if that helped you.
AW: Pickup followed by /command and get rid of blue business house! -
Pancake - 25.04.2011
The code gave me some errors, but that not a problem!!
U helped me alot with "IsPlayerInRangeOfPoint" i will use this!!
thx again for your help
Pancake
Re: Pickup followed by /command and get rid of blue business house! -
Anteino - 25.04.2011
Np