Skripta koju koristim:GTARP
Detaljan opis problema:kako da napravim kad se porta neko do igraca /goto da adminima ispise Admin/supporter se portao do igraca tog i tog
i kako da napravim kad nekog ubije da nama adminima ispise igrac je ubio igraca
Dio skripte:
Neke slike/video za lakse dobivanje pomoci(neobavezno):
eto komanda /goto i onplayerdeath
if(strcmp(cmd, "/goto", true) == 0)
{
if(PlayerInfo[playerid][pVip] >= 1)
{
if(Prisustvuje[playerid] == true)
{
SCM(playerid,SVETLOPLAVA,"Na eventu si ne mozes koristiti /goto");
}
return 1;
}
if(PlayerInfo[playerid][pJailed] >= 1) return SCM(playerid,SVETLOPLAVA,"U zatvoru/Jailu ste, ne mozete se teleportovati");
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koristi: /goto [ID Igraca/Deo Imena]");
return 1;
}
if(WantedLevel[playerid] > 0 && PlayerInfo[playerid][pAdministrator] < 4 || WantedLevel[playerid] > 0 && PlayerInfo[playerid][pVip] > 0)
{
SendClientMessage(playerid, COLOR_GREY, "Imate Wanted ne mozete se portovati !");
return 1;
}
new Float:plocx,Float:plocy,Float:plocz;
new plo;
plo = ReturnUser(tmp);
if (IsPlayerConnected(plo))
{
if(plo != INVALID_PLAYER_ID)
{
if(WantedLevel[plo] > 0 && PlayerInfo[playerid][pAdministrator] < 4)
{
SendClientMessage(playerid, COLOR_GREY, "Taj igrac ima wanted ne mozete se portovati do njega !");
return 1;
}
if(PlayerInfo[plo][pAdministrator] > PlayerInfo[playerid][pAdministrator])
{
SendClientMessage(playerid,SVETLOPLAVA,"Ne mozes se teleportovati do nekog ko je jaci od vas");
return 1;
}
if (PlayerInfo[playerid][pAdministrator] >= 1 || PlayerInfo[playerid][pVip] >= 1 || PlayerInfo[playerid][pSupporter] >= 1)
{
if(Spectate[playerid] != 255)
{
Spectate[playerid] = 256;
}
GetPlayerPos(plo, plocx, plocy, plocz);
if(PlayerInfo[plo][pInt] > 0)
{
SetPlayerInterior(playerid,PlayerInfo[plo][pInt]);
PlayerInfo[playerid][pInt] = PlayerInfo[plo][pInt];
PlayerInfo[playerid][pLocal] = PlayerInfo[plo][pLocal];
}
if(PlayerInfo[playerid][pInt] == 0)
{
SetPlayerInterior(playerid,0);
}
if(plocz > 530.0 && PlayerInfo[plo][pInt] == 0) //the highest land point in sa = 526.8
{
SetPlayerInterior(playerid,1);
PlayerInfo[playerid][pInt] = 1;
}
if (GetPlayerState(playerid) == 2)
{
new tmpcar = GetPlayerVehicleID(playerid);
SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
}
else
{
SetPlayerPos(playerid,plocx,plocy+2, plocz);
}
SendClientMessage(playerid, COLOR_GRAD1, "Teleportovani ste");
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Niste ovlasteni da koristite tu komandu!");
}
}
}
else
{
format(string, sizeof(string), " %d nije aktivan igrac.", plo);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(gettime() - GetPVarInt(playerid,"PlayerLastDeath") < 1) Kick(playerid);
SetPVarInt(playerid,"PlayerLastDeath",gettime());
new name[MAX_PLAYER_NAME];
new killerr[MAX_PLAYER_NAME];
new string[256];
new playercash;
new victimteam;
new Float:px,Float:py,Float:pz;
new killerteam;
if(IsInBus[playerid] == 1)
{
IsInBus[playerid] = 0;
KillTimer(Timer1[playerid]);
KillTimer(Timer2[playerid]);
}
if(zonatime[playerid] > 0)
{
KillTimer(zonatimer[playerid]);
new id = zonaid[playerid];
GangZoneStopFlashForAll(ZonaID[id]);
PlayerTextDrawHide(playerid, klecanjetd[playerid]);
zonaid[playerid] -= 1;
zonatime[playerid] -= 1;
SCM(playerid,GRAD2,"Niste uspeli da zauzmete teritoriju, spreceni ste!");
}
if(gPlayerUsingLoopingAnim[playerid] == 1)
{
gPlayerUsingLoopingAnim[playerid] = 0;
}
if(IsOnePlayAnim[playerid] == 1)
{
IsOnePlayAnim[playerid] = 0;
}
if(BackOut[playerid] == 1)
{
BackOut[playerid] = 0;
}
if(ecp[playerid] != 0)
{
Prisustvuje[playerid] = false;
vorcp[playerid] = 0;
}
Za port u komandu stavi nesto tipa
if (PlayerInfo[playerid][pAdmin] > 0)
{
format(string, sizeof(string), "Admin %s se portao do igraca %s", GetName(playerid), GetName(plo));
SendAdminMessage(-1, string);
}
A to za ubijanje igraca u public OnPlayerDeath
if (killerid != INVALID_PLAYER_ID)
{
format(string, sizeof(string), "%s (%d) je ubijen od strane igraca %s (%d)", GetName(playerid), playerid, GetName(killerid), killerid);
SendAdminMessage(-1, string);
}
E sad ako nemas string samo ga definises to valjda znas a ako nemas GetName evo ti stock pa ga stavi negde na kraj scripte...
stock GetName(playerid)
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
return pName;
}
ae mozes mi ti to odradit u /goto komand stavio sam cmd /goto
Pa jesi tolko lenj ja ti odradim sve a tebi tesko to da ubacis u komandu ?
ne nisam lenj :)
nego da nesto ne zeznem hh ubacio sam i radi fala za ovo ae jo sovo
e moze mi ovo pogledas baca mi errore ubacio sam ove tdove i treba mi tako da bude ovo playerid valjda treba neki stock nzm kako za ovaj playerid? da radi i prije mi je bacalo a nzm kako da def ovo playerid
ZGRP.PWN(13269) : error 017: undefined symbol "playerid"
ZGRP.PWN(13270) : error 017: undefined symbol "playerid"
ZGRP.PWN(13271) : error 017: undefined symbol "playerid"
ZGRP.PWN(13272) : error 017: undefined symbol "playerid"
ZGRP.PWN(13273) : error 017: undefined symbol "playerid"
ZGRP.PWN(13274) : error 017: undefined symbol "playerid"
ZGRP.PWN(13275) : error 017: undefined symbol "playerid"
tdmd8[playerid] = TextDrawCreate(38.000000, 309.000000, "UBISTAVA: 6000");
TextDrawBackgroundColor(tdmd8[playerid], 255);
TextDrawFont(tdmd8[playerid], 2);
TextDrawLetterSize(tdmd8[playerid], 0.230000, 1.199999);
TextDrawColor(tdmd8[playerid], -65281);
TextDrawSetOutline(tdmd8[playerid], 1);
Gde si to ubacio u koji callback ?
taj textdraw mora ici pod onplayerconnect callback ukoliko si ga stavio pod ongamemode a jesi, a to mozes i ovako napravit stock td(playerid)
{
pa ti textdrawovi
}
i onda pod onplayerconnect stavis td(playerid);