SA-MP Forums Archive
help need spike only for swat?? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: help need spike only for swat?? (/showthread.php?tid=272682)



help need spike only for swat?? - UserName31 - 29.07.2011

hey i have script that put spike like /spike but work for everyone and i want to know how do i add it just for the skin swat please help if need the code of the script tell me is short script but if need just tell me on comment
i have cops and robber server and i wanted to add spike but it work's for every one in server so i want it to be just for swat or cops that all


Re: help need spike only for swat?? - Guest3598475934857938411 - 29.07.2011

Hmm making a check for it is so easy.

After the { of the command just put
pawn Код:
new playerskin;
playerskin = GetPlayerSkin(playerid);
if (playerskin == 285)
{
//put your command code here...
}
else
{
      SendCLientMessage(playerid, 0xFF0000FF, "Sorry you are not SWAT");
}
Hope I helped you


Re: help need spike only for swat?? - UserName31 - 29.07.2011

can u add that to here
Quote:

#include <a_samp>
#include <SpikeStrip>

#define playerskin = GetPlayerSkin(playerid);

strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}

new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);

if (strcmp(cmd,"/spike",true) == 0)
{
new Floatlocx,Floatlocy,Floatlocz,Floatloca;
GetPlayerPos(playerid, plocx, plocy, plocz);
GetPlayerFacingAngle(playerid,ploca);
CreateStrip(plocx,plocy,plocz,ploca);
return 1;
}
else if (strcmp(cmd,"/rspike",true) == 0)
{
DeleteClosestStrip(playerid);
return 1;
}
else if (strcmp(cmd,"/raspike",true) == 0)
{
DeleteAllStrip();
return 1;
}

return 0;
}




Re: help need spike only for swat?? - Guest3598475934857938411 - 29.07.2011

Um yes.
pawn Код:
#include <a_samp>
#include <SpikeStrip>


strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}

new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);

if (strcmp(cmd,"/spike",true) == 0)
{
new playerskin;
playerskin = GetPlayerSkin(playerid);
if (playerskin == 285)
{
new Floatlocx,Floatlocy,Floatlocz,Floatloca;
GetPlayerPos(playerid, plocx, plocy, plocz);
GetPlayerFacingAngle(playerid,ploca);
CreateStrip(plocx,plocy,plocz,ploca);
}
else
{
      SendCLientMessage(playerid, 0xFF0000FF, "Sorry you are not SWAT");
}
return 1;
}
else if (strcmp(cmd,"/rspike",true) == 0)
{
new playerskin;
playerskin = GetPlayerSkin(playerid);
if (playerskin == 285)
{
DeleteClosestStrip(playerid);
}
else
{
      SendCLientMessage(playerid, 0xFF0000FF, "Sorry you are not SWAT");
}
return 1;
}
else if (strcmp(cmd,"/raspike",true) == 0)
{
new playerskin;
playerskin = GetPlayerSkin(playerid);
if (playerskin == 285)
{
DeleteAllStrip();
}
else
{
      SendCLientMessage(playerid, 0xFF0000FF, "Sorry you are not SWAT");
}
return 1;
}

return 0;
}



Re: help need spike only for swat?? - UserName31 - 29.07.2011

here what i get buddy

Quote:

C:\Users\Elvis_V\Desktop\My server's\COP N ROBBERS\filterscripts\testsw.pwn(37) : error 017: undefined symbol "plocx"
C:\Users\Elvis_V\Desktop\My server's\COP N ROBBERS\filterscripts\testsw.pwn(3 : error 017: undefined symbol "ploca"
C:\Users\Elvis_V\Desktop\My server's\COP N ROBBERS\filterscripts\testsw.pwn(39) : error 017: undefined symbol "plocx"
C:\Users\Elvis_V\Desktop\My server's\COP N ROBBERS\filterscripts\testsw.pwn(36) : warning 203: symbol is never used: "Floatloca"
C:\Users\Elvis_V\Desktop\My server's\COP N ROBBERS\filterscripts\testsw.pwn(36) : warning 203: symbol is never used: "Floatlocz"
C:\Users\Elvis_V\Desktop\My server's\COP N ROBBERS\filterscripts\testsw.pwn(36) : warning 203: symbol is never used: "Floatlocy"
C:\Users\Elvis_V\Desktop\My server's\COP N ROBBERS\filterscripts\testsw.pwn(36) : warning 203: symbol is never used: "Floatlocx"
C:\Users\Elvis_V\Desktop\My server's\COP N ROBBERS\filterscripts\testsw.pwn(43) : error 017: undefined symbol "SendCLientMessage"
C:\Users\Elvis_V\Desktop\My server's\COP N ROBBERS\filterscripts\testsw.pwn(57) : error 017: undefined symbol "SendCLientMessage"
C:\Users\Elvis_V\Desktop\My server's\COP N ROBBERS\filterscripts\testsw.pwn(71) : error 017: undefined symbol "SendCLientMessage"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


6 Errors.




Re: help need spike only for swat?? - iPLEOMAX - 29.07.2011

pawn Код:
#include <a_samp>
#include <SpikeStrip>


strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}

new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);

if (strcmp(cmd,"/spike",true) == 0)
{
new playerskin;
playerskin = GetPlayerSkin(playerid);
if (playerskin == 285)
{
new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
GetPlayerPos(playerid, plocx, plocy, plocz);
GetPlayerFacingAngle(playerid,ploca);
CreateStrip(plocx,plocy,plocz,ploca);
}
else
{
      SendClientMessage(playerid, 0xFF0000FF, "Sorry you are not SWAT");
}
return 1;
}
else if (strcmp(cmd,"/rspike",true) == 0)
{
new playerskin;
playerskin = GetPlayerSkin(playerid);
if (playerskin == 285)
{
DeleteClosestStrip(playerid);
}
else
{
      SendClientMessage(playerid, 0xFF0000FF, "Sorry you are not SWAT");
}
return 1;
}
else if (strcmp(cmd,"/raspike",true) == 0)
{
new playerskin;
playerskin = GetPlayerSkin(playerid);
if (playerskin == 285)
{
DeleteAllStrip();
}
else
{
      SendClientMessage(playerid, 0xFF0000FF, "Sorry you are not SWAT");
}
return 1;
}

return 0;
}
Edited expertprogrammer's post.


Re: help need spike only for swat?? - UserName31 - 29.07.2011

C:\Users\Elvis_V\Desktop\My server's\COP N ROBBERS\filterscripts\testsw.pwn(37) : error 017: undefined symbol "plocx"
C:\Users\Elvis_V\Desktop\My server's\COP N ROBBERS\filterscripts\testsw.pwn(3 : error 017: undefined symbol "ploca"
C:\Users\Elvis_V\Desktop\My server's\COP N ROBBERS\filterscripts\testsw.pwn(39) : error 017: undefined symbol "plocx"
C:\Users\Elvis_V\Desktop\My server's\COP N ROBBERS\filterscripts\testsw.pwn(36) : warning 203: symbol is never used: "Floatploca"
C:\Users\Elvis_V\Desktop\My server's\COP N ROBBERS\filterscripts\testsw.pwn(36) : warning 203: symbol is never used: "Floatplocz"
C:\Users\Elvis_V\Desktop\My server's\COP N ROBBERS\filterscripts\testsw.pwn(36) : warning 203: symbol is never used: "Floatplocy"
C:\Users\Elvis_V\Desktop\My server's\COP N ROBBERS\filterscripts\testsw.pwn(36) : warning 203: symbol is never used: "Floatplocx"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.


Re: help need spike only for swat?? - iPLEOMAX - 29.07.2011

Retry, I edited my post.


Re: help need spike only for swat?? - UserName31 - 30.07.2011

thanks man really help i mark you as popular now i rate u thanks


Re: help need spike only for swat?? - Guest3598475934857938411 - 31.07.2011

Sorry for the long reply for me to fix the errors Anyways someone else fixed them.


Re: help need spike only for swat?? - UserName31 - 31.07.2011

Quote:
Originally Posted by expertprogrammer
Посмотреть сообщение
Sorry for the long reply for me to fix the errors Anyways someone else fixed them.
thank you because you help me too you try and that what is importan about you thank you i going ad you a strart too