[pomoc] /pay

Započeo [PAL]Emir, Oktobar 25, 2011, 17:45:10 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim:Ravens
Opis problema:Moje ime na serveru je emir_corleone kada ukucam /pay i Velid_VRabac 100 i izbaci mi velid_vrabac vadi nesto novca i daje ga emir_corleone kako bih to mogao rijesiti
Dio skripte:CMD:pay(playerid, params[])
{
  if(IsPlayerConnected(playerid))
{

if (sscanf(params, "ui", giveplayerid, moneys))
{
SendClientMessage(playerid, COLOR_WHITE, "{168BFF}INFO: {959561} /pay {959561}[ID/DioImena] {838361} [kolicina]");
}
else if (giveplayerid == INVALID_PLAYER_ID)
{
// This line has been changed slightly as "u" means player name or player id.
SendClientMessage(playerid, COLOR_YELLOW, "Nije aktivan igrac!");
}
else
{
new
playermoney = GetPlayerCash(playerid),
playername[MAX_PLAYER_NAME],  string[128],
playername1[MAX_PLAYER_NAME];
if(moneys > 50 && PlayerInfo[playerid][pLevel] < 3)
{
SendClientMessage(playerid, COLOR_GRAD1, "Moras biti barem lvl 3 da bi mogao platiti preko 50$");
return 1;
}
if(moneys < 1 || moneys > 5000)
{
    SendClientMessage(playerid, COLOR_GRAD1, "Ne idi ispod 1$, ili iznad 5000$.");
    return 1;
}
if (IsPlayerConnected(giveplayerid))
{
if (ProxDetectorS(5.0, playerid, giveplayerid))
   {
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "Ne mozes sam sebi platiti!"); return 1; }
if (moneys > 0 && playermoney >= moneys)
{
// Salje Novac
GivePlayerCash(playerid, (0 - moneys));
GivePlayerCash(giveplayerid, moneys);
// Salje Poruke

GetPlayerName(giveplayerid, playername, sizeof (playername));
format(string, sizeof(string), "Platio si %d$, igracu %s", moneys, playername);
SendClientMessage(playerid, COLOR_PURPLE, string);
GetPlayerName(playerid, playername1, sizeof (playername1));
format(string, sizeof(string), "Primio si %d$ od %s", moneys, playername1);
SendClientMessage(giveplayerid, COLOR_PURPLE, string);
format(string, sizeof(string), "* %s vadi nesto novca i daje ga %s", playername, playername1);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Pogresna kolicina.");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "   Predaleko si.");
}
}//invalid id
}
}
return 1;
}

mrzim ovo..
GetPlayerName(playerid, playername1, sizeof (playername1));
u
GetPlayerName(giveplayer, playername1, sizeof (playername1));

i kad vec koristis zcmd onda koristi i sscanf.. neznam kako imas volje pisat ovakve kodove :/

edit::
nisam pitao, je li samo problem u toj poruci ili kod neradi?
Poslednja Izmena: Oktobar 25, 2011, 17:50:43 POSLE PODNE od K4[Я]!K3™ aka. ^anamonn

Citat: K4[Я]!K3â,,¢ aka. ^anamonn poslato Oktobar 25, 2011, 17:49:36 POSLE PODNE
mrzim ovo..
GetPlayerName(playerid, playername1, sizeof (playername1));
u
GetPlayerName(giveplayer, playername1, sizeof (playername1));

i kad vec koristis zcmd onda koristi i sscanf.. neznam kako imas volje pisat ovakve kodove :/

edit::
nisam pitao, je li samo problem u toj poruci ili kod neradi?

samo je problem u toj poruci ono kada ukucas /pay npr velid 100 izbaci mi velid vadi nesto novca i daje ga emir_corleone

onda probaj ovo zamijenit
format(string, sizeof(string), "* %s vadi nesto novca i daje ga %s", playername, playername1);

u

format(string, sizeof(string), "* %s vadi nesto novca i daje ga %s", playername1, playername);

Citat: K4[Я]!K3â,,¢ aka. ^anamonn poslato Oktobar 25, 2011, 17:54:18 POSLE PODNE
onda probaj ovo zamijenit
format(string, sizeof(string), "* %s vadi nesto novca i daje ga %s", playername, playername1);

u

format(string, sizeof(string), "* %s vadi nesto novca i daje ga %s", playername1, playername);

ee hvala puno rijeseno jee moze lock