Vice City Multiplayer
VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: Fuzzy168 on November 05, 2011, 06:59:50 pm
-
Is there anyway to set a timer to a specific person?
-
Yes, don't use shitty PAWN.
-
You mean:
OnplayerCommandText:
[pawn] else if (strcmp(cmd, "freeze", true) == 0) {
new szMsg[256], plr;
else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Jugador Desconocido");
SetTimer("freezel",130000,plr);[/pawn]
Functions near script button:
[pawn]public freeze(plr)
{
TogglePlayerControllable(plr,1);
}
public freeze2(plr)
{
TogglePlayerControllable(plr,1);
}[/pawn]
Its only an example... This isnt TESTED.
Hope it help you.
-
Fuzzy: squirrel (http://vcmp.liberty-unleashed.co.uk/forum/index.php)
You mean:
OnplayerCommandText:
[pawn] else if (strcmp(cmd, "freeze", true) == 0) {
new szMsg[256], plr;
else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Jugador Desconocido");
SetTimer("freezel",130000,plr);[/pawn]
Functions near script button:
[pawn]public freeze(plr)
{
TogglePlayerControllable(plr,1);
}
public freeze2(plr)
{
TogglePlayerControllable(plr,1);
}[/pawn]
Its only an example... This isnt TESTED.
Hope it help you.
That doesn't work you are fusing squirrel and pawn scripts.
Timer can only be used as function() not function(something,something.....) etc.
-
Yes OnplayerCommandText:
[pawn] else if (strcmp(cmd, "freeze", true) == 0) {
new szMsg[256], plr;
else if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_RED,"Error: Jugador Desconocido");
SetTimer("freezel",130000,plr);[/pawn]
Good Dilson
-
Its not a freeze command but i was actually using it for heal and teleportation commands...
Edit:plr instead of playerid will set it for 1 player right?
-
You cannot set a timer to a specific person in Pawn.
Those scripts will not work
When are you going to get it through your thick skulls that trying to do that in Pawn DOES NOT WORK? (http://www.halloweenforum.com/attachments/general-halloween/84325d1314935523-what-did-you-find-buy-today-facepalm.gif)
-
I expected stormeus so badly to come with this reply ::)..
There are still some ways to make it go through a timer. Like...
[pawn]
enum somenab {
lolwut,
ftw
};
enum anothernab {
wtf,
umad
};
new PlayerCall[somenab][anothernab];
// As example, in function
PlayerCall[lolwut][umad] = 1;[/pawn]
Used in timers
[pawn]
if(PlayerCall[lolwut][umad] == 1)
{
SetWaterLevel(0);
}[/pawn]
One thing to note,
omarlin is so great, he posts things without even knowing what they mean, just to have a post there, like he said somewhere
Fuzzy1668 ( not sure if the name is correct ) :
lol exactly
omarlin97 ( not sure if the name is correct) :
lol precisely
Isn't he lovely? ( NO HOMO ! )
-
Fuzzy better use Squirrel (http://vcmp.liberty-unleashed.co.uk/forum/)
Much Easy with many features.
-
Sup guys , missed me? , banging around here again ... BANG!!!!!!!!! Fuzzy pawn is a c type language but 3z is much more functions limited in pawn . Better start squirrel
-
My name is clearly on the post..
not sure if the name is correct
better use Squirrel
many features
Better start squirrel
The only reason why I'm stuck with Pawn is because this is the first(In VC:MP but second in Vice City) scripting language I've learn. I've been planning to learn Squirrel but maybe after some time.
EDIT:I still don't get a thing you say shadow.. :-\
-
Pawn can settimers on functions but not on specific player . Shadow had gave the idea to use timers by strings and enums. But that gona make server little too laggy
-
How about if I want to make a anti-hack function? I know I can't use playerid, so what I must do?
-
Oh god, I have to remake this one, AGAIN...
// On the top of the script
[pawn]new PlayerHacking[MAX_PLAYERS];[/pawn]
// In the command/function
new Float:hp;
if(GetPlayerHealth(playerid,hp) > 100) PlayerHacking[playerid] = 1;
// In the timer
[pawn] new i;
for( i < MAX_PLAYERS; i++ ) {
if(IsPlayerConnected(i)) {
if(PlayerHacking == 1)
{
Ban(i);
}
}
}
[/pawn]
playerid = The player you are pointing at, using the ID
1 / 0 = The sentence is true or false
i = A substitute for playerid. The server is going through all the player slots, checking if someone was hacking...