Spikes problem
#1

One must not puncture when driving over with a car.
I have try but not working, it's being same. How to fix? Can someone please help me with this fast.



pawn Code:
CMD:deployspikes(playerid, params[])
{
    if(gTeam[playerid] == 2 || IsACop(playerid) || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6)
    {
        if(PlayerInfo[playerid][pRank] >= 3 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 3 && PlayerInfo[playerid][pRank] >= 1)
        {
            for(new i; i < sizeof(SpikeStrips); i++)
            {
                if(SpikeStrips[i][sX] == 0)
                {
                    new
                    Float: f_TempAngle,
                    string[128];

                    GetPlayerPos(playerid, SpikeStrips[i][sX], SpikeStrips[i][sY], SpikeStrips[i][sZ]);
                    GetPlayerFacingAngle(playerid, f_TempAngle);
                    SpikeStrips[i][sObjectID] = CreateDynamicObject(2899, SpikeStrips[i][sX], SpikeStrips[i][sY], SpikeStrips[i][sZ]-0.8, 0.0, 0.0, f_TempAngle);
                    GetPlayer3DZone(playerid, SpikeStrips[i][sDeployedAt], MAX_ZONE_NAME);
                    SpikeStrips[i][sDeployedBy] = GetPlayerNameEx(playerid);
                    format(string,sizeof(string),"Spike ID: %d successfully created.", i);
                    SendClientMessageEx(playerid, COLOR_WHITE, string);
                    format(string, sizeof(string), "HQ: A spike has been deployed by %s at %s.", GetPlayerNameEx(playerid), SpikeStrips[i][sDeployedAt]);
                    foreach(Player, x)
                    {
                        if(IsACop(x))
                        {
                            SendClientMessageEx(x, TEAM_BLUE_COLOR, string);
                            if (PlayerInfo[x][pRank] >= 3)
                            {
                                SendClientMessageEx(x, COLOR_YELLOW, "You can remove a spike by typing /destroyspikes.");
                            }
                        }
                    }
                    return 1;
                }
            }
            SendClientMessageEx(playerid, COLOR_WHITE, "Unable to spawn more strips, limit is 5." );
        }
        else
        {
            SendClientMessageEx(playerid, COLOR_GRAD2, " You must be rank 3 or higher!");
        }
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GRAD2, " You are not a LEO!");
    }
    return 1;
}
Reply
#2

Read this https://sampforum.blast.hk/showthread.php?tid=401031

When posting error please just look up on ****** you will find what you looking for, if you can't come here and open new thread, Thank you.
Reply
#3

Quote:
Originally Posted by aslan890
View Post
Read this https://sampforum.blast.hk/showthread.php?tid=401031

When posting error please just look up on ****** you will find what you looking for, if you can't come here and open new thread, Thank you.
I did test that, but didnt work
Reply
#4

Try this one

Code:
command(deployspikes, playerid, params[])
{
	#pragma unused params
	if(Groups[Player[playerid][Group]][CommandTypes] == 1)
	{
		new bool:breakingloop = false, newid = INVALID_OBJECT_ID, string[128];
		
	    for(new i=0;i<MAX_SPIKES;i++)
	    {
	        if(!breakingloop)
	        {
		        if(SpikeStrips[i][sX] == 0 && SpikeStrips[i][sY] == 0 && SpikeStrips[i][sZ] == 0) // Checking for next available ID.
		        {
					breakingloop = true;
					newid = i;
		        }
	        }
	    }
	    
	    if(newid != INVALID_OBJECT_ID)
	    {
		    GetPlayerPos(playerid, SpikeStrips[newid][sX], SpikeStrips[newid][sY], SpikeStrips[newid][sZ]);
		    GetPlayerFacingAngle(playerid, SpikeStrips[newid][sZRot]);
		    SpikeStrips[newid][sObjectID] = CreateObject(2899, SpikeStrips[newid][sX], SpikeStrips[newid][sY], SpikeStrips[newid][sZ]-0.8, 0.0, 0.0, SpikeStrips[newid][sZRot]);
		    format(string,sizeof(string),"Spike ID: %d successfully created.", newid);
		    SendClientMessage(playerid, WHITE, string);
	    }
	    else
	    {
		    SendClientMessage(playerid, WHITE, "Unable to spawn more strips, limit is 5.");
	    }
	}
	return 1;
}
Reply
#5

Quote:
Originally Posted by aslan890
View Post
Try this one

Code:
command(deployspikes, playerid, params[])
{
	#pragma unused params
	if(Groups[Player[playerid][Group]][CommandTypes] == 1)
	{
		new bool:breakingloop = false, newid = INVALID_OBJECT_ID, string[128];
		
	    for(new i=0;i<MAX_SPIKES;i++)
	    {
	        if(!breakingloop)
	        {
		        if(SpikeStrips[i][sX] == 0 && SpikeStrips[i][sY] == 0 && SpikeStrips[i][sZ] == 0) // Checking for next available ID.
		        {
					breakingloop = true;
					newid = i;
		        }
	        }
	    }
	    
	    if(newid != INVALID_OBJECT_ID)
	    {
		    GetPlayerPos(playerid, SpikeStrips[newid][sX], SpikeStrips[newid][sY], SpikeStrips[newid][sZ]);
		    GetPlayerFacingAngle(playerid, SpikeStrips[newid][sZRot]);
		    SpikeStrips[newid][sObjectID] = CreateObject(2899, SpikeStrips[newid][sX], SpikeStrips[newid][sY], SpikeStrips[newid][sZ]-0.8, 0.0, 0.0, SpikeStrips[newid][sZRot]);
		    format(string,sizeof(string),"Spike ID: %d successfully created.", newid);
		    SendClientMessage(playerid, WHITE, string);
	    }
	    else
	    {
		    SendClientMessage(playerid, WHITE, "Unable to spawn more strips, limit is 5.");
	    }
	}
	return 1;
}
I did get 10 error. And it's going to be zcmd
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)