Second and rest commands won't work -
Kasis - 02.02.2011
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;
}
Re: Second and rest commands won't work -
Kasis - 03.02.2011
Somebody? ;(
Re: Second and rest commands won't work -
Steven Paul - 03.02.2011
are you sure you writed your team name properly. Check it again
Re: Second and rest commands won't work -
Kasis - 03.02.2011
Team names are correctly written.
Re: Second and rest commands won't work -
Kasis - 03.02.2011
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.
Re: Second and rest commands won't work -
iggy1 - 03.02.2011
Do you get the messages?(Māљīna atgriezta!) Or does none of it execute?
Re: Second and rest commands won't work -
Kasis - 03.02.2011
Nop, i don't get that message.
Re: Second and rest commands won't work -
[WSF]ThA_Devil - 03.02.2011
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!
AW: Second and rest commands won't work -
Nero_3D - 03.02.2011
Edit: /\ Solution /\
Re: Second and rest commands won't work -
iggy1 - 03.02.2011
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;
}
Re: Second and rest commands won't work -
Kasis - 03.02.2011
Wiiii, now works perfect.
Thank you guys!