[POMOC]Kredit za telefon

Započeo Johanson, Oktobar 08, 2012, 13:39:48 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Skripta koju koristim:GTARP
Detaljan opis problema:Kako da ubacim kredit za telefon?
Dio skripte:/
Neke slike/video za lakse dobivanje pomoci(neobavezno):/

Vegas.

Napraviš varijabilu za igrača pKredit, i onda napraviš /kupikredit KOLIČINA.. Ako se ne razumiješ u to odradiću ti..

Da,pokusavao sam ja to,ali da li nekako mora da se definise taj pKredit,i izvini sada ako mozes da mi ti to odradis ako te ne mrzi naravno

vegas se odradi to i meni treba  molim te!
big respect 4 Blaeks Vuzimir  Shoorty Scripter HamZa

Vegas.

Dajte varijabile za telefon, ako želite i položaj gde da se kupuje, varijabilu za kredit i napraviću vam. Naravno i cjenu.

pod enum pinfo: pKredit , pod OnPlayerConnect PlayerInfo[playerid][pKredit] = 0;

Pod OnPlayerRegister , Update i Login napravite sistem za cuvanje

Onda provera kredita: if (strcmp("/proverikredit", cmdtext, true, 10) == 0 || strcmp("/pk", cmdtext, true, 10) == 0)
{
  format(string, sizeof(string), " Trenutno stanje na vasem racunu je %d dinara kredita.", PlayerInfo[playerid][pKredit]);
SendClientMessage(playerid, BELA, string);
return 1;
}


Onda ako hocete da vam se oglasi daju preko kredita dodate u komandu za oglase if(PlayerInfo[playerid][pKredit] < 50)
        {
            SendClientMessage(playerid, COLOR_YELLOW, "SMS: Nemate dovoljno kredita oglas kosta 50 din kredita, molimo dopunite vas kredit. Posiljalac: Novinar Studio ");
            return 1;
        }


u komandi za poziv dodate if(PlayerInfo[playerid][pKredit] == 0)
{
SendClientMessage(playerid, COLOR_GRAD2, "  nemate kredita za obaviti ovo zvanje !");
return 1;
}


u komandi za slanje poruka: if(PlayerInfo[playerid][pKredit] < 2)
{
SendClientMessage(playerid, COLOR_GRAD2, " Nemas kredita");
return 1;
}


Na kraju trebate da napravite komandu za kupovinu kredita, to morate sami zato sto su nekima kiosci biznisi a nekima samo objekat.

Vegas.

Evo za kupnju. if(!strcmp(cmdtext, "/kupikredit", true))
{
ShowPlayerDialog(playerid, KUPI_KREDIT, DIALOG_STYLE_INPUT, "Kredit", "Unesite koliko kredita zelite da kupite.", "Unesi", "Cancel");
}

if(dialogid == KUPI_KREDIT)
{
if(response)
{
new kol = strval(inputttext);
new cena = kol*2;
if(cena > GetPlayerMoney(playerid)) return SendClientMessage(playerid, -1, "{7FFF00}(INFO) {FFFFFF}Nemas dovoljno novca.");
PlayerInfo[playerid][pKredit] = kol;
SendClientMessage(playerid, -1, "{7FFF00}(INFO) {FFFFFF}Kupili ste kredita.");
}
}

C:\DOCUME~1\Alen\Desktop\BC-RP\GAMEMO~1\BC-RP.pwn(11977) : error 010: invalid function or declaration
Cle:\DOCUME~1\Alen\Desktop\BC-RP\GAMEMO~1\BC-RP.pwn(11981) : error 010: invalid function or declaration

To mi izadje kad ubacim ovo za /proveri kredit,to ubacim na kraj onplayerregister i nece :S

Resio sam to,nego sad kad posaljem sms posalje mi 2 poruke za redom.


if(strcmp(cmd, "/txt", true) == 0 || strcmp(cmd, "/t", true) == 0 || strcmp(cmd, "/sms", true) == 0)
{
    if(IsPlayerConnected(playerid))
{
    if(gPlayerLogged[playerid] == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "   You havent logged in yet!");
            return 1;
        }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/t)ext [phonenumber] [text chat]");
return 1;
}
if(PlayerInfo[playerid][pPnumber] == 0)
{
SendClientMessage(playerid, COLOR_GRAD2, "  You don't have a cell phone...");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s takes out a cellphone.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new phonenumb = strval(tmp);
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, "USAGE: (/t)ext [phonenumber] [text chat]");
return 1;
}
if(phonenumb == 555)
{
if ((strcmp("yes", result, true, strlen(result)) == 0) && (strlen(result) == strlen("yes")))
{
SendClientMessage(playerid, COLOR_WHITE, "Text Message Delivered.");
if (gTeam[playerid] == 2 || gTeam[playerid] == 1)
{
SendClientMessage(playerid, COLOR_YELLOW, "SMS: I have no idea what you're talking about, Sender: MOLE (555)");
RingTone[playerid] = 20;
return 1;
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_YELLOW, "SMS: A simple Yes will do, Sender: MOLE (555)");
RingTone[playerid] = 20;
return 1;
}
}
if(PlayerInfo[playerid][pKredit] < 2)
{
SendClientMessage(playerid, COLOR_GRAD2, " Nemas kredita");
return 1;
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pPnumber] == phonenumb && phonenumb != 0)
{
giveplayerid = i;
Mobile[playerid] = giveplayerid; //caller connecting
if(IsPlayerConnected(giveplayerid))
{
    if(giveplayerid != INVALID_PLAYER_ID)
    {
        if(PhoneOnline[giveplayerid] > 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "   That players Phone is Offline!");
            return 1;
        }
format(string, sizeof(string), "SMS: %s, Sender: %s (%d)", result,sendername,PlayerInfo[playerid][pPnumber]);
GetPlayerName(giveplayerid, sendername, sizeof(sendername));
//format(string, sizeof(string), "* %s's phone beeps.", sendername);
RingTone[giveplayerid] =20;
SendClientMessage(playerid, COLOR_WHITE, "Text Message Delivered");
SendClientMessage(giveplayerid, COLOR_YELLOW, string);
SendClientMessage(playerid,  COLOR_YELLOW, string);
format(string, sizeof(string), "~r~$-%d", pKreditcena);
GameTextForPlayer(playerid, string, 5000, 1);
PlayerInfo[playerid][pKredit] -=2;
SBizzInfo[2][sbTill] += pKreditcena;
ExtortionSBiz(2, pKreditcena);
            PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
            Mobile[playerid] = 255;
return 1;
}
}
}
}
}
SendClientMessage(playerid, COLOR_GRAD2, "  Message Delivery Failed...");
}
return 1;
}

Vegas.

Probaj sad. if(strcmp(cmd, "/txt", true) == 0 || strcmp(cmd, "/t", true) == 0 || strcmp(cmd, "/sms", true) == 0)
{
    if(IsPlayerConnected(playerid))
{
    if(gPlayerLogged[playerid] == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "   You havent logged in yet!");
            return 1;
        }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/t)ext [phonenumber] [text chat]");
return 1;
}
if(PlayerInfo[playerid][pPnumber] == 0)
{
SendClientMessage(playerid, COLOR_GRAD2, "  You don't have a cell phone...");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s takes out a cellphone.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new phonenumb = strval(tmp);
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, "USAGE: (/t)ext [phonenumber] [text chat]");
return 1;
}
if(phonenumb == 555)
{
if ((strcmp("yes", result, true, strlen(result)) == 0) && (strlen(result) == strlen("yes")))
{
SendClientMessage(playerid, COLOR_WHITE, "Text Message Delivered.");
if (gTeam[playerid] == 2 || gTeam[playerid] == 1)
{
SendClientMessage(playerid, COLOR_YELLOW, "SMS: I have no idea what you're talking about, Sender: MOLE (555)");
RingTone[playerid] = 20;
return 1;
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_YELLOW, "SMS: A simple Yes will do, Sender: MOLE (555)");
RingTone[playerid] = 20;
return 1;
}
}
if(PlayerInfo[playerid][pKredit] < 2)
{
SendClientMessage(playerid, COLOR_GRAD2, " Nemas kredita");
return 1;
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pPnumber] == phonenumb && phonenumb != 0)
{
giveplayerid = i;
Mobile[playerid] = giveplayerid; //caller connecting
if(IsPlayerConnected(giveplayerid))
{
    if(giveplayerid != INVALID_PLAYER_ID)
    {
        if(PhoneOnline[giveplayerid] > 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "   That players Phone is Offline!");
            return 1;
        }
                                GetPlayerName(giveplayerid, sendername, sizeof(sendername));
format(string, sizeof(string), "SMS: %s, Sender: %s (%d)", result,sendername,PlayerInfo[playerid][pPnumber]);
//format(string, sizeof(string), "* %s's phone beeps.", sendername);
RingTone[giveplayerid] =20;
SendClientMessage(playerid, COLOR_WHITE, "Text Message Delivered");
SendClientMessage(giveplayerid, COLOR_YELLOW, string);
SendClientMessage(playerid,  COLOR_YELLOW, string);
format(string, sizeof(string), "~r~$-%d", pKreditcena);
GameTextForPlayer(playerid, string, 5000, 1);
PlayerInfo[playerid][pKredit] -=2;
SBizzInfo[2][sbTill] += pKreditcena;
ExtortionSBiz(2, pKreditcena);
            PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
            Mobile[playerid] = 255;
return 1;
}
}
}
}
}
SendClientMessage(playerid, COLOR_GRAD2, "  Message Delivery Failed...");
}
return 1;
}