[HELP] Adding to game
#1

Hey there,

if you have read my other threads you will know that i am new, im trying to script a freeroam server and having good luck so far but, i have no idea how to add player clock or player location like that please note thats not me, or my server it was infact picked from ****** to show what i want to add in simply displaying player clock player day and player location. of course you cannot see that the game time is in seconds not minutes so this equals to 24mins = day can anyone tell me how to do this also please explain what time format the timers are in i see 60000 for 1minute is that ms then? also how to i add the scoreboard to the right handside ?


thanks
Reply
#2

the ingame clock is a good way to go, you will need to script a bit more on it in order to make the weather changes smooth btw.. have a look here: https://sampwiki.blast.hk/wiki/TogglePlayerClock
its a good idea to place it in the OnPlayerConnect() btw
the deathlist (F9) icons are sent by using SendDeathMessage():
Код:
public OnPlayerDeath(playerid, killerid, reason){
	SendDeathMessage(killerid,playerid,reason);
}
.. and can be used to show a player connecting/disconnecting aswell, by using the reason 200 and 201.
for a location textdraw (left bottom "Harry Gold Parkway") you should search here for a "zone" filterscript, you wont have problems finding one..
yes, timers are using the ms (milliseconds). you will need such a "precise" timer in order to let your server adjust the game clock for players (when you pause game, then your clock will freeze aswell until you unpause again), so updating each players' clock each gamehour (or real minute) will do fine.
oh, btw: i already figured out that this is not your server after 1/2 second: its a screenshot from CrazyBob's Cops and Robbers, yet the State-Of-The-Art CnR server
Reply
#3

thanks for the post sorry for the let reply but i have just got round to adding this and i get errors:

PHP код:
public OnPlayerDeath(playeridkilleridreason){
    
SendDeathMessage(killerid,playerid,reason);
}
    
SetPlayerWantedLevel(playerid0);
    
SetPlayerWantedLevel(killerid6);
     
GivePlayerMoney(killerid15000);
    
GivePlayerMoney(playerid, -5000);
    
SetPlayerColor(killerid0xD60000FF);
    
SetPlayerColor(playerid0xFFFFFFFF);
    
SetPlayerHealth(killerid100);
    
SetPlayerArmour(killerid100);
    
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
    
SetPlayerScore(playerid,GetPlayerScore(playerid)-1);
    return 
1;

Error:
Код:
C:\Users\Unlimited DMers\Desktop\Fas FreeRoam\gamemodes\FasFR.pwn(114) : error 021: symbol already defined: "SetPlayerWantedLevel"
C:\Users\Unlimited DMers\Desktop\Fas FreeRoam\gamemodes\FasFR.pwn(124) : error 010: invalid function or declaration
C:\Users\Unlimited DMers\Desktop\Fas FreeRoam\gamemodes\FasFR.pwn(680) : warning 203: symbol is never used: "Server"
C:\Users\Unlimited DMers\Desktop\Fas FreeRoam\gamemodes\FasFR.pwn(680) : warning 203: symbol is never used: "strtok"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
never mind about the warnings
Reply
#4

theres one } too much in the callback:
Код:
public OnPlayerDeath(playerid, killerid, reason){
	SendDeathMessage(killerid,playerid,reason);
	SetPlayerWantedLevel(playerid, 0);
	SetPlayerWantedLevel(killerid, 6);
	GivePlayerMoney(killerid, 15000);
	GivePlayerMoney(playerid, -5000);
	SetPlayerColor(killerid, 0xD60000FF);
	SetPlayerColor(playerid, 0xFFFFFFFF);
	SetPlayerHealth(killerid, 100);
	SetPlayerArmour(killerid, 100);
	SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
	SetPlayerScore(playerid,GetPlayerScore(playerid)-1);
	return 1;
}
and now recompile... errors gone?
Reply
#5

thanks yep all gone thank you by the way do you now how crazybob creates his buildings ? because he has scripted building that dont exist for example 24/7 shops
Reply
#6

dont spose you could help be script a FS could you? i have an idea but have no idea how to script it
Reply
#7

Use the map editor found on forum, it will generate the code that actually places buildings and items etc in game.

What's the idea?
Reply
#8

i shall pm you as i want to release it at a later date but dont want to advertise it just yet if thats okay ?
Reply
#9

mesaged
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)