2 problems click here please. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: 2 problems click here please. (
/showthread.php?tid=265506)
2 problems click here please. -
Davz*|*Criss - 01.07.2011
Hey guys
here is the code of a cmd.
Код:
CMD:setvipsil(playerid, params[])
{
if (IsPlayerAdmin(playerid))
{
new
targetid,
Year,
Month,
Day;
getdate(Year, Month, Day);
if (!sscanf(params, "u",playerid))
{
if (targetid != INVALID_PLAYER_ID)
{
new
message[160];
ViPSilver[targetid] = 1;
format(message, sizeof(message), "{11DF1E}Admin %s made %s ViP Silver On %02d/%02d/%d {F33C32}.. Congratulations ..!", playerid, targetid, Day, Month, Year);
SendClientMessageToAll(0xAA3333AA, message);
}
else SendClientMessage(playerid, 0xFF0000FF, "That player is not connected.");
}
else SendClientMessage(playerid, 0xFFFFFFFF, "{2E14DC}Usage: /SetVipSilv (PlayerID).");
}
else SendClientMessage(playerid, 0xFF0000FF, "Only admins can use this command!");
return 1;
}
and when i type /setvipsil
and set my self vip.
it sends
[04:19:09] {11DF1E}Admin made ViP Silver On 01/07/2011 {F33C32}.. Congratulations ..!
please help me thanks.
Re: 2 problems click here please. -
System64 - 01.07.2011
what's wrong man?
Re: 2 problems click here please. -
Davz*|*Criss - 01.07.2011
Listen when i type /setvipsil 0
It makes me VIP
[04:19:09] {11DF1E}Admin made ViP Silver On 01/07/2011 {F33C32}.. Congratulations ..!
Look in after Admin there is no name , and after made there is no name
please look the code up and tell me what's wrong in my mind i dont think anything is wrong.
thanks
Re: 2 problems click here please. -
System64 - 01.07.2011
try this, you put in sscanf, playerid, not targetid
pawn Код:
CMD:setvipsil(playerid, params[])
{
new targetid, Year, Month, Day;
if (IsPlayerAdmin(playerid))
{
getdate(Year, Month, Day);
if (sscanf(params, "u",targetid)) SendClientMessage(playerid, 0xFFFFFFFF, "{2E14DC}Usage: /SetVipSilv (PlayerID).");
else if (targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000FF, "That player is not connected.");
else
new message[160];
ViPSilver[targetid] = 1;
format(message, sizeof(message), "{11DF1E}Admin %s made %s ViP Silver On %02d/%02d/%d {F33C32}.. Congratulations ..!", playerid, targetid, Day, Month, Year);
SendClientMessageToAll(0xAA3333AA, message);
}
else SendClientMessage(playerid, 0xFF0000FF, "Only admins can use this command!");
return 1;
}