SA-MP Forums Archive
[FilterScript] What ?!, have Fun - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] What ?!, have Fun (/showthread.php?tid=452356)



What ?!, have Fun - morocco - 21.07.2013

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



Re: What ?!, have Fun - Yves - 21.07.2013

lol nice work i bet i can make my players sacred with this haha


Re: What ?!, have Fun - morocco - 21.07.2013

Quote:
Originally Posted by Yves
Посмотреть сообщение
lol nice work i bet i can make my players sacred with this haha
Fun


Re: What ?!, have Fun - M3HR4N - 21.07.2013

lol it 's funny thanks.


Re: What ?!, have Fun - morocco - 21.07.2013

Quote:
Originally Posted by M3HR4N
Посмотреть сообщение
lol it 's funny thanks.
Thx !

words arabic in your photo !

You are arabic ?!


Re: What ?!, have Fun - hossa - 21.07.2013

you could've used Strfind as it's easier.


Re: What ?!, have Fun - morocco - 21.07.2013

Quote:
Originally Posted by hossa
Посмотреть сообщение
you could've used Strfind as it's easier.
You can change it

i make this FS for 3min