SA-MP Forums Archive
help me ! - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: help me ! (/showthread.php?tid=81365)



help me ! - eden78 - 10.06.2009

Код:
	if(strcmp(cmd,"/regp",true) == 0)
	{
		tmp = strtok(cmdtext,idx);
	  if(IsPlayerConnected(playerid))
	  {
	    if(PlayerData[playerid][AdminLevel] >= 3)
			{
				new length = strlen(cmdtext);
				while ((idx < length) && (cmdtext[idx] <= ' '))
				{
					idx++;
				}
				new offset = idx;
				new result[128];
				while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
				{
					result[idx - offset] = cmdtext[idx];
					idx++;
				}
				result[idx - offset] = EOS;
	  			if(!strlen(tmp))
 				{
					SendClientMessage(playerid, 0xE6E6E6E6, "SERVER: /regp [password] [name]");
				}
				else
{

					}
					else
					{
						format(string, sizeof(string), "SERVER: %s is already registered.", result);
						SendClientMessage(playerid, 0x9ACD32AA, string);
					}
				}
			}
		}
		else
		{
			format(string, sizeof(string), "SERVER: You are not connected, or you are not an admin !");
			SendClientMessage(playerid, 0xE6E6E6E6, string);
		}
		return 1;
	}



Re: help me ! - eden78 - 10.06.2009

i want to do this , infront of /regp pass name ,
to do /regp name pass .
its something in strtok .