Pickup followed by /command and get rid of blue business house!
#1

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
Reply
#2

Like this?

pawn Код:
if(pickupid==Bodyguard1)
{
   pInfo[playerid][Job]=1;
   SendClientMessage(playerid,-1,"You Entered Bodyguard1, your Job it's 1");
}
Reply
#3

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
Reply
#4

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.
Reply
#5

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
Reply
#6

Np
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)