Detective /Track
#2

Well the only problem is that you forgot to pass the playerid to "detecttimer" just use SetTimerEx
pawn Код:
SetTimerEx("detecttimer", 5000, false, "i", playerid);
Well you could use normal arrays instead of PVars (everyone knows they are slow) but if it is only a rarly used command you could stay with it

Another personal thing would be that I dislike huge compound statements so I do
pawn Код:
CMD:localizar(playerid, params[]) {
    if(GetPVarInt(playerid, "PVARemprego") != 402) {
        return SendClientMessage(playerid, -1, "[{FFFF99}Emprego{FFFFFF}]: Nгo йs um [{FFFF99}Detective{FFFFFF}]");
    }
    if(GetPlayerSkin(playerid) != 272) {
        return SendClientMessage(playerid, -1, "[{FFFF99}Emprego{FFFFFF}]: Nгo tens o equipamento de detective! Vai б {0000FF}PSP{FFFFFF} equipar-te!");
    }
    if(isnull(params)) {
        return SendClientMessage(playerid, -1, "[{FFFF99}Emprego{FFFFFF}]: /localizar [ID]");
    }
    if(GetPVarInt(playerid, "PVARDetect_timer") != 0) {
        return SendClientMessage(playerid, -1, "[{FFFF99}Emprego{FFFFFF}]: Tens que esperar 5 segundos para utilizar este comando outra vez!");
    }
    new
        player = strval(params)
    ;
    if(IsPlayerConnected(player) == false) {
        return SendClientMessage(playerid, -1,"[{FFFF99}Emprego{FFFFFF}]: Esse jogador nгo estб conectado!");
    }
    new
        Float: XX1,
        Float: YY1,
        Float: ZZ1
    ;
    GetPlayerPos(player, XX1, YY1, ZZ1);
    SetPlayerCheckpoint(playerid, XX1, YY1, ZZ1, 3.0);

    SetTimerEx("detecttimer", 5000, false, "i", playerid);
    SetPVarInt(playerid, "PVARDetect_timer", 1);

    new
        playername[128]
    ;
    GetPlayerName(player, playername, sizeof(playername));
    format(playername, sizeof(playername), "[{FFFF99}Emprego{FFFFFF}]: Tentaste localizar {99FF00}%s", playername);
    return SendClientMessage(playerid, -1, playername);
}
Reply


Messages In This Thread
Detective /Track - by sagoza - 12.04.2014, 21:25
AW: Detective /Track - by Nero_3D - 13.04.2014, 01:17

Forum Jump:


Users browsing this thread: 1 Guest(s)