How to make spike for swat ?
#1

Hey i have this spike scrip but i want it to work only with swat skin id 285 ,
here is the script.


PHP код:
dcmd_spike(playerid,params[])
{
    
#pragma unused params
    
new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    
GetPlayerPos(playeridplocxplocyplocz);
    
GetPlayerFacingAngle(playerid,ploca);
    
CreateSpike(plocx,plocy,plocz,ploca);
    return 
1;
}
dcmd_rspike(playerid,params[])
{
    
#pragma unused params
    
for(new 0sizeof(SpikeInfo); i++)
      {
          if(
IsPlayerInRangeOfPoint(playerid2.0SpikeInfo[i][sX], SpikeInfo[i][sY], SpikeInfo[i][sZ]))
        {
              if(
SpikeInfo[i][sCreated] == 1)
            {
                
SpikeInfo[i][sCreated]=0;
                
SpikeInfo[i][sX]=0.0;
                
SpikeInfo[i][sY]=0.0;
                
SpikeInfo[i][sZ]=0.0;
                
DestroyObject(SpikeInfo[i][sObject]);
                return 
1;
              }
          }
      }
    return 
1;

Reply
#2

you have the enums and the stock

pawn Код:
CreateSpike(plocx,plocy,plocz,ploca);
Reply
#3

Use GetPlayerSkin
Use GetPlayerSkin
pawn Код:
dcmd_spike(playerid,params[])
{
    #pragma unused params
    if(GetPlayerSkin(playerid) != 285) return SendClientMessage(playerid, -1, "You aren't in SWAT");

    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    GetPlayerFacingAngle(playerid,ploca);
    CreateSpike(plocx,plocy,plocz,ploca);
    return 1;
}
dcmd_rspike(playerid,params[])
{
    #pragma unused params
    if(GetPlayerSkin(playerid) != 285) return SendClientMessage(playerid, -1, "You aren't in SWAT");

    for(new i = 0; i < sizeof(SpikeInfo); i++)
      {
          if(IsPlayerInRangeOfPoint(playerid, 2.0, SpikeInfo[i][sX], SpikeInfo[i][sY], SpikeInfo[i][sZ]))
        {
              if(SpikeInfo[i][sCreated] == 1)
            {
                SpikeInfo[i][sCreated]=0;
                SpikeInfo[i][sX]=0.0;
                SpikeInfo[i][sY]=0.0;
                SpikeInfo[i][sZ]=0.0;
                DestroyObject(SpikeInfo[i][sObject]);
                return 1;
              }
          }
      }
    return 1;
}
Reply
#4

pawn Код:
dcmd_spike(playerid,params[])
{
    #pragma unused params
    new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
    GetPlayerPos(playerid, plocx, plocy, plocz);
    GetPlayerFacingAngle(playerid,ploca);
    //
    if(GetPlayerSkin(playerid) == 285)
    {
        CreateSpike(plocx,plocy,plocz,ploca);
    }
    else
        SendClientMessage(playerid, /*color*/, "You are not in swat!");
    return 1;
}
There you go.
Reply
#5

Nice Thanks alot
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)