How do i set the value of a string to null - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How do i set the value of a string to null (
/showthread.php?tid=512868)
How do i set the value of a string to null -
Xtreme Brotherz - 13.05.2014
I have variables which stores the name and ip of a player
Код:
PlayerInfo[playerid][PlayerName]
PlayerInfo[playerid][IP]
When a player connects, i store the playername and ip in those variables
How can i clear the variable onplayerdisconnect
Can i just do
Код:
PlayerInfo[playerid][PlayerName] = '\0'
PlayerInfo[playerid][IP] = '\0'
Thanks!
Re: How do i set the value of a string to null -
Beckett - 13.05.2014
Why would you divide that by 0? just set it to 0?
E.G:
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
PlayerInfo[playerid][PlayerName] = "None" or 0
PlayerInfo[playerid][IP] = "None" or 0
}
Why wouldn't you do that?
Re: How do i set the value of a string to null -
Xtreme Brotherz - 13.05.2014
Quote:
Originally Posted by DaniceMcHarley
Why would you divide that by 0? just set it to 0?
|
That wasn't a zero!
It is the null character
Re: How do i set the value of a string to null -
Beckett - 13.05.2014
Then just make it as "None".
**Edited my previous post**