Word Detection
#1

Yo guys how i can "detect the words" like here:

pawn Код:
CMD:911(playerid, params[])
{
    SendClientMessage(playerid, COLOR_ROYALBLUE, "*DISPATCHER: 911 Emergency what service do you need? (/Police /Fire)");
    return 1;
}
If someone type /police

pawn Код:
CMD:police(playerid, params[])
{
    SendClientMessage(playerid, COLOR_ROYALBLUE, "*DISPATCHER: Can you Give me a description of the crime and your location? (/Dis Crime & Location)");
    return 1;
}
Now there is the problem, how i can detect the crime who someone wrtie:

T>*Write here the crime*

But send it like in this command:

pawn Код:
CMD:*DETECT IN THIS COMMAND THE WORD AND SEND TO THE %s*(playerid, params[])
{
    //911 system
    if(isnull(params)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "Usage: /dis [Message and Location]");
    new sendername[MAX_PLAYER_NAME], string[128], id;
    GetPlayerName(playerid, sendername, sizeof(sendername));
    SendClientMessage(playerid, COLOR_GOLD, "[INFO]You have just called 911. Please Remain at your Location and wait.");
    for(new i=0;i<MAX_PLAYERS;i++) {
        if(GetPlayerSkin(i) == 285 || GetPlayerSkin(i) == 282 || GetPlayerSkin(i) == 281 || GetPlayerSkin(i) == 283 || GetPlayerSkin(i) == 288 ||GetPlayerSkin(i) == 278  || GetPlayerSkin(i) == 275 || GetPlayerSkin(i) == 279 || GetPlayerSkin(i) == 277 || GetPlayerSkin(i) == 274 || GetPlayerSkin(i) == 276) {
            SendClientMessage(i, COLOR_GREY, "-------------------------------------------------------------------------------------------------");
            SendClientMessage(i, COLOR_ROYALBLUE, "DPS AUTOMATED DISPATCH");
            SendClientMessage(i, COLOR_GREY, "Be advised. The following is a 911 call relay.");
            format(string, sizeof(string), "Caller name: %s", sendername);
            SendClientMessage(i, COLOR_GREY, string);
            format(string, sizeof(string), "Quoted informations: %s", params);
            SendClientMessage(i, COLOR_GREY, string);
            SendClientMessage(i, COLOR_GREY, "Suggested action: Get to the scene for a verify of the call.");
            SendClientMessage(i, COLOR_GREY, "Call code: Unknown.");
            SendClientMessage(i, COLOR_GREY, "-------------------------------------------------------------------------------------------------");
            if(GetPlayerSkin(i) == 285 || GetPlayerSkin(i) == 282 || GetPlayerSkin(i) == 281 || GetPlayerSkin(i) == 283 || GetPlayerSkin(i) == 288 ||GetPlayerSkin(i) == 278  || GetPlayerSkin(i) == 275 || GetPlayerSkin(i) == 279 || GetPlayerSkin(i) == 277 || GetPlayerSkin(i) == 274 || GetPlayerSkin(i) == 276)
            SetPlayerMarkerForPlayer(playerid, i, 0xFF0000FF);

         }

    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)