Second and rest commands won't work
#1

Hi!
I have problem with command function. I have 4 commands, which are for each team. But the problem is that 1st command work fine for first team. The problem is, when i change my team 2nd command won't work and its same with rest commands for teams.
I removed 1st command for 1st team. Then basicly 2nd teams command is like first and then it works find.!
I am seriously confused!
Code:
Код:
	if (strcmp("/atgrieztmasinu", cmdtext, true, 10) == 0)
	{
		if(gTeam[playerid] == kaimins1)
		{
	    	if(IsPlayerInRangeOfPoint(playerid, 5, 1425.722534, -885.609985, 50.713619))
	  		{
	  		    SetVehicleToRespawn(Cars[kaiminsviens]);
	  		    SendClientMessage(playerid, -1,"[Info] Māљīna atgriezta!");
			}
		}
		return 1;
	}
	if (strcmp("/atgrieztmasinu", cmdtext, true, 10) == 0)
	{
		if(gTeam[playerid] == kaimins2)
		{
	    	if(IsPlayerInRangeOfPoint(playerid, 5, 1471.8503,-903.7045,54.8989))
	  		{
	  		    SetVehicleToRespawn(Cars[kaiminsdivi]);
	  		    SendClientMessage(playerid, -1,"[Info] Māљīna atgriezta!");
			}
		}
		return 1;
	}
	if (strcmp("/atgrieztmasinu", cmdtext, true, 10) == 0)
	{
		if(gTeam[playerid] == kaimins3)
		{
	    	if(IsPlayerInRangeOfPoint(playerid, 5, 1539.5809,-855.2153,64.3361))
	  		{
	  		    SetVehicleToRespawn(Cars[kaiminstris]);
	  		    SendClientMessage(playerid, -1,"[Info] Māљīna atgriezta!");
			}
		}
		return 1;
	}
Reply
#2

Somebody? ;(
Reply
#3

are you sure you writed your team name properly. Check it again
Reply
#4

Team names are correctly written.
Reply
#5

There is no different, if i remove
Код:
if(gTeam[playerid] == kaimins1)
I still can't get car back to spawn. Only for first vehicle its work.
Reply
#6

Do you get the messages?(Māљīna atgriezta!) Or does none of it execute?
Reply
#7

Nop, i don't get that message.
Reply
#8

Hey, i think i know what's for problem, you can make only 1 command with that name! so.... add these 3 commands in one or re-define name of command!
Reply
#9

Edit: /\ Solution /\
Reply
#10

LMAO didn't spot that. Do it like this,
pawn Код:
if (strcmp("/atgrieztmasinu", cmdtext, true, 10) == 0)
    {
        if(gTeam[playerid] == kaimins1)
        {
            if(IsPlayerInRangeOfPoint(playerid, 5, 1425.722534, -885.609985, 50.713619))
            {
                SetVehicleToRespawn(Cars[kaiminsviens]);
                SendClientMessage(playerid, -1,"[Info] Ma-љi-na atgriezta!");
            }
        }
        else if(gTeam[playerid] == kaimins2)
        {
        }
        //and so on
        return 1;
    }
Reply
#11

Wiiii, now works perfect.
Thank you guys!
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)