Ja bih vas htio pitati u vezi komandi gamemastera...Negdje stavim ovako
i
Citatf(strcmp(cmd, "/respawnallcars", true) == 0 || strcmp(cmd, "/rac", true) == 0) // by Ellis
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 3 || PlayerInfo[playerid][pGM] >= 3)
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
return 1;
}
new bool:unwanted[CAR_AMOUNT];
for(new player=0; player<MAX_PLAYERS; player++)
{
if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
}
for(new car = 1; car <= 800; car++)
{
if(!unwanted[car]) SetVehicleToRespawn(car);
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "SERVER: All unused cars respawned by %s.", sendername);
BroadCast(COLOR_WHITE,string);
}
return 1;
I onda gmovi ne mogu koristiti pa ni admini a kad stavim izmedju ovog "if(PlayerInfo[playerid][pAdmin] < 3 || PlayerInfo[playerid][pGM] >= 3)" i pretvorim u ovo "if(PlayerInfo[playerid][pAdmin] < 3 && PlayerInfo[playerid][pGM] >= 3)"--onda samo admini mogu koristiti...Pitao bih vas kako da stavim neke komande da mogu koristiti i admini i gamemasteri...Molim vas pomozite.A vidite ove ovdje komande ova odlicno radi
Citatif(strcmp(cmd, "/goto", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /goto [playerid/PartOfName]");
return 1;
}
new Float:plocx,Float:plocy,Float:plocz;
new plo;
plo = ReturnUser(tmp);
if (IsPlayerConnected(plo))
{
if(plo != INVALID_PLAYER_ID)
{
if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pGM] >= 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, " You have been teleported");
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command!");
}
}
}
else
{
format(string, sizeof(string), " %d is not an active player.", plo);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
...Ova komanda odlicno radi i za GM I ZA ADM a izmedju stoji || a ne &&...Molim vas pomozite kako da stavim veoma mi je vazno.
nez oceli ti pomoc i dali radi kopiras komandu i zamjenis pAdmin sa gamemasterom ili obratno tj dvaput komandu u gm i na jedoj pAdmin a na drugoj gamemasteri
pa ako ti stoji && mislim da to znaci da mora biti i admin i gm :s
stavi samo || umesto &&
if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pGM] >= 1)
i if(PlayerInfo[playerid][pAdmin] < 3 || PlayerInfo[playerid][pGM] >= 3)
Aj razmisli malo ... :D :D
al treba ovako if(PlayerInfo[playerid][pAdmin] >= 3 || PlayerInfo[playerid][pGM] >= 3)
Procitaj moj tutorial o aritmetickim funkcijama i shvatit ces valjda