[FilterScript] What ?!, have Fun
#1

What that's?

This just for fun, if player say "What?" or "What ?" or "?"











And this object will be Remove after 3sec



pawn Код:
#include <a_samp>

#define What? 3

public OnPlayerText(playerid, text[])
{
    new idx;
    new tmp[128];
    tmp = strtok(text, idx);
    if((strcmp("What?", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("What?")))
    {
        SetPlayerAttachedObject(playerid, What?, 3215, 1, 0.8249, 0.0689, -0.0099, -11.4000, 89.3999, 0.7999, 1.0000, 1.0000, 1.0000, 0, 0); // "Man3rf" by Willam_Joe (Skin:291)
        SetTimerEx("RemoveWhat",3000,false,"i",playerid);
        return 0;
    }
    if((strcmp("What ?", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("What ?")))
    {
        SetPlayerAttachedObject(playerid, What?, 3215, 1, 0.8249, 0.0689, -0.0099, -11.4000, 89.3999, 0.7999, 1.0000, 1.0000, 1.0000, 0, 0); // "Man3rf" by Willam_Joe (Skin:291)
        SetTimerEx("RemoveWhat",3000,false,"i",playerid);
        return 0;
    }
    if((strcmp("?", tmp, true, strlen(tmp)) == 0) && (strlen(tmp) == strlen("?")))
    {
        SetPlayerAttachedObject(playerid, What?, 3215, 1, 0.8249, 0.0689, -0.0099, -11.4000, 89.3999, 0.7999, 1.0000, 1.0000, 1.0000, 0, 0); // "Man3rf" by Willam_Joe (Skin:291)
        SetTimerEx("RemoveWhat",3000,false,"i",playerid);
        return 0;
    }
    return 1;
}

forward RemoveWhat(playerid);
public RemoveWhat(playerid)
{
    RemovePlayerAttachedObject(playerid, What?);
    return;
}


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


Messages In This Thread
What ?!, have Fun - by morocco - 21.07.2013, 03:02
Re: What ?!, have Fun - by Yves - 21.07.2013, 03:18
Re: What ?!, have Fun - by morocco - 21.07.2013, 03:48
Re: What ?!, have Fun - by M3HR4N - 21.07.2013, 04:45
Re: What ?!, have Fun - by morocco - 21.07.2013, 04:51
Re: What ?!, have Fun - by hossa - 21.07.2013, 04:57
Re: What ?!, have Fun - by morocco - 21.07.2013, 18:57

Forum Jump:


Users browsing this thread: 2 Guest(s)