if(strcmp(cmd, "/startlesson", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Benutze: /startlesson [playerid/PartOfName] [Betrag]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Benutze: /startlesson [playerid/PartOfName] [Betrag]");
return 1;
}
new Betrag = strval(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You've started %s's Lesson.",giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Instructor %s has started your Lesson.",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
TakingLesson[giveplayerid] = 1;
GivePlayerMoney(giveplayerid, Betrag);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Der Player ist offline !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Du bist kein Lehrer !");
return 1;
}
}
return 1;
}
So, müsste funktionieren. Betrügender Abwerber *hust* xD