• Welcome to Vice City Multiplayer.
 
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - cycu

#16
General Discussion / Re: For Admins ... For v0.4
March 30, 2011, 08:46:22 AM
Quote from: [AoD]NC on March 29, 2011, 08:53:20 PM
Please don't post such requests more. We know what are the current bugs, the beta team found even more, that you have never heard about it! :o

At some point you need to remain that there are still people waiting for this mod.

All those problems should be fixed long time ago and released as R3.
#17
ShowRoom (pawn) / Re: Way around: SetTimerEx.
March 29, 2011, 08:15:24 PM
Quote from: Charleyutton on March 29, 2011, 08:07:16 PM
Or you could just use *cough* squirrel *cough*

Nah, it's too easy  ::).
#18
General Discussion / Re: For Admins ... For v0.4
March 29, 2011, 07:26:53 PM
QuoteAdd          Textdraws.
Add          SetTimerEx(funcname[], interval, repeating, const format[], {Float,_}:...);
Add             SetPlayerInterior(playerid, interior);
Add             GetPlayerInterior(playerid);
Add             CreatePickup(model, type, Float:X, Float:Y, Float:Z, Virtualworld);      //Virtual world is not necessary but would be nice to have it.
Add             SetSpawnInfo((playerid, team, skin, Float:x, Float:y, Float:z, Float:Angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
Add             SpawnPlayer(playerid);
Add             Ability to create/add plugins.

Fix           SetPlayerSkin         It works only for skins from 100 + above.
Fix           OnPlayerText         Return 0; doesn't prevent from message being sent.
Fix          OnPlayerEnterVehicle   Crashes however you can be lucky, restart server and it works WTF ?
Fix             SetPlayerColor          Server.exe won't start if this one is used.
Fix             SendClientMessage       Every new message overwrites color of the last one.
Fix             SendClientMessageToAll  Every new message overwrites color of the last one.
Fix             SetPlayeranimation(playerid,anim);

Delete          SetPlayerStartPos
Delete         Server side commands e.g: /kill /sit etc.
Delete        All server side events e.g: "Controls have been revoked, Player Killed player M60" etc.

Replace       SetCameraLookAt      with       SetPlayerCameraLookAt(playerid, x,y,z);
Replace       SetCameraPos          with        SetPlayerCameraPos(playerid, x,y,z);
Replace         "/c" with "/"

If someone have more just post it i will edit the list.
#19
ShowRoom (pawn) / Way around: SetTimerEx.
March 29, 2011, 05:52:04 PM
Hello everyone!

Today i decided to make a little tutorial about:

"How to live without SetTimerEx" ;)

Now i don't know if some of you played sa-mp where this function actually is added, that's why in the start i will explain biggest differences from SetTimer.

SetTimer(funcname[], interval, repeating);
SetTimerEx((funcname[], interval, repeating, const format[], {Float,_}:...);

Now, the most important difference is that SetTimerEx allows you to carry some data(integers, strings etc) from one place of the code to the other which SetTimer obviously can't.

However there is solution for this, it might not be perfect but I'm sure it will work out for most of you!

Let's say that after player spawns you want him to be spawned elsewhere 1 second after the first spawn.
Now, if you used only SetTimer it might work, but only for 1 person, if there is currently more then 1 player on the server it won't work, enough of chit chat - let's start.


On top of your map create 2 new variables which will save our playerid.

new GlobalID = 255;
new GlobalID2 = 255;


It depends on how popular the server is, so you might need to add more of them.

Why 255 ?
You will understand why in a second.

Now in OnPlayerSpawn:

if(GlobalID != 255)
{
SetTimer("SpawnPlayerAfterSpawn",1000,false);
GlobalID2 = playerid;
}
else
{
          SetTimer("SpawnPlayerAfterSpawn",1000,false);
GlobalID = playerid;
}


This little code will check if GlobalID is equal 255 which means that it's free(there is no playerid assigned to it)
and if it's not it will assign playerid to GlobalID2, as i said before if your server is populary you might need to add more of them.
And of course it starts timer.

Now at the end of your script you should add new public:

public SpawnPlayerAfterSpawn( )

Okay, grand finale  8)

In SpawnPlayerAfterSpawn( ) you add:

{
if(GlobalID != 255)
{
SetPlayerPos(GlobalID,5000.0,-5000.0,5000.0,-5000.0,6.0,0);
GlobalID = 255;
}
else if(GlobalID2 != 255)
{
SetPlayerPos(GlobalID2,5000.0,-5000.0,5000.0,-5000.06.0r,0);
GlobalID2 = 255;
}
}


And again this code will check which one of the variables are currently in use and prevents from reseting variable for player who is going to be spawned just right after the first one.

This method is not perfect but i think this is the only solution at the moment, i hope SetTimerEx will be in next release  ???.

If you have some problems/questions feel free to ask i will try to help/answer  :-*.
#20
mIRC/pawn Scripting / Re: Prop Spawn
March 29, 2011, 10:57:30 AM
Quote from: yazeen on March 29, 2011, 06:02:18 AM
And what this function will do is that it will check the prop ID which player owns and send him to right spawn
I use
IsThatHisProperty

Sure that's fine i showed you only an example, it's up to you what name you will call it.

However i think you get the point ?

While player is spawning you have to check his Property ID and as mentioned above, use 'IsThatHisProperty' function to assign right spawn.

But! if you put this in OnPlayerSpawn the player will be bugged(Player can't shoot, enter cars) and the only solution for this is to jump once, but in the end it will be something like this: "What the hell is going on I'm bugged this server sucks"

I think the reason for this bug is because in on GameModeInit you have different spawn pos (AddPlayerClass/AddPlayerClassEx)
then in 'IsThatHisProperty' kind functions where SetPlayerPos is used which leads to this bug.

You can try to use SetTimer - so the function will be called e.g 700 milliseconds after spawn.

I will create tutorial later today called: 'Making your way around because there is no SetTimerEx function...'

8)

#21
mIRC/pawn Scripting / Re: Prop Spawn
March 28, 2011, 01:43:11 PM
Quote from: yazeen on March 28, 2011, 01:04:24 PM
Quote from: cycu on March 28, 2011, 12:54:12 PM
What you mean by prop spawn ? i don't get it so I'm not able to help you before i know what it is.

Propspawn Means if the property is owned then he can spawn at his property!

example : my property malibu

i enable propspawn and i spawn at malibu with any skin

Well this is quite simple, in OnPlayerSpawn you check if player owns property
If yes then you need Function e.g:

SetPlayerPropSpawn(playerid);

And what this function will do is that it will check the prop ID which player owns and send him to right spawn.

Basic Example:

public SetPlayerPropSpawn(playerid)
{
if(PlayerProp[playerid] == 1)
{
   SetPlayerPos(playerid,x,y,z,r,inter);
}
else if(PlayerProp[playerid] == 1)
{
   SetPlayerPos(playerid,x,y,z,r,inter);
}
}


Now this can't be done at the moment because, 2 really useful functions are missing:
SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:Angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)

SpawnPlayer(playerid)

However you could try with timers, but it won't work either because you need SetTimerEx function which is obviously not added yet...

So at the moment it's not possible.
#22
mIRC/pawn Scripting / Re: Prop Spawn
March 28, 2011, 12:54:12 PM
What you mean by prop spawn ? i don't get it so I'm not able to help you before i know what it is.
#23
mIRC/pawn Scripting / Re: Skin Bugg!!
March 27, 2011, 04:25:31 PM
If you used SetPlayerSkin function then this is no surprise... it's bugged, otherwise i don't know what can be the problem.

Damn... i wish devs released 0.3r3 with only bug fixes for pawn...  :'(
Some of the most important things are bugged... it's kind pointless to make cool server at the moment...
#24
mIRC/pawn Scripting / Re: HELP NEEDED GUYS!!!
March 26, 2011, 09:37:00 PM
Quote from: tato on March 26, 2011, 09:06:13 PM
is kind of like this but is bugged i need to fix it here is the command but i need to fix it i just gave to you maybe you got an idea so if you can fix it perfect! but i will try to fix it
else if (strcmp(cmd, "heal", true) == 0) {
tmp = strtok(cmdtext, idx);
new snick[256], plr,  szMsg[256];
snick = strtok(cmdtext, idx), plr = FindPlayerIDFromString(snick);
if (!strlen(tmp)) SendClientMessage(playerid,COLOR_GREEN, "Usage: /c heal [Nick/ID]");
else {
format(szMsg,sizeof(szMsg),"%s Healed Player:[ %s ]",gPlayers[playerid],gPlayers[plr]);
SendClientMessageToAll(COLOR_GREEN,szMsg);
SetPlayerHealth(plr,100);
}
return 1;
}


In first place i recommend you NOT using mode.pwn but make your own from scratch, this gm is so much NOT newbie friendly and sooooooo much against server performance.
#25
mIRC/pawn Scripting / Re: HELP NEEDED GUYS!!!
March 26, 2011, 07:13:43 PM
if (strcmp(cmd, "heal", true) == 0)
{
new
tmp[20],
id;
tmp = strtok(cmdtext, index);
if (strlen(tmp))
{
id = strval(tmp);
if (IsPlayerConnected(id))
{
SetPlayerHealth(id, 100.0);
SendClientMessage(id, 0x00FF00AA, "You have been healed");
SendClientMessage(playerid, 0x00FF00AA, "Player healed");
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Player not found");
}
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/heal <playerid>\"");
}
return 1;
}


And at the end of the script you have to add strtok definition:

strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}

new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}

I recommend looking into SA-MP wiki there is a lot useful stuff about pawn.

You can find the command and explanation here:

http://wiki.sa-mp.com/wiki/Strtok

I wish someone re defined dcmd for vc-mp  ::)
#26
mIRC/pawn Scripting / Re: Help needed please
March 24, 2011, 03:37:41 PM
There can be some typos in this, done really quickly.

http://pastebin.com/vSXv1hqc

Now if you want to make it even cooler add another timer which will check if the player is in the radius of the bomb site, which will prevent from typing /c defuse and letting player to defuse bomb anywhere he wants.

I hope this helped ;).