Posts: 53
Threads: 3
Joined: Nov 2008
Reputation:
0
Thank you for writing it.I have tried it, it works with full name, but it doesnt with part of name.
I have found a solution, which works, its form extreme admin:
stock ReturnPlayerID(PlayerName[]) {
for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) { new name[24]; GetPlayerName(i,name,24); if(strfind(name,PlayerName,true)!=-1) return i; }
return INVALID_PLAYER_ID;
}
How can i make that, if there are multiple users with the same "part of the name" (for example clan symbols), it returns an error message ?
Posts: 53
Threads: 3
Joined: Nov 2008
Reputation:
0
Thank you, it works. I modified a bit, because it said unreachable code, so the last 2 lines are: else if(TotalPlayerByName == 1)return FinalID; return INVALID_PLAYER_ID;
Posts: 2,938
Threads: 162
Joined: May 2010
public OnPlayerRequestSpawn(playerid)
{
new str[128];
format(pfile, sizeof(pfile), pfile_path, Playername(playerid));
if(dini_Exists(pfile))
{
SendClientMessage(playerid, BRIGHTRED, "");
SendClientMessage(playerid, BRIGHTRED, "");
SendClientMessage(playerid, BRIGHTRED, "");
SendClientMessage(playerid, BRIGHTRED, "--------------------------------------------");
SendMsg(playerid, BRIGHTRED, "*SERVER: THIS NAME IS REGISTERD PLEASE LOGIN /LOGIN [PASSWORD]");
format(str, sizeof(str),"", Playername(playerid));
SendMsg(playerid, YELLOW, "*SERVER: Registered Username:%s ");
SendClientMessage(playerid, BRIGHTRED, "--------------------------------------------");
}
else
{
SendClientMessage(playerid, BRIGHTRED, "");
SendClientMessage(playerid, BRIGHTRED, "");
SendClientMessage(playerid, BRIGHTRED, "");
SendClientMessage(playerid, BRIGHTRED, "--------------------------------------------");
format(str, sizeof(str),"", Playername(playerid));
SendMsg(playerid, BRIGHTRED, "*SERVER: You Are Not Registered Please Register Using /Register [PASSWORD]!");
SendClientMessage(playerid, BRIGHTRED, "--------------------------------------------");
return 0;
}
i just want it to be if the person isnt registered
no function like dini_doesnot_exist<.<?
Posts: 2,938
Threads: 162
Joined: May 2010
this crashes the server when i try to spawn.
btw how did you get your thing into a pawn code? idk how with the new forum
public OnPlayerRequestSpawn(playerid)
{
new str[128];
format(pfile, sizeof(pfile), pfile_path, Playername(playerid));
if(!dini_Exists(pfile))
{
SendClientMessage(playerid, BRIGHTRED, "");
SendClientMessage(playerid, BRIGHTRED, "");
SendClientMessage(playerid, BRIGHTRED, "");
SendClientMessage(playerid, BRIGHTRED, "--------------------------------------------");
format(str, sizeof(str),"", Playername(playerid));
SendMsg(playerid, BRIGHTRED, "*SERVER: You Are Not Registered Please Register Using /Register [PASSWORD]!");
SendClientMessage(playerid, BRIGHTRED, "--------------------------------------------");
return 0;
}
if(IsLogged[playerid] == 0)
{
SendClientMessage(playerid, BRIGHTRED, "");
SendClientMessage(playerid, BRIGHTRED, "");
SendClientMessage(playerid, BRIGHTRED, "");
SendClientMessage(playerid, BRIGHTRED, "--------------------------------------------");
SendMsg(playerid, BRIGHTRED, "*SERVER: THIS NAME IS REGISTERD PLEASE LOGIN /LOGIN [PASSWORD]");
format(str, sizeof(str),"", Playername(playerid));
SendMsg(playerid, YELLOW, "*SERVER: Registered Username:%s ");
SendClientMessage(playerid, BRIGHTRED, "--------------------------------------------");
return 0;
}
return 1;
}
Posts: 2,286
Threads: 18
Joined: Jun 2010
Hey how can I put a limit so that in one team only one player can spawn but in the other teams more than 1 people can spawn ?
Posts: 2,286
Threads: 18
Joined: Jun 2010
Hey how can I put a limit so that in one team only one player can spawn but in the other teams more than 1 people can spawn ?
Posts: 53
Threads: 3
Joined: Nov 2008
Reputation:
0
I am looking for a code, which converts a number like this:
12000 -> 12 000 or 12.000
(if the number is bigger, then like this: 123456789 -> 123.456.789)
Posts: 53
Threads: 3
Joined: Nov 2008
Reputation:
0
I tried it, it works fine.
Thank you very much for your help!! Very useful stuff for me.
Posts: 16
Threads: 1
Joined: Oct 2010
Reputation:
0
you stole it from here right? ^
you cant make code knowing you dont have the includes..
anyway,
download dutils from dracoblue.net
and put it in pawno>includes folder, then recompile
Posts: 16
Threads: 1
Joined: Oct 2010
Reputation:
0
download dini too, from the same website
Posts: 3,934
Threads: 353
Joined: Jan 2010
Reputation:
0
You need to include dutils or get the dutils.inc