Problems problems problems
#1

So basically i have this /v [ID] command. I want to disable it in DM zones and in race. In DM Zones it is working just fine
Код:
if(PlayerJoinedDMZone[playerid] == 1)
		{
	    	SCM(playerid, 0xF81414, "Ne mozete to u DM zoni");
	    	return 1;
		}
		else if(PlayerJoinedDMZone2[playerid] == 1)
    	{
	    	SCM(playerid, 0xF81414, "Ne mozete to u DM zoni");
	    	return 1;
		}
		else if(PlayerJoinedDMZone3[playerid] == 1)
		{
	    	SCM(playerid, 0xF81414, "Ne mozete to u DM zoni");
	    	return 1;
		}
		else if(PlayerJoinedDMZone4[playerid] == 1)
		{
	    	SCM(playerid, 0xF81414, "Ne mozete to u DM zoni");
			return 1;
		}
		else if(PlayerJoinedDMZone5[playerid] == 1)
		{
	    	SCM(playerid, 0xF81414, "Ne mozete to u DM zoni");
			return 1;
		}
That is for DM zones and it is working fine. But when it comes to race there is problem
Код:
if(Joined[playerid] == 1)
    	{
        	SCM(playerid, 0xF81414, "Ne mozete to dok ste u trci");
        	return 1;
		}
It spawns veh in race. How can i fix this??
Reply
#2

Is it showing the message but yet the command getting executed?
Reply
#3

It won't even show the message.
I have no idea what to do
Reply
#4

Quote:
Originally Posted by Micko123
Посмотреть сообщение
It won't even show the message.
I have no idea what to do
probably the value of
PHP код:
if(Joined[playerid] == 1
is 0 try to print it and see
PHP код:
        printf("%d",Joined[playerid]);
        if(
Joined[playerid] == 1)
        {
            
SCM(playerid0xF81414"Ne mozete to dok ste u trci");
            return 
1;
    } 
Reply
#5

Still same. It wont show nothing. Just spawn it while in race
Reply
#6

Quote:
Originally Posted by Micko123
Посмотреть сообщение
Still same. It wont show nothing. Just spawn it while in race
hmmm, can you post the full code?
Reply
#7

Here is /v command code
Код:
CMD:v(playerid, params[])
{
	new Vehicle[32], VehicleID, ColorOne, ColorTwo;
	PlayerInfo[playerid][pCanSpawnVehicle] = true;
  	if(sscanf(params, "s[32]D(1)D(1)", Vehicle, ColorOne, ColorTwo))
	{
    	PlayerInfo[playerid][pCanSpawnVehicle] = true;
     	SendClientMessage(playerid, 0xFF0000FF, "Koriscenje: /v[Ime/ID] [Boja 1 (moze i bez)] [Boja 2 (moze i bez)]");
     	SendClientMessage(playerid, 0xFF0000FF, "Koriscenje: Primjer /v Turismo , /v Elegy /v Nrg /v 522");
     	return 1;
	}
 	if(PlayerInfo[playerid][pCanSpawnVehicle])
 	{
 	    printf("%d",Joined[playerid]);
 	    if(Joined[playerid] == 1)
    	{
        	SCM(playerid, 0xF81414, "Ne mozete to dok ste u trci");
        	return 1;
		}
		if(PlayerJoinedDMZone[playerid] == 1)
		{
	    	SCM(playerid, 0xF81414, "Ne mozete to u DM zoni");
	    	return 1;
		}
		else if(PlayerJoinedDMZone2[playerid] == 1)
    	{
	    	SCM(playerid, 0xF81414, "Ne mozete to u DM zoni");
	    	return 1;
		}
		else if(PlayerJoinedDMZone3[playerid] == 1)
		{
	    	SCM(playerid, 0xF81414, "Ne mozete to u DM zoni");
	    	return 1;
		}
		else if(PlayerJoinedDMZone4[playerid] == 1)
		{
	    	SCM(playerid, 0xF81414, "Ne mozete to u DM zoni");
			return 1;
		}
		else if(PlayerJoinedDMZone5[playerid] == 1)
		{
	    	SCM(playerid, 0xF81414, "Ne mozete to u DM zoni");
			return 1;
		}
		VehicleID = GetVehicleModelIDFromName(Vehicle);
  		if(VehicleID != 425 && VehicleID != 432 && VehicleID != 447 &&
		VehicleID != 430 && VehicleID != 417 && VehicleID != 435 &&
		VehicleID != 446 && VehicleID != 449 && VehicleID != 450 &&
		VehicleID != 452 && VehicleID != 453 && VehicleID != 454 &&
		VehicleID != 460 && VehicleID != 464 && VehicleID != 465 &&
		VehicleID != 469 && VehicleID != 472 && VehicleID != 473 &&
		VehicleID != 476 && VehicleID != 484 && VehicleID != 487 &&
 		VehicleID != 488 && VehicleID != 493 && VehicleID != 497 &&
  		VehicleID != 501 && VehicleID != 511 && VehicleID != 512 &&
  		VehicleID != 513 && VehicleID != 519 && VehicleID != 520 &&
  		VehicleID != 537 && VehicleID != 538 && VehicleID != 548 &&
  		VehicleID != 553 && VehicleID != 563 && VehicleID != 564 &&
  		VehicleID != 569 && VehicleID != 570 && VehicleID != 577 &&
  		VehicleID != 584 && VehicleID != 590 && VehicleID != 591 &&
  		VehicleID != 592 && VehicleID != 593 && VehicleID != 594 &&
		VehicleID != 595 && VehicleID != 606 && VehicleID != 607 &&
  		VehicleID != 608 && VehicleID != 610 && VehicleID != 611) {
   		if(VehicleID == -1 )
    	{
   			VehicleID = strval(Vehicle);
    		if(VehicleID < 400 || VehicleID > 611 )
    		{
   				SendClientMessage(playerid, 0xFF0000FF, "Nepostojece ime vozila!");
     			return 1;
       		}
		}
		GetPlayerPos(playerid, pX, pY, pZ);
		GetPlayerFacingAngle(playerid, pAngle);
		DestroyVehicle(PlayerInfo[playerid][pSpawnVehicle]);
		PlayerInfo[playerid][pSpawnVehicle] = CreateVehicle(VehicleID, pX, pY, pZ+2.0, pAngle, ColorOne, ColorTwo, -1);
		LinkVehicleToInterior(PlayerInfo[playerid][pSpawnVehicle], GetPlayerInterior(playerid));
		PutPlayerInVehicle(playerid, PlayerInfo[playerid][pSpawnVehicle], 0);
		SendClientMessage(playerid, 0xFF0000FF, "Uspjesno ste stvorili vozilo!");
		}
		else
		{
			SendClientMessage(playerid, 0xFF0000FF, "Nemate dozvolu za ovo vozilo!!");
		 }
	}
	else
	{
		SendClientMessage(playerid, 0xFF0000FF, "Ne mozete stvoriti ovo vozilo u ovoj zoni!");
  	}
   	return 1;
}
Reply
#8

Everything's right, I assume you forgot to put the amx file on your gamemode folder before test it....
Reply
#9

It wont work because you didn't make a variable when the player join a race, Do it something like that:
PHP код:
// Top of your script
new Joined[MAX_PLAYERS];
//When the player join the race
Joined[playerid] = 1;
//When the player leave the race
Joined[playerid] = 0;
//OnPlayerConnect
Joined[playerid] = 0;
//In your command
if(Joined[playerid] == 1)
{
       
//Code ..

Follow my steps, and it will work 100%.
Reply
#10

Still the same. I will get back to dialog. This is buggy . Thank you guys for help. Repped
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)