Hey alle zusammen,
ich habe folgendes Problem habe alles im Script so um geschreiebn für /agivelicense das fahrlehrer und admins in nutzen könn aber iwie steht dann da wenn
ich /agivelicense mache "Nur Admins dürfen diesen Befehl nutzen" .. Am liebsten hätte ich ja das NUR Admin /agivelicense machen könn nicht die Fahrlehrer da die schon /givelicense haben..
und deshalb hatte ich noch was dazugefügt für die Admins aber iwie hauts nicht hin..wenn ich versuche das nur admins agivelicense machen könn stürtzt pawno ab =( ich hofe ihr könnt mir eben helfen
if(strcmp(cmd, "/agivelicense", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsAnInstructor(playerid) || PlayerInfo[playerid][pAdmin] >= 1337)
{
if(PlayerInfo[playerid][pRank] < 1 || PlayerInfo[playerid][pAdmin] >= 1337)
{
SendClientMessage(playerid, COLOR_GREY, " Nur Admins dürfen diesen Befehl nutzen!");
return 1;
}
new x_nr[256];
x_nr = strtok(cmdtext, idx);
if(!strlen(x_nr)) {
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givelicense [name] [playerid/PartOfName]");
SendClientMessage(playerid, COLOR_WHITE, "Available names: Driving, Flying, Sailing, Fishing, Weapon, alle.");
return 1;
}
if(strcmp(x_nr,"driving",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givelicense Driving [playerid/PartOfName]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* Du hast %s einen Führerschein gegeben.",giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Admin %s hat dir ein Führerschein gegeben.",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pCarLic] = 1;
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player is Offline !");
return 1;
}
}
else if(strcmp(x_nr,"flying",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givelicense Flying [playerid/PartOfName]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* Du hast %s einen Flugschein gegeben.",giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Admin %s hat dir ein Flugschein gegeben.",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pFlyLic] = 1;
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player is Offline !");
return 1;
}
}
else if(strcmp(x_nr,"sailing",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givelicense Sailing [playerid/PartOfName]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* Du hast %s einen Angelschein gegeben.",giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Admin %s hat dir ein Angelschein gegeben.",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pBoatLic] = 1;
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player is Offline !");
return 1;
}
}
else if(strcmp(x_nr,"fishing",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givelicense Fishing [playerid/PartOfName]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* Du hast %s ein fisherschein gegeben.",giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Admin %s hat dir ein fischerschein gegeben!.",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pFishLic] = 1;
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Dieser Spieler ist offline !");
return 1;
}
}
else if(strcmp(x_nr,"alle",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givelicense alle [playerid/PartOfName]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* Du hast %s alle Scheine gegeben.",giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Admin %s hat dir alle scheine gegeben!.",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pFishLic] = 1;
PlayerInfo[giveplayerid][pFlyLic] = 1;
PlayerInfo[giveplayerid][pCarLic] = 1;
PlayerInfo[giveplayerid][pGunLic] = 1;
PlayerInfo[giveplayerid][pBoatLic] = 1;
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Dieser Spieler ist offline !");
return 1;
}
}
else if(strcmp(x_nr,"weapon",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givelicense Weapon [playerid/PartOfName]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* Du hast %s ein Waffenschein gegeben.",giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Admin % hat dir den Waffenschein gegeben.",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pGunLic] = 1;
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Dieser Spieler ist offline !");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Du bist kein Admin !");
return 1;
}
}
return 1;
}