help need spike only for swat??
#1

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
Reply
#2

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
Reply
#3

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;
}

Reply
#4

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;
}
Reply
#5

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.

Reply
#6

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.
Reply
#7

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.
Reply
#8

Retry, I edited my post.
Reply
#9

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

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)