[POMOC] Timer koj ce vrsit public za jednog igraca

1. Maj 2012. Zaključano
423
pregleda
5
postova
SeYziicH
4
Made Man
1. Maj 2012.
Skripta koju koristim: Moj mod
Detaljan opis problema: Dakle napravio sam da na komandi /slap dode timer od 30 sekundi i da stavi PlayerInfo = 1; e sad taj timer ide ovako: forward slapo(playerid);
public slapo(playerid)
{
PlayerInfo = 1;
return 1;
}

Ali on meni to namjesti samo igracu koj ima ID 0 a treba mi za igraca koj je koristio /slap :S
Dio skripte:
Neke slike/video za lakse dobivanje pomoci(neobavezno):
Johnâ„¢
5
Godfather
1. Maj 2012.
Postaj /slap komandu.
Deleted User
Obrisan korisnik
1. Maj 2012.
Update verziju sscanf-a (pretpostavljam da ga koristis jer je to tipicno za njega)
SeYziicH
4
Made Man
1. Maj 2012.
if(strcmp(cmd, "/slap", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
  tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, BOJA_INFO, "INFO: /slap [ID/IME]");
return 1;
}
new igrac;
new Float:hp;
new Float:slx, Float:sly, Float:slz;
igrac = ReturnUser(tmp);
if (PlayerInfo >=1 && PlayerInfo == 0)
{
    if(IsPlayerConnected(igrac))
    {
        if(igrac != INVALID_PLAYER_ID)
        {
        GetPlayerName(igrac, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerHealth(igrac, hp);
SetPlayerHealth(igrac, hp-5);
GetPlayerPos(igrac, slx, sly, slz);
SetPlayerPos(igrac, slx, sly, slz+5);
PlayerPlaySound(igrac, 1130, slx, sly, slz+5);
PlayerInfo = 1;
SetTimer("slapo", 30000, 0);
}
}
}
else
{
SendClientMessage(playerid, BOJA_ERROR, "ERROR: Samo admini!");
}
}
return 1;
}

forward slapo(playerid);
public slapo(playerid)
{
PlayerInfo = 0;
return 1;
}
Johnâ„¢
5
Godfather
1. Maj 2012.
Promijeni ovo:
SetTimer("slapo", 30000, 0);


U ovo:
SetTimerEx("slapo", 30000, 0, "d", igrac);

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha