/givelicense Bug
Hallo Also ich habe ein befehle givelicense und wenn /givelicense mache Schein ID passiert nix?
if(strcmp(cmd, "/givelicense", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsAnInstructor(playerid))
{
if(PlayerInfo[playerid][pRank] < 2)
{
SendClientMessage(playerid, COLOR_GREY, "Nur mit Rang 2 oder höher kann man Lizenzen ausstellen !");
return 1;
}
new x_nr[256];
x_nr = strtok(cmdtext, idx);
if(!strlen(x_nr)) {
SendClientMessage(playerid, COLOR_WHITE, "Benutzung: /givelicense [Schein] [playerid/Name]");
SendClientMessage(playerid, COLOR_WHITE, "Scheine: Autoschein, Flugschein, Angeler, Bootschein, Motorradschein, Rollerschein, LKWschein");
return 1;
}
if(strcmp(x_nr,"fahren",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Benutze: /givelicense fahren [Spieler ID / Name]");
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 eine Fahrlizens gegeben..",giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Lehrer %s hat dir eine Fahrlicense gegeben.",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pCarLic] = 1;
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Der Spieler ist Offline !");
return 1;
}
}
else if(strcmp(x_nr,"fliegen",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Benutze: /givelicense fliegen [Spieler ID / Name]");
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), "*Lehrer %s hat dir einen Flugschein gegeben.",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pFlyLic] = 1;
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Der Spieler ist Offline !");
return 1;
}
}
else if(strcmp(x_nr,"boot",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Benutze: /givelicense boot [Spieler ID / Name]");
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 Bootschein gegeben.",giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Lehrer %s hat dir einen Bootschein gegeben.",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pBoatLic] = 1;
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Der Spieler ist Offline !");
return 1;
}
}
else if(strcmp(x_nr,"fischen",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Benutze: /givelicense fischen [Spieler ID / Name");
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 eine Angellizens gegeben.",giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Lehrer %s hat dir eine Angellizens gegeben.",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pFishLic] = 1;
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Der Spieler ist Offline !");
return 1;
}
}
else if(strcmp(x_nr,"LKW",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Benutze: /givelicense LKW [Spieler ID / Name");
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 LKW Schein gegeben.",giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Lehrer %s hat dir ein LKW Schein gegeben.",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pLKWLic] = 1;
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Der Spieler ist Offline !");
return 1;
}
}
else if(strcmp(x_nr,"Motorrad",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Benutze: /givelicense Motorrad [Spieler ID / Name");
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 Motorad Schein gegeben.",giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Lehrer %s hat dir ein Motorad Schein gegeben.",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pMotoLic] = 1;
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Der Spieler ist Offline !");
return 1;
}
}
else if(strcmp(x_nr,"Roller",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Benutze: /givelicense Roller [Spieler ID / Name]");
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 Rollerschein gegeben.",giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Lehrer %s hat dir einen Rollerschein gegeben.",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pRollerLic] = 1;
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Der Spieler ist Offline !");
return 1;
}
}
else if(strcmp(x_nr,"waffen",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Benutze: /givelicense waffen [Spieler ID / Name]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[giveplayerid][pLevel] < 5 && !IsACop(giveplayerid))
{
SendClientMessage(playerid, COLOR_GRAD1, "Der Spieler ist nicht Level 5!");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* Du hast %s einen Waffenschein gegeben.",giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Lehrer %s hat dir einen Waffenschein gegeben.",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
PlayerInfo[giveplayerid][pGunLic] = 1;
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Der Spieler ist Offline !");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Du bist kein Fahrlehrer !");
return 1;
}
}
return 1;
}