/find erst am tele

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Hi leute,


    Kann man es so machen, das /find erst geht, wenn man mit jemande Telefoniert?
    Also z.B. wenn ich /find machen will, muss ich Die person die ich suchen will
    erst anrufen...?



    if(strcmp(cmd, "/find", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pJob] != 1)
    {
    SendClientMessage(playerid, COLOR_GREY, " You are not a Detective !");
    return 1;
    }
    if(PlayerOnMission[playerid] > 0)
    {
    SendClientMessage(playerid, COLOR_GREY, " On a mission right now, can't use this command !");
    return 1;
    }
    if(UsedFind[playerid] != 0 && PlayerInfo[playerid][pDetSkill] < 401)
    {
    SendClientMessage(playerid, COLOR_GREY, " You've already searched for someone, wait 2 minutes !");
    return 1;
    }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /find [playerid/PartOfName]");
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    if(IsPlayerConnected(giveplayerid))
    {
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Find yourself!"); return 1; }
    new points;
    new level = PlayerInfo[playerid][pDetSkill];
    if(level >= 0 && level <= 50)
    { points = 4; }
    else if(level >= 51 && level <= 100)
    { points = 6; }
    else if(level >= 101 && level <= 200)
    { points = 8; }
    else if(level >= 201 && level <= 400)
    { points = 10; }
    else if(level >= 401)
    { points = 12; }
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(giveplayerid, X,Y,Z);
    SetPlayerCheckpoint(playerid, X,Y,Z, 6);
    FindTime[playerid] = 1;
    FindTimePoints[playerid] = points;
    PlayerInfo[playerid][pDetSkill] ++;
    UsedFind[playerid] = 1;
    if(PlayerInfo[playerid][pDetSkill] == 50)
    { SendClientMessage(playerid, COLOR_YELLOW, "* Your Detective Skill is now Level 2, soon you are able to find Faction Members."); }
    else if(PlayerInfo[playerid][pDetSkill] == 100)
    { SendClientMessage(playerid, COLOR_YELLOW, "* Your Detective Skill is now Level 3, soon you are able to find Faction Members."); }
    else if(PlayerInfo[playerid][pDetSkill] == 200)
    { SendClientMessage(playerid, COLOR_YELLOW, "* Your Detective Skill is now Level 4, you are now able to find Faction Members."); }
    else if(PlayerInfo[playerid][pDetSkill] == 400)
    { SendClientMessage(playerid, COLOR_YELLOW, "* Your Detective Skill is now Level 5, you are now able to find Faction Members."); }
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " Invalid Name/ID !");
    }
    }
    return 1;
    }

  • if(strcmp(cmd, "/call", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "HILFE: /call [phonenumber]");
    return 1;
    }
    if(PlayerInfo[playerid][pPnumber] == 0)
    {
    SendClientMessage(playerid, COLOR_GRAD2, " You dont't have a cell phone !");
    return 1;
    }
    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USECELLPHONE);
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "* %s takes out a cellphone.", sendername);
    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    new phonenumb = strval(tmp);
    if(phonenumb == 911)
    {
    SendClientMessage(playerid, COLOR_WHITE, "Mr. Pronton sagt: You can use T to talk on the phone and /hangup to hangup the phone");
    SendClientMessage(playerid, COLOR_ALLDEPT, "Emergency Department: Which service do you require, Police or Paramedic?");
    Mobile[playerid] = 911;
    return 1;
    }
    if(phonenumb == PlayerInfo[playerid][pPnumber])
    {
    SendClientMessage(playerid, COLOR_GRAD2, " You just get a busy tone...");
    return 1;
    }
    if(Mobile[playerid] != 255)
    {
    SendClientMessage(playerid, COLOR_GRAD2, " You are already on a call...");
    return 1;
    }
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    if(PlayerInfo[i][pPnumber] == phonenumb && phonenumb != 0)
    {
    giveplayerid = i;
    Mobile[playerid] = giveplayerid; //caller connecting
    if(IsPlayerConnected(giveplayerid))
    {
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    if(PhoneOnline[giveplayerid] > 0)
    {
    SendClientMessage(playerid, COLOR_GREY, " That players Phone is Offline !");
    return 1;
    }
    if (Mobile[giveplayerid] == 255)
    {
    format(string, sizeof(string), "Your Cell Phone is Ringing Type (/Pickup) CallerID: %s", sendername);
    SendClientMessage(giveplayerid, COLOR_YELLOW, string);
    GetPlayerName(giveplayerid, sendername, sizeof(sendername));
    RingTone[giveplayerid] = 10;
    format(string, sizeof(string), "* %s's phone begins to ring.", sendername);
    SendClientMessage(playerid, COLOR_WHITE, "Mr. Pronton sagt: Mr. Pronton sagt: You can use T to talk on the phone and /hangup to hang up the phone");
    ProxDetector(30.0, i, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    CellTime[playerid] = 1;
    return 1;
    }
    }
    }
    }
    }
    }
    SendClientMessage(playerid, COLOR_GRAD2, " You just get a Busy tone...");
    }
    return 1;
    }