Hi Leute ich will mal meine 2 Selfmade Premium Funktionen Reinmachen Hier sind sie:
//Premium Extras
//Premiumrang ad made by Jay_Jackson
if(strcmp(cmd, "/padvertise", true) == 0 || strcmp(cmd, "/pad", true) == 0)
{
if(PlayerInfo[playerid][pDonateRank] > 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "[VERBESSERUNG]: (/pad)vertise [text]");
return 1;
}
new payout = idx * 1;
if(GetPlayerMoney(playerid) < payout)
{
format(string, sizeof(string), "* Du hast %d Buchstaben benutzt das kostet $%d,! Du hast nicht genug!.", offset, payout);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
GivePlayerMoney(playerid, - payout);
SBizzInfo[7][sbTill] += payout;
ExtortionSBiz(7, payout);
format(string, sizeof(string), "Premium-Werbung: %s, Von: %s PH: %d", result, sendername,PlayerInfo[playerid][pPnumber]);
OOCNews(COLOR_YELLOW,string);
format(string, sizeof(string), "~r~Abzug $%d~n~~w~Nachricht hat: %d Characters erreicht", payout, idx);
GameTextForPlayer(playerid, string, 5000, 5);
if (PlayerInfo[playerid][pAdmin] < 1){SetTimer("AddsOn", addtimer, 0);adds = 0;}
}
}
else SendClientMessage(playerid,COLOR_RED,"Du bist kein Premium");
return 1;
}
if(strcmp(cmd, "/pchat", true) == 0) //made by Jay_Jacksonw
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "Verwendung: (/pchat) [Premium Chat]");
return 1;
}
if(PlayerInfo[playerid][pDonateRank] > 0 || PlayerInfo[playerid][pDonateRank] > 0)
{
if(PlayerInfo[playerid][pDonateRank] > 0) { format(string, sizeof(string), "** Premium %s: %s, over. **", sendername, result); }
else
{
format(string, sizeof(string), "**Premium %s: %s, over. **", sendername, result);
}
for(new i=0; i<GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i) && (PlayerInfo[i][pDonateRank] > 0 || PlayerInfo[i][pDonateRank] > 0))
{
SendClientMessage(i,COLOR_GOLD,string);
}
}
printf("%s", string);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " Du bist kein Premium !");
return 1;
}
}
return 1;
}