[pomoc]markeri

Započeo ‹Fox›, Oktobar 07, 2010, 12:50:36 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

radim posao smetlar i kad lik koji ima taj posao upise /smetlar postavi mu prvi marker dodem do tog markera i tek me za 5sec freezea i vise me nikad ne unfreeza
to sam radio par checkpointa 3-4 tek tolko za pocetak da vidim jel radi


if (strcmp(cmdtext, "/smetlar", true) == 0)
{
if(PlayerInfo[playerid][pJob] == 1)
{
if(GetPlayerVehicleID(playerid) == 408)
{
PlayerInfo[playerid][pSmetlarduty] = 1;
SetPlayerCheckpoint(playerid, 1395.7295,-1028.3038,25.1046, 8.0);
CP[playerid] = 900;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Niste u vozilu za ciscenje ulice");
}
}
return 1;
}



public OnPlayerEnterCheckpoint(playerid)
{
if(PlayerInfo[playerid][pSmetlarduty] == 1)
{
if(PlayerInfo[playerid][pSmetlarcp] == 1)
{
SendClientMessage(playerid, COLOR_BLUE, "Uspjesno ste zavrsili ciscenje ceste");
}
else
{
SetTimer("ciscenje", 5000, true);
SendClientMessage(playerid, COLOR_GRAD1, "Pricekajte dok ne pocistite smece");
}
}
/////////////smetlar///////////////
if(CP[playerid] == 900) { CP[playerid] = 901; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 1345.4241,-921.5433,35.2521,8.0); }
if(CP[playerid] == 901) { CP[playerid] = 902; DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, 1188.3571,-930.9197,43.0326,8.0);}
if(CP[playerid] == 902) { CP[playerid] = 0;  DisablePlayerCheckpoint(playerid); PlayerInfo[playerid][pSmetlarcp] = 1;}
return 1;
}

Stavi callback ovdje: 'public ciscenje' da vidim..

I da, bezveze radis s PlayerInfo.. jednostavno napravis neku varijablu tipa smetlarduty[max_players]; i puno ti je lakse + ne sprema ti na svakom onplayerupdateu varijablu i sl.
Aequam memento rebus in arduis servare mentem.

forward ciscenje(playerid);
public ciscenje(playerid)
{
TogglePlayerControllable(playerid, 0);
return 1;
}

eto...