Author Topic: Help ME!!  (Read 2520 times)

0 Members and 3 Guests are viewing this topic.

Offline Fuzzy168

  • VC:MP Veteran
  • *****
  • Posts: 729
  • Programming since 2011
    • View Profile
Help ME!!
« on: July 16, 2011, 07:59:00 pm »
Here are the following commands that I need help. I don't know how to do and I can't find any tutorial.

/c tempban
- A command where no one can bring a player to their location? Example: /c nobring

And how to set timer?

-/c teleport (/c goto) / 5 seconds
-/c tempfreeze /  20 seconds
-/c cloak / 10 seconds (Stand still. If move, cancel)

And,

/c banip - HOW?
« Last Edit: July 18, 2011, 04:51:56 am by Fuzzy168 »
I'm beginning to feel like a Lag God, Lag God

Offline Ankit

  • Street Thug
  • *
  • Posts: 29
    • View Profile
Re: Help ME!!
« Reply #1 on: September 27, 2011, 05:30:38 am »

-/c teleport (/c goto) / 5 seconds



Add this TimeGoto and Playertogoto at enum phrase

[pawn]TimeGoto,
PlayerToGoto[256],[/pawn]

And this one at OnPlayerText

[pawn]   else if (strcmp(cmd, "!goto", true) == 0) {
        tmp = strtok(cmdtext, idx);
       if (IsPlayerInfo(playerid,cmd)) return 0;
       else if (GetPlayerSpawn(playerid) == 0) MessagePM(playerid, GREEN,"[Error] - First spawn and then use it.");
       else if (GetPlayerHP(playerid) <= 99) MessagePMFormat(playerid, GREEN,"You have %d HP, only with 100 can teleported.",GetPlayerHP(playerid));
       else if (!strlen(tmp)) MessagePMFormat(playerid, GREEN,"[Syntax] - The correct use: %s <playerid/name>.",cmdtext);
        else if (pInfo[playerid][TimeGoto] == 1) MessagePM(playerid, GREEN,"[Error] - You already have in process a goto.");
         else {
              plr = FindPlayerIDFromString(tmp);
              if (plr == INACTIVE_PLAYER_ID) MessagePM(playerid, GREEN,"[Error] - Unknonw player, try another.");
              else if (GetPlayerSpawn(plr) == 0) MessagePMFormat(playerid, GREEN,"[Error] - %s has isn't spawned.",gPlayers[plr]);
              else if (GetPlayerNogoto(plr) == 1) MessagePMFormat(playerid, GREEN,"[Error] - %s have Nogoto ON.",gPlayers[plr]);
              else {
               format(MSN,256,"%s",gPlayers[plr]);
                   pInfo[playerid][PlayerToGoto] = MSN;
                   pInfo[playerid][TimeGoto] = 1;
                   SetTimer("SetGotoTime",8000,0);
                   MessagePM(playerid, GREEN,"Wait 8 seconds to prevent death evade...");
               }
       }
       return 1;
   }[/pawn]
« Last Edit: September 27, 2011, 05:32:59 am by Ankit »
Name-Ankit Sharma
Age- 10
Location-India
WorkGroup:Small player and Scripter

yazeen

  • Guest
Re: Help ME!!
« Reply #2 on: September 29, 2011, 12:22:11 pm »


-/c teleport (/c goto) / 5 seconds



Add this TimeGoto and Playertogoto at enum phrase

[pawn]TimeGoto,
PlayerToGoto[256],[/pawn]

And this one at OnPlayerText

[pawn]   else if (strcmp(cmd, "!goto", true) == 0) {
        tmp = strtok(cmdtext, idx);
       if (IsPlayerInfo(playerid,cmd)) return 0;
       else if (GetPlayerSpawn(playerid) == 0) MessagePM(playerid, GREEN,"[Error] - First spawn and then use it.");
       else if (GetPlayerHP(playerid) <= 99) MessagePMFormat(playerid, GREEN,"You have %d HP, only with 100 can teleported.",GetPlayerHP(playerid));
       else if (!strlen(tmp)) MessagePMFormat(playerid, GREEN,"[Syntax] - The correct use: %s <playerid/name>.",cmdtext);
        else if (pInfo[playerid][TimeGoto] == 1) MessagePM(playerid, GREEN,"[Error] - You already have in process a goto.");
         else {
              plr = FindPlayerIDFromString(tmp);
              if (plr == INACTIVE_PLAYER_ID) MessagePM(playerid, GREEN,"[Error] - Unknonw player, try another.");
              else if (GetPlayerSpawn(plr) == 0) MessagePMFormat(playerid, GREEN,"[Error] - %s has isn't spawned.",gPlayers[plr]);
              else if (GetPlayerNogoto(plr) == 1) MessagePMFormat(playerid, GREEN,"[Error] - %s have Nogoto ON.",gPlayers[plr]);
              else {
               format(MSN,256,"%s",gPlayers[plr]);
                   pInfo[playerid][PlayerToGoto] = MSN;
                   pInfo[playerid][TimeGoto] = 1;
                   SetTimer("SetGotoTime",8000,0);
                   MessagePM(playerid, GREEN,"Wait 8 seconds to prevent death evade...");
               }
       }
       return 1;
   }[/pawn]

Doesn't work like that you have 2 options:-

1)tell fuzzy to take it from madara's that got all functions dfined
2)or paste all the functions and stuff for him (MessagePm,timer function defiend etc);