napravio sam dcmd komandu givedrug i stavio sam ju izvan svih publica a pod onplayercommandtext sam stavio dcmd(givedrug, 33, cmd); i kad udjem u server napisem /givedrug 0 1 kaze mi "Koristiti: /givedrug " evo komande
dcmd_givedrug(playerid, params[])
{
new dID,
playername,
dName,
string;
new ammount;
new string2;
if(sscanf(params, "us", dID, ammount)) return SendClientMessage(playerid, COLOR_GRAD1, "Koristiti: /givedrug ");
if(dID = INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GRAD1, "Taj igrac je offline");
if(PlayerInfo >= ammount)
{
new drug = PlayerInfo;
PlayerInfo = drug+ammount;
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "%s vam je dao %d grama droge", playername, ammount);
SendClientMessage(dID, COLOR_LIGHBLUE, string);
GetPlayerName(dID, dName, sizeof(dName));
format(string2, sizeof(string2), "%s vam je dao %d grama droge", dName, ammount);
SendClientMessage(dID, COLOR_LIGHBLUE, string2);
new drug2 = PlayerInfo;
PlayerInfo = drug2-ammount;
}
if(PlayerInfo < ammount)
{
SendClientMessage(playerid, COLOR_GRAD1, "Nemate toliko droge kod sebe");
}
return 1;
}
i ovo sta sam dodao pod onplayercommandtext
dcmd(givedrug, 33, cmd);
[pomoc]dcmd
1,045
pregleda
10
postova
9. Okt. 2010.
Luksa ti je napisao ! u - user (korisnik ) . a "i" ili "d" je integer ,
if(sscanf(params, "ud", dID, ammount)) 9. Okt. 2010.
ok ali imam jos jedno pitanje, nadam se da nisam dosadan xD, kad upisem /givedrug 0 1 kaze mi da je taj igrac offline a ja sam ID 0, evo komande
dcmd_givedrug(playerid, params[])
{
new dID,
playername,
dName,
string;
new ammount;
new string2;
if(sscanf(params, "ud", dID, ammount)) return SendClientMessage(playerid, COLOR_GRAD1, "Koristiti: /givedrug ");
if(dID = INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GRAD1, "Taj igrac je offline");
if(PlayerInfo >= ammount)
{
new drug = PlayerInfo;
PlayerInfo = drug+ammount;
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "%s vam je dao %d grama droge", playername, ammount);
SendClientMessage(dID, COLOR_LIGHBLUE, string);
GetPlayerName(dID, dName, sizeof(dName));
format(string2, sizeof(string2), "%s vam je dao %d grama droge", dName, ammount);
SendClientMessage(dID, COLOR_LIGHBLUE, string2);
new drug2 = PlayerInfo;
PlayerInfo = drug2-ammount;
}
if(PlayerInfo < ammount)
{
SendClientMessage(playerid, COLOR_GRAD1, "Nemate toliko droge kod sebe");
}
return 1;
}
dcmd_givedrug(playerid, params[])
{
new dID,
playername,
dName,
string;
new ammount;
new string2;
if(sscanf(params, "ud", dID, ammount)) return SendClientMessage(playerid, COLOR_GRAD1, "Koristiti: /givedrug ");
if(dID = INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GRAD1, "Taj igrac je offline");
if(PlayerInfo >= ammount)
{
new drug = PlayerInfo;
PlayerInfo = drug+ammount;
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "%s vam je dao %d grama droge", playername, ammount);
SendClientMessage(dID, COLOR_LIGHBLUE, string);
GetPlayerName(dID, dName, sizeof(dName));
format(string2, sizeof(string2), "%s vam je dao %d grama droge", dName, ammount);
SendClientMessage(dID, COLOR_LIGHBLUE, string2);
new drug2 = PlayerInfo;
PlayerInfo = drug2-ammount;
}
if(PlayerInfo < ammount)
{
SendClientMessage(playerid, COLOR_GRAD1, "Nemate toliko droge kod sebe");
}
return 1;
}
Morate biti prijavljeni da biste odgovorili na ovu temu.
Prijava