29.07.2011, 16:53
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;
}