Random bug?
#1

I've got a /grove command that either teleports you to the middle of the culdesac in grove street if you're in a vehicle or a bit further back if you're on foot.
CMD:
pawn Код:
zcmd(grove, playerid, params[])
{
  if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
    {
        SetPlayerPos(playerid,2512.0798,-1672.5970,13.4830); // grove
    SetPlayerFacingAngle(playerid,78.4410);
    SendClientMessage(playerid,COLOR_GREEN,"You have teleported to Grove Street.");
    return 1;
    }
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        new vehicleid = GetPlayerVehicleID(playerid);
      SetVehiclePos(vehicleid,2480.3774,-1664.9327,14.0596); // grove_veh
      SetVehicleZAngle(vehicleid,76.4929);
      SendClientMessage(playerid,COLOR_GREEN,"You have teleported to Grove Street.");
    }
  if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
    {
        SetPlayerPos(playerid,2512.0798,-1672.5970,13.4830); // grove
    SetPlayerFacingAngle(playerid,78.4410);
    SendClientMessage(playerid,COLOR_GREEN,"You have teleported to Grove Street.");
    return 1;
    }
    return 1;
}
I've got gl_actions loaded on my server, and whenever I do /grove, my character sits on the ground as if he's on the beach. O_O!
Yet it works fine if I'm in a vehicle. I've checked through the gl_actions script, it has no /grove command at all. All my other teles work fine too!

Could someone tell me WTF this is?
Reply
#2

top:

Quote:

new IsPlayerInGrove[MAX_PLAYERS];

After OnPlayerCommandText
Код:
  if(strcmp(cmdtext, "/grove"))== 0)
  {
    IsPlayerInGrove[playerid] = 1;
    SetPlayerPos(playerid, x, y, z); // << teleport cordinate x,y,z position
    return 1;
  }
after OnPlayerSpawn
Код:
  switch(IsPlayerInGrove[playerid])
  {
    case 0: {SetPlayerPos(playerid, x, y, z);} // << teleport cordinate x,y,z position
    case 1: {SetPlayerPos(playerid, x, y, z);} // << teleport cordinate x,y,z position
    case 2: {SetPlayerPos(playerid, x, y, z);} // << teleport cordinate x,y,z position
  }
you can teleport to add more
Reply
#3

Wait what? So that checks if the player is in grove, and then sends him to grove?

Also, no more OnPlayerCommandText for me xD
ZCMD is so much better and easier!

I still don't get WHY this happens. There is no code to make it happen, unless it's built in to samp somewhere
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)