cmd question
#1

so i have a question...

i made 1 cmd so i want if player didnt made 1st cmd he cant make 2nd...

hope u guys understood me

sorry for my bad eanglish..

EDIT: also how to create how to check if player made a cmd
Reply
#2

Код:
	if(!strcmp("/loadkokain",cmdtext))
	{
		if(IsPlayerInRangeOfPoint(playerid, 7.0, 951.5397, 2073.1101, 10.8203))
		{
			if(IsPlayerInAnyVehicle(playerid))
			{
	        	SendClientMessage(playerid,0xFFFFFFFF,"You loded Kokain !");
	        	GetPlayerMoney(playerid);
	        	GivePlayerMoney(playerid, -6000)
			}
		}
	}
    return 1;
	}
	if(!strcmp("/sellkokain",cmdtext))
	{
	    if(IsPlayerInRangeOfPoint(playerid, 7.0, 1423.9703, -1317.9305, 13.5547))
	    {
	    	if(IsPlayerInAnyVehicle(playerid))
	    	{
	        	SendClientMessage(playerid,0xFFFFFFFF,"You seled Kokain !");
	        	GetPlayerMoney(playerid);
	        	GivePlayerMoney(playerid, 20000)
	    }
	    return 1;
	}
my code
Reply
#3

pawn Код:
new HasKokain[MAX_PLAYERS]; //Put this at the top of your script

    if(!strcmp("/loadkokain",cmdtext))
    {
        if(IsPlayerInRangeOfPoint(playerid, 7.0, 951.5397, 2073.1101, 10.8203))
        {
            if(IsPlayerInAnyVehicle(playerid))
            {
                SendClientMessage(playerid,0xFFFFFFFF,"You loded Kokain !");
                GetPlayerMoney(playerid);
                GivePlayerMoney(playerid, -6000)
HasKokain[playerid] = 1;
            }
        }
    }
    return 1;
    }
    if(!strcmp("/sellkokain",cmdtext))
    {
        if(IsPlayerInRangeOfPoint(playerid, 7.0, 1423.9703, -1317.9305, 13.5547))
        {
            if(IsPlayerInAnyVehicle(playerid))
            {
                SendClientMessage(playerid,0xFFFFFFFF,"You seled Kokain !");
                GetPlayerMoney(playerid);
                GivePlayerMoney(playerid, 20000);
HasKokain[playerid] = 0;
        }
        return 1;
    }
You could use a bool instead, but thats probably the most simpliest way of doing it.
Reply
#4

thanks bro
Reply
#5

Quote:
Originally Posted by miokie
Посмотреть сообщение
PHP код:
new HasKokain[MAX_PLAYERS]; //Put this at the top of your script
    
if(!strcmp("/loadkokain",cmdtext))
    {
        if(
IsPlayerInRangeOfPoint(playerid7.0951.53972073.110110.8203))
        {
            if(
IsPlayerInAnyVehicle(playerid))
            {
                
SendClientMessage(playerid,0xFFFFFFFF,"You loded Kokain !");
                
GetPlayerMoney(playerid);
                
GivePlayerMoney(playerid, -6000)
HasKokain[playerid] = 1;
            }
        }
    }
    return 
1;
    }
    if(!
strcmp("/sellkokain",cmdtext))
    {
        if(
IsPlayerInRangeOfPoint(playerid7.01423.9703, -1317.930513.5547))
        {
            if(
IsPlayerInAnyVehicle(playerid))
            {
                
SendClientMessage(playerid,0xFFFFFFFF,"You seled Kokain !");
                
GetPlayerMoney(playerid);
                
GivePlayerMoney(playerid20000);
HasKokain[playerid] = 0;
        }
        return 
1;
    } 
You could use a bool instead, but thats probably the most simpliest way of doing it.
omfg.. What is this a crasher?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)