Need help with /vips command -
Aleks1337 - 26.07.2011
Me and my friends are making a server in strcmp and i wanted to make a /vips command that's the same as the /admins command but shows all the online vips instead of admins. Can anyone supply me with the command? If u cant help me with this command can u at least send me a /admins command?
Re: Need help with /vips command -
sleepysnowflake - 26.07.2011
Yeah, we need to see your code so we can have an ideea what we are dealing with here.
If you make like pInfo[playerid][pRank] or something ... Just change the ADMIN rank to VIP rank or something ?
This forum requires that you wait 120 seconds between posts. Please try again in 1 seconds. Insane O.o
Re: Need help with /vips command -
Aleks1337 - 26.07.2011
What part of the code do u need?
when i make a code for vip only i use
Код:
if(IsPlayerVipType(playerid,1))
the one at the end is vip level 1 (vip silver)
level 2 = vip gold
level 3 = vip premium
Re: Need help with /vips command -
Shadoww5 - 26.07.2011
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/vips", true) == 0)
{
new str[128];
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(!IsPlayerConnected(i)) continue;
GetPlayerName(i, str, 24);
if(IsPlayerVipType(i,1)) { format(str, sizeof str, ">> %s [ID %d] - VIP Silver", str, i); }
else if(IsPlayerVipType(i,2)) { format(str, sizeof str, ">> %s [ID %d] - VIP Gold", str, i); }
else if(IsPlayerVipType(i,3)) { format(str, sizeof str, ">> %s [ID %d] - VIP Premium", str, i); }
else continue;
SendClientMessage(playerid, 0xFFFF00FF, str);
}
return 1;
}
return 0;
}
Re: Need help with /vips command -
Aleks1337 - 26.07.2011
Quote:
Originally Posted by Shadoww5
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/vips", true) == 0)
{
new str[128];
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(!IsPlayerConnected(i)) continue;
GetPlayerName(i, str, 24);
if(IsPlayerVipType(i,1)) { format(str, sizeof str, ">> %s [ID %d] - VIP Silver", str, i); }
else if(IsPlayerVipType(i,2)) { format(str, sizeof str, ">> %s [ID %d] - VIP Gold", str, i); }
else if(IsPlayerVipType(i,3)) { format(str, sizeof str, ">> %s [ID %d] - VIP Premium", str, i); }
else continue;
SendClientMessage(playerid, 0xFFFF00FF, str);
}
return 1;
}
return 0;
}
|
now i get this error
Код:
C:\Users\Aleksandar\Desktop\Samp Stuff\Server\gamemodes\FreeRoam.pwn(1827) : error 029: invalid expression, assumed zero
C:\Users\Aleksandar\Desktop\Samp Stuff\Server\gamemodes\FreeRoam.pwn(1827) : error 029: invalid expression, assumed zero
C:\Users\Aleksandar\Desktop\Samp Stuff\Server\gamemodes\FreeRoam.pwn(1846) : warning 225: unreachable code
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.
Re: Need help with /vips command -
Aleks1337 - 27.07.2011
can someone please help, if u cant help me with this command can u at least send me a /admins command?
Re: Need help with /vips command -
=WoR=Varth - 27.07.2011
READ THIS BEFORE POSTING! (RULES TO FOLLOW)
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/vips", true) == 0)
{
new str[128];
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
GetPlayerName(i, str, 24);
if(IsPlayerVipType(i,1)) format(str, sizeof str, ">> %s [ID %d] - VIP Silver", str, i);
if(IsPlayerVipType(i,2)) format(str, sizeof str, ">> %s [ID %d] - VIP Gold", str, i);
if(IsPlayerVipType(i,3)) format(str, sizeof str, ">> %s [ID %d] - VIP Premium", str, i);
SendClientMessage(playerid, 0xFFFF00FF, str);
}
}
return 1;
}
return 0;
}
Re: Need help with /vips command -
Aleks1337 - 27.07.2011
Quote:
Originally Posted by varthshenon
READ THIS BEFORE POSTING! (RULES TO FOLLOW)
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp(cmdtext, "/vips", true) == 0) { new str[128]; for(new i = 0; i < MAX_PLAYERS; i ++) { if(IsPlayerConnected(i)) { GetPlayerName(i, str, 24); if(IsPlayerVipType(i,1)) format(str, sizeof str, ">> %s [ID %d] - VIP Silver", str, i); if(IsPlayerVipType(i,2)) format(str, sizeof str, ">> %s [ID %d] - VIP Gold", str, i); if(IsPlayerVipType(i,3)) format(str, sizeof str, ">> %s [ID %d] - VIP Premium", str, i); SendClientMessage(playerid, 0xFFFF00FF, str); } } return 1; } return 0; }
|
That's the exact same code the other showed me. Learn to actually help others not copy and paste what other people say just so you can have more posts
Re: Need help with /vips command -
=WoR=Varth - 27.07.2011
Quote:
Originally Posted by Aleks1337
That's the exact same code the other showed me. Learn to actually help others not copy and paste what other people say just so you can have more posts
|
Learn before posting
https://sampwiki.blast.hk/wiki/Control_Structures#else_if
Re: Need help with /vips command -
Shockey HD - 27.07.2011
Quote:
Originally Posted by varthshenon
|
Dude, is the real reason you keep posting is because you wanna leech post? come on now?Please do not spam. How about this! Solve his, I don't see him doing anything wrong with his post. Sure he could of posted in Scripting Request but he seems to have more problem. This isn't a request its asking for help. He wants to know how he could do it like /admins but /vip.
Also when you tell someone to reason something about Learn before posting, you might actually wanna tell them what to learn.