Many things
#1

First, I decided to expand my "random weather code" with a possibility for a player to disable it (Boolean parameter)...
I got these:
Код:
C:\Users\Zeid\Desktop\SAMPSERVER\gamemodes\ZGM.pwn(337) : warning 213: tag mismatch
C:\Users\Zeid\Desktop\SAMPSERVER\gamemodes\ZGM.pwn(353) : warning 213: tag mismatch
C:\Users\Zeid\Desktop\SAMPSERVER\gamemodes\ZGM.pwn(353) : warning 213: tag mismatch
C:\Users\Zeid\Desktop\SAMPSERVER\gamemodes\ZGM.pwn(354) : warning 213: tag mismatch
C:\Users\Zeid\Desktop\SAMPSERVER\gamemodes\ZGM.pwn(354) : warning 213: tag mismatch
And here is the code itself:
Код:
#include <zs> //this contains includes I use, like a_samp, zcmd or sscanf2 and color definitions...
forward weather(playerid);
new bool:wthr[MAX_PLAYERS]; //new Boolean value
public OnGameModeInit() {
	SetTimer("weather", 60*60*1000, 1); //one hour timer
	return 1;
}
public weather(playerid) {
	if(wthr[playerid] == 0) return 0;
	new wstr[40];
	new rand = random(45);
	format(wstr, sizeof(wstr), "The weather has been changed to %i!", rand);
	SendClientMessageToAll(0xAA0000AA, wstr);
	SetPlayerWeather(playerid, rand);
	return 1;
}
CMD:srw(playerid) {
	if(wthr[playerid] == 1) return wthr[playerid] == 0;
	if(wthr[playerid] == 0) return wthr[playerid] == 1;
	return 1;
}
Second, I would like to know how to print some stuff to the .txt file in the server folder. For example, only reports that players made (/report, for pointing to admins on hackers).

Third, I would like to know which function is used to create this (posted link only since I find this post big anyway):
http://i23.servimg.com/u/f23/16/43/40/22/sa-mp-11.jpg

Thanks!
Reply
#2

Try this:

pawn Код:
#include <zs> //this contains includes I use, like a_samp, zcmd or sscanf2 and color definitions...
forward weather(playerid);
new bool:wthr[MAX_PLAYERS]; //new Boolean value
public OnGameModeInit() {
    SetTimer("weather", 60*60*1000, 1); //one hour timer
    return 1;
}
public weather(playerid) {
    if(wthr[playerid] == false) return 0;
    new wstr[40];
    new rand = random(45);
    format(wstr, sizeof(wstr), "The weather has been changed to %i!", rand);
    SendClientMessageToAll(0xAA0000AA, wstr);
    SetPlayerWeather(playerid, rand);
    return 1;
}
CMD:srw(playerid) {
    if(wthr[playerid] == true) return wthr[playerid] == false;
    if(wthr[playerid] == false) return wthr[playerid] == true;
    return 1;
}
Reply
#3

Quote:
Originally Posted by Zeyo
Посмотреть сообщение
Third, I would like to know which function is used to create this (posted link only since I find this post big anyway):
http://i23.servimg.com/u/f23/16/43/40/22/sa-mp-11.jpg
Its called a Marker. Use this:

Код:
SetPlayerMarkerForPlayer
Or are you asking about the " i " thing?
Reply
#4

Quote:
Originally Posted by Zeyo
Посмотреть сообщение
Third, I would like to know which function is used to create this (posted link only since I find this post big anyway):
http://i23.servimg.com/u/f23/16/43/40/22/sa-mp-11.jpg

Thanks!
this is called checkpoint
pawn Код:
SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size)
HAVE A LOOK HERE:Checkpoint
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)